Database-based data processing method and device, medium, equipment and program product

By adopting the computing/storage separation architecture and tenant key management methods in the database system, the encrypted storage and decryption of data in a multi-tenant environment is realized, which solves the problem that the database system in the existing technology cannot perform data encryption at the tenant granularity. Storage issues, reducing costs and improving performance.

CN118656864APending Publication Date: 2024-09-17BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410842176.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

Existing database systems cannot encrypt and store data at the tenant granularity, resulting in high database system modification costs or waste of resources, making them unsuitable for large-scale tenant environments.

Method used

Adopting a computing/storage separation architecture, it receives tenant data processing requests through the database computing layer, obtains the tenant key to decrypt the encrypted node data of the index tree, and determines the leaf node of the data operation in the index tree to implement encrypted storage and storage of data. Decryption avoids the need to modify the existing database system kernel and deploy instances independently for each tenant.

Benefits of technology

It achieves data isolation among multi-tenants, saves data storage costs, and improves the data storage scale and performance of the database system. The data size of a single table is increased from 20,000 rows to 1 million rows, and the average performance is increased by 30%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656864A
    Figure CN118656864A
Patent Text Reader

Abstract

The invention relates to a database-based data processing method and device, a medium, equipment and a program product, and relates to the technical field of data storage. According to the method, a target data processing request is received, and a target tenant key corresponding to a target tenant is obtained through a database calculation layer; decrypting the encrypted node data information of the index tree corresponding to the target data processing request according to the target tenant key to obtain decrypted node data information, determining a leaf node for the target data operation in the index tree based on the decrypted node data information and the target data, and determining the target data operation in the index tree based on the leaf node. And executing the target data operation, hosting encryption and decryption operations aiming at the data corresponding to the tenant and the index tree in a database calculation layer, and realizing separation of data encryption and decryption and data storage. According to the method, encryption and decryption are carried out by using the independent tenant key, so that the isolation among multiple tenants is realized under the condition of not increasing the cost, and the data storage cost is greatly reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of data storage, and in particular, to a data processing apparatus, medium, device and program product based on a database. Background Art

[0002] For data security reasons, database services require that tenant data be encrypted and stored at the tenant level. However, current database systems do not support encrypted storage of data at the tenant level in a database instance.

[0003] In related technologies, in order to realize encrypted storage of tenant data at the tenant granularity, either the database system kernel is modified or a database instance is deployed independently for each tenant. However, these two methods either have a huge database system modification cost or a huge resource cost, which is not applicable to the current tenant scale. Summary of the invention

[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, the present disclosure provides a data processing method based on a database, comprising: Receiving a target data processing request sent by a target tenant of a database service, wherein the target data processing request is used to request the database to perform a target data operation on the target data, and the database adopts a computing / storage separation architecture to support data processing for serving multiple tenants; Respond to the target data processing request through the database computing layer, obtain the target tenant key corresponding to the target tenant, decrypt the encrypted node data information of the index tree corresponding to the target data processing request according to the target tenant key, obtain the decrypted node data information, and determine the leaf node targeted by the target data operation in the index tree based on the decrypted node data information and the target data, wherein the database computing layer is used to adopt the one-tenant-one-key principle, encrypt the tenant's data and the node data information corresponding to the index tree when writing and decrypt when querying through the tenant key, and store the encrypted tenant's encrypted data and the encrypted node data information of the index tree in the database storage layer of the database; Based on the leaf node, the target data operation is performed.

[0006] In a second aspect, the present disclosure provides a data processing device based on a database, comprising: a receiving module configured to receive a target data processing request sent by a target tenant of a database service, wherein the target data processing request is used to request the database to perform a target data operation on the target data, and the database adopts a computing / storage separation architecture to support data processing for serving multiple tenants; A determination module is configured to respond to the target data processing request through a database computing layer, obtain a target tenant key corresponding to the target tenant, decrypt the encrypted node data information of the index tree corresponding to the target data processing request according to the target tenant key, obtain the decrypted node data information, and determine the leaf node targeted by the target data operation in the index tree based on the decrypted node data information and the target data, wherein the database computing layer is used to adopt a one-tenant-one-key principle, encrypt the tenant's data and the node data information corresponding to the index tree when writing and decrypt when querying through the tenant key, and store the encrypted tenant's encrypted data and the encrypted node data information of the index tree in the database storage layer of the database; An execution module is configured to execute the target data operation based on the leaf node.

[0007] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.

[0008] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect.

[0009] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which implements the steps of the method described in the first aspect when executed by a processor.

[0010] Based on the above technical solution, by receiving the target data processing request sent by the target tenant of the database service, responding to the target data processing request through the database computing layer, obtaining the target tenant key corresponding to the target tenant, decrypting the encrypted node data information of the index tree corresponding to the target data processing request according to the target tenant key, obtaining the decrypted node data information, and determining the leaf node targeted by the target data operation in the index tree based on the decrypted node data information and the target data, and then executing the target data operation based on the leaf node, the encryption and decryption operations for the data corresponding to the tenant and the index tree can be hosted in the database computing layer, realizing the separation of data encryption and decryption from data storage. Moreover, by using independent tenant keys for encryption and decryption between multiple tenants, isolation between multiple tenants can be achieved without modifying the kernel of the existing database system and without independently deploying a database instance for each tenant, which greatly saves data storage costs and improves the data storage scale and performance of the database system.

[0011] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 The present invention is a flowchart of a method for processing data based on a database according to some embodiments.

[0013] Figure 2 It is a schematic diagram showing the association relationship among tables, indexes, and index trees according to some embodiments.

[0014] Figure 3 is a schematic diagram of a database system according to some embodiments.

[0015] Figure 4 is a schematic diagram of an index tree according to some embodiments.

[0016] Figure 5 is a schematic diagram showing writing first target data according to some embodiments.

[0017] Figure 6 is a schematic diagram showing deleting second target data according to some embodiments.

[0018] Figure 7 is a schematic diagram showing reading third target data according to some embodiments.

[0019] Figure 8 is a schematic diagram of signature verification according to some embodiments.

[0020] Fig. 9 It is a schematic diagram of the structure of a data processing device based on a database according to some embodiments.

[0021] Fig.10 is a schematic diagram of the structure of an electronic device according to some embodiments. DETAILED DESCRIPTION

[0022] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0023] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0024] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0025] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0026] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0027] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0028] Figure 1FIG. 1 is a flowchart of a method for processing data based on a database according to some embodiments. Figure 1 As shown, the embodiment of the present disclosure provides a method for data processing based on a database, which can be executed by an electronic device, specifically by a data processing device based on a database, which can be implemented by software and / or hardware and configured in an electronic device. Figure 1 As shown, the method may include the following steps.

[0029] In step 110, a target data processing request sent by a target tenant of a database service is received.

[0030] Here, database service refers to software or system that provides database functions. Database service allows users to store, retrieve and manage data. It should be noted that database service can be deployed locally or cloud-based. Tenant in multi-tenant architecture (MTA) represents different users, organizations, companies or customers, which share the same database system instance but the data is isolated from each other. In a tenant, one or more users can be included. Accordingly, the target data processing request sent by the target tenant can be a target data processing request sent by a user under the target tenant, which is used to request the database to perform a target data operation on the target data.

[0031] The target data operation may be a data write operation, a data query operation, a data delete operation, etc. The data write operation is used to write target data into the database, the data query operation is used to query the target data in the database, and the data delete operation is used to delete the target data in the database.

[0032] Exemplarily, the target data processing request sent by the target tenant may be received by the database computing layer in the database system.

[0033] It is worth noting that in the embodiments of the present disclosure, the database adopts a computing / storage separation architecture to support data processing for multiple tenants. The computing / storage separation architecture separates the database computing layer responsible for processing data logic and query from the database storage layer responsible for physical storage of data.

[0034] In step 120, the database computing layer responds to the target data processing request, obtains the target tenant key corresponding to the target tenant, decrypts the encrypted node data information of the index tree corresponding to the target data processing request according to the target tenant key, obtains the decrypted node data information, and based on the decrypted node data information and the target data, determines the leaf node targeted by the target data operation in the index tree.

[0035] Here, the Database Compute Layer refers to the components or services in the database system that are responsible for performing data calculations and processing. The Database Compute Layer is used to adopt the principle of one tenant, one key, and use the tenant key to encrypt the tenant's data and the node data information corresponding to the index tree when writing and decrypt it when querying, and store the encrypted tenant's encrypted data and the encrypted node data information of the index tree in the database storage layer of the database. In other words, each tenant in the database system has a corresponding tenant key, and the tenant key is used to encrypt the tenant's data and the node data information corresponding to the index tree when writing and decrypt it when querying.

[0036] When data is written to the database, the database computing layer encrypts the tenant's data written by the tenant through the target tenant key and stores it in the database storage layer, and encrypts the node data information of the index tree corresponding to the written tenant's data through the target tenant key and stores it in the database storage layer. When querying the data in the database, the encrypted node data information of the index tree encrypted and stored in the database storage layer is decrypted, and the tenant's data encrypted and stored in the database storage layer is decrypted.

[0037] In a multi-tenant architecture, the tenant key is used to encrypt and decrypt the data of a specific tenant to ensure that one tenant cannot access the encrypted data of another tenant. Different tenants have corresponding tenant keys in the database system.

[0038] The database computing layer identifies the target tenant to which the target data processing request is initiated, obtains the target tenant key corresponding to the target tenant, and uses the target tenant key to encrypt the node data information of the target tenant's index tree and the tenant's data when writing and decrypt when querying. The tenant's data may be user data corresponding to a user belonging to the tenant.

[0039] When writing tenant data to the database system, the database computing layer encrypts the tenant data with the target tenant key and stores it in the database storage layer, and encrypts the node data information of the index tree with the target tenant key and stores it in the database storage layer. When querying data in the database system, the node data information of the index tree is decrypted with the target tenant key, and the corresponding tenant data is queried based on the decrypted node data information, and the queried tenant data is decrypted to return the decrypted tenant data to the user end corresponding to the target data processing request.

[0040] The database computing layer receives the target data processing request, responds to the target data processing request, loads the table metadata of the database system, and then loads the index tree corresponding to the target data processing request through the identifier of the index tree corresponding to the index stored in the table metadata.

[0041] Figure 2 FIG. 1 is a schematic diagram showing the association relationship between tables, indexes, and index trees according to some embodiments. Figure 2 As shown, the relationship between the table, index and index tree is as follows Figure 2 As shown in the figure, PK Index (Primary Key Index) is a primary key index, which is an index created based on the primary key column of the table. Secondary Index is a secondary index or auxiliary index, which is an index created based on the non-primary key column of the table. Inverted Index is an inverted index, which is a data structure that maps content to the document or location containing the content.

[0042] In the disclosed embodiment, the index tree may be a B+Tree (a self-balancing tree data structure). In a B+Tree, all data records are stored in leaf nodes, and other internal nodes only contain key values ​​required for searching.

[0043] After the database computing layer is loaded into the index tree corresponding to the target data processing request, it obtains the target tenant key and decrypts the encrypted node data information corresponding to the index tree through the target tenant key to obtain the decrypted node data information. Based on the decrypted node data information and the target data, the leaf node targeted by the target data operation is determined in the index tree.

[0044] For example, the database computing layer can obtain the target tenant key of the target tenant from the Key Management Service (KMS). For each tenant in the database system, it can register or manage its corresponding tenant key in the key management service, and the database computing layer can access the key management service to obtain the target tenant key of the target tenant.

[0045] The determined leaf node can be understood as a node in the index tree that stores the target data targeted by the target data processing request. For example, for a B+Tree, all business data is stored in the payload of the leaf node of the B+Tree. Accordingly, the node of the target data targeted by the target data processing request is a leaf node in the B+Tree.

[0046] It should be noted that the database computing layer can start from the root node of the index tree, traverse the index tree from top to bottom, and decrypt the encrypted node data information corresponding to each traversed node through the target tenant key to obtain the decrypted node data information. Then, according to the decrypted node data information and the target data, the next node to be traversed is searched in the index tree until the leaf node targeted by the target data processing request is found.

[0047] That is to say, in the process of decrypting the index tree by the target tenant key, the encrypted node data information of all nodes of the index tree may be decrypted. Of course, it is also possible not to decrypt the encrypted node data information of all nodes of the index tree, but to decrypt the encrypted node data information corresponding to the node related to the target data processing request.

[0048] In step 130, a target data operation is performed based on the leaf node.

[0049] Here, after the leaf node is determined, the target data operation is performed on the leaf node. It should be noted that the operation performed on the leaf node is different according to the different data processing operations indicated by the target data operation.

[0050] For example, if the target data operation is a data write operation, the target data specified by the target data processing request is written to the leaf node. For another example, if the target data operation is a data read operation, the target data specified by the target data processing request is read from the leaf node.

[0051] Thus, by receiving the target data processing request sent by the target tenant of the database service, responding to the target data processing request through the database computing layer, obtaining the target tenant key corresponding to the target tenant, decrypting the encrypted node data information of the index tree corresponding to the target data processing request according to the target tenant key, obtaining the decrypted node data information, and determining the leaf node targeted by the target data operation in the index tree based on the decrypted node data information and the target data, and then executing the target data operation based on the leaf node, the encryption and decryption operations for the data corresponding to the tenant and the index tree can be hosted in the database computing layer, so as to realize the separation of data encryption and decryption from data storage. Moreover, by using independent tenant keys for encryption and decryption between multiple tenants, isolation between multiple tenants can be realized without modifying the kernel of the existing database system and without independently deploying a database instance for each tenant, which greatly saves the data storage cost and improves the data storage scale and performance of the database system. For example, it has been shown through testing that, through the method provided in the embodiment of the present disclosure, the data scale of a single table in the database system is increased from 20,000 rows to 1 million rows, and the average performance is improved by at least 30%.

[0052] Figure 3 is a schematic diagram of a database system according to some embodiments. Figure 3 As shown, different tenants in the database system can register / manage their corresponding tenant keys in the key management service. Moreover, users in different tenants can send target data operations to the database computing layer of the database system, and the database computing layer performs key access to the key management service to obtain tenant keys corresponding to different tenants. In addition, the database computing layer encrypts the tenant data of different tenants and the node data information of the index tree in the database storage layer through the tenant key, and encrypts the node data information of the index tree in the storage layer through the tenant key.

[0053] In the process of executing the target data processing request, the tenant data and the node data information of the index tree are encrypted when written and decrypted when queried through the tenant key, so as to achieve one tenant one key in the database system and realize isolation between different tenants.

[0054] It is worth noting that in the embodiments of the present disclosure, the database storage layer may be a distributed key-value storage layer, which is a distributed data storage system that uses key-value pairs as basic data storage units.

[0055] In some feasible implementations, in step 120, starting from the root node of the index tree, the nodes of the index tree can be traversed in sequence. When traversing a node, the encrypted node data information corresponding to the node is read from the database storage layer according to the node identifier, and the encrypted node data information is decrypted using the target tenant key to obtain the node data information. The next node is determined according to the node data information and the target key corresponding to the target data, until the leaf node targeted by the target data operation is traversed.

[0056] Here, traversing the nodes of the index tree starting from the root node of the index tree means traversing the nodes of the index tree from the root node of the index tree from top to bottom until a leaf node targeted by the target data operation is found in the index tree.

[0057] Figure 4 FIG. 1 is a schematic diagram of an index tree according to some embodiments. Figure 4 As shown, the index tree includes a root node with ID: 0, a non-leaf node with ID: 1, a non-leaf node with ID: 2, a leaf node with ID: 3, a leaf node with ID: 4, and a leaf node with ID: 5. Among them, 0, 1, 2, 3, 4, and 5 are the numerical serial numbers of the nodes in the index tree.

[0058] Among them, the node data information corresponding to the root node of ID: 0 includes "Ref 1, min: 1, max: 10, size: 10, count: 10" and "Ref 2, min: 11, max: 14, size: 5, count: 4". Ref 1 means that the child node of the root node of ID: 0 is the node of ID: 1, min: 1 means that the minimum value of all keys in the child node of ID: 1 is 1, max: 10 means that the maximum value of all keys in the child node of ID: 1 is 10, size: 10 means that the number of key-value pairs contained in the child node of ID: 1 is 10, and count: 10 means that the number of child nodes corresponding to the child node of ID: 1 is 10. The node data information corresponding to the leaf node of ID: 3 includes "keys: [1, 2, 3, 4, 5], values: [1, 1, 2, 2, 2]". keys:[1,2,3,4,5] represents the keys stored in the leaf node with ID: 3, and values:[1,1,2,2,2] represents the values ​​corresponding to the keys stored in the leaf node with ID: 3.

[0059] For non-leaf nodes in the index tree, it stores the node identifier (ID) and node data information of the non-leaf nodes. It should be noted that for non-leaf nodes, the node data information stored can be node statistics, which is used to provide important data about the content and characteristics of the node to optimize query operations, maintain the balance of the tree, and perform data management. The node data information corresponding to the non-leaf node can be loaded from the storage layer through the non-leaf node ID, and the child nodes required for the target data operation can be loaded on demand according to the node data information.

[0060] It is worth noting that in the index tree, the min_value of the non-leaf nodes arranged on the right must be greater than the max_value of the non-leaf nodes arranged on the left. Moreover, according to the uniqueness principle of the key, the min_value and the max_value will not be equal.

[0061] For the leaf nodes in the index tree, the key is sorted from small to large in the node data information stored, and the value size is not related to the sorting. For example, Figure 4 As shown, in the leaf node of ID: 3, the keys in keys: [1, 2, 3, 4, 5] are sorted from small to large, and the size and sorting of the values ​​in values: [1, 1, 2, 2, 2] are irrelevant. Among them, the node data information of the leaf node can be included in the payload of the leaf node.

[0062] It should be understood that, for nodes at the same level in the index tree, each node from left to right can be sorted from small to large according to the key contained in the subtree.

[0063] It is worth noting that the node data information corresponding to each node in the index tree is encrypted by the tenant key and stored in the database storage layer. For example, the node data information corresponding to the root node with ID: 0 can be serialized, and the serialized information can be encrypted by the tenant key and stored in the database storage layer. Figure 4 As shown in the figure, the node data information of "Ref 1, min:1, max:10, size:10, count:10" and "Ref 2, min:11, max:14, size:5, count:4" corresponds to IndexRootProto 0 in the database storage layer. When the node data information corresponding to the root node of ID: 0 needs to be read, "IndexRootProto 0" is read in the database storage layer, and decrypted and deserialized using the tenant key to obtain the node data information "Ref 1, min:1, max:10, size:10, count:10" and "Ref 2, min:11, max:14, size:5, count:4" corresponding to the root node of ID: 0. The node data information "keys:[1,2,3,4,5] and values:[1,1,2,2,2]" in the leaf node of ID: 3 corresponds to FxTreeNodeProto3 in the database storage layer.

[0064] Therefore, instead of decrypting the encrypted node data information of all nodes of the index tree, the encrypted node data information corresponding to the node related to the target data processing request can be decrypted, so as to quickly determine the corresponding leaf node. In other words, the nodes in the index tree are loaded on demand through the target data.

[0065] In some embodiments, the index tree uses node identifiers to represent each node in the index tree, and the node identifiers are obtained by sorting based on digital symbols without business semantics.

[0066] It should be noted that each node in the index tree is represented by a node identifier, rather than by the semantics of the stored node data information. The node identifier may be a digital symbol without the semantics of the business data.

[0067] Exemplarily, the digital sequence may be generated in sequence. Figure 4 As shown, the nodes in the index tree are organized and sorted according to numerical sequence numbers from small to large.

[0068] That is to say, even if the index tree is viewed by a tenant who does not correspond to the index tree, only the node identifier corresponding to each node of the index tree can be viewed, but the node data information corresponding to the node cannot be obtained, so any information related to the business data will not be leaked.

[0069] It should be understood that the node identifier corresponding to each node in the index tree is unique in the index tree, but may not be unique globally.

[0070] When receiving the target data processing request, the database computing layer traverses the nodes of the index tree starting from the root node of the index tree until the leaf node targeted by the target data operation is found. During the traversal process, each time a node is traversed, the encrypted node data information corresponding to the node is read from the database storage layer according to the node identifier of the node, and the encrypted node data information is decrypted based on the target tenant key to obtain the decrypted node data information. Then, based on the decrypted node data information and the target key corresponding to the target data targeted by the target data operation, the next node to be traversed is determined in the index tree. Then, for the next node to be traversed, the above operation is performed in the same way until the leaf node of the index tree is traversed, thereby determining the leaf node targeted by the target data processing request.

[0071] For example, Figure 4 As shown, assuming that the target data operation is to write the first target data, the target key corresponding to the first target data is 4, starting from the root node of the index tree, the nodes of the index tree are traversed from top to bottom. First, the root node of ID: 0 is traversed, and the encrypted node data information "IndexRootProto 0" corresponding to the root node of ID: 0 is read in the database storage layer through the node identifier "0" of the root node. Then, "IndexRootProto0" is decrypted and deserialized through the target tenant key to obtain the decrypted node data information "Ref 1, min: 1, max: 10, size: 10, count: 10" and "Ref 2, min: 11, max: 14, size: 5, count: 4" of the root node of ID: 0.

[0072] Through "Ref 1, min:1, max:10, size:10, count:10", "Ref 2, min:11, max:14, size:5, count:4" and the target key "4" corresponding to the first target data, it is determined in the index tree that the next node to be traversed is the non-leaf node of ID: 1. Among them, "Ref 1, min:1, max:10" means that the range of keys stored in the child nodes of the non-leaf node of ID: 1 is [1, 10]. Therefore, the first target data of the target key "4" is stored in the child nodes under the non-leaf node of ID: 1.

[0073] For the determined non-leaf node with ID: 1, the encrypted node data information "FxTreeNodeProto1" corresponding to the non-leaf node with ID: 1 is obtained in the database storage layer, and then "FxTreeNodeProto1" is decrypted and deserialized using the target tenant key to obtain the decrypted node data information "Ref 3, min: 1, max: 5, size: 20, count: 10" and "Ref 4, min: 6, max: 10, size: 20, count: 5" of the non-leaf node with ID: 1.

[0074] Through the node data information of "Ref 3, min:1, max:5, size:20, count:10" and "Ref 4, min:6, max:10, size:20, count:5" and the target key "4" corresponding to the first target data, it is determined that the leaf node with ID: 3 is the leaf node corresponding to the first target data.

[0075] It should be noted that the target key corresponding to the first target data can be understood as a key used to prepare to write the first target data into the database system.

[0076] It is worth noting that after the leaf node corresponding to the first target data is determined, the first target data can be stored in the corresponding leaf node in the form of a key-value pair. Then, the first target data is encrypted and stored in the database storage layer using the target tenant key.

[0077] Therefore, through the above implementation, the node data information of the index tree and the tenant's data are encrypted and stored in the database storage layer, thereby completely ensuring the encrypted storage of the index tree and the tenant's data, and realizing encryption during writing and decryption during querying. By using independent tenant keys for encryption and decryption between multiple tenants, isolation between multiple tenants can be achieved without modifying the kernel of the existing database system and without independently deploying a database instance for each tenant, which greatly saves data storage costs and improves the data storage scale and performance of the database system. Moreover, each node in the index tree is represented by a node identifier that does not contain business semantics, which can avoid leaking any information related to business data.

[0078] In some achievable implementations, the target data operation includes an instruction to perform data addition and deletion operations on leaf nodes based on the target data. Accordingly, in step 130, data addition and deletion operations can be performed through the database computing layer, and data addition and deletion can be performed on leaf nodes based on the target data. According to the node state of the leaf node after the data addition and deletion operation, the node data information corresponding to the ancestor node of the leaf node is updated, and for each node in the index tree where data changes occur, the node data information corresponding to the node is encrypted according to the target tenant key through the database computing layer, and the encrypted node data information obtained by encryption is stored in the database storage layer.

[0079] Here, the data addition and deletion operation refers to writing or deleting data to a leaf node through target data. Exemplarily, the data addition and deletion operation may be a data writing operation for indicating that the first target data is stored in the leaf node. That is, the first target data is written in the leaf node. The data addition and deletion operation may be a data deletion operation for indicating that the second target data is deleted in the leaf node. That is, the second target data is deleted in the leaf node.

[0080] After determining the leaf node targeted by the data addition and deletion operation through the above implementation, the database computing layer performs the data addition and deletion operation, and adds and deletes data on the leaf node based on the target data. Then, according to the node state of the leaf node after the data addition and deletion operation, the node data information corresponding to the ancestor node of the leaf node is updated.

[0081] The node state of a leaf node refers to the state of the leaf node after data addition and deletion operations, which is used to represent the data stored in the leaf node. The ancestor node of a leaf node refers to all parent nodes above the leaf node in the index tree. In a hierarchical structure, the ancestor node is all nodes traced back through continuous parent node links. Figure 4 As shown, the ancestor nodes corresponding to the leaf node with ID: 3 include the non-leaf node with ID: 1 and the root node with ID: 0.

[0082] Updating the node data information corresponding to the ancestor node of the leaf node according to the node status of the leaf node after the data addition and deletion operation refers to updating the node statistical information corresponding to the ancestor node so that the corresponding leaf node can be found according to the updated node statistical information.

[0083] Then, for each node in the index tree where data changes occur, the node data information corresponding to the node is encrypted using the target tenant key, and the encrypted node data information is stored in the database storage layer.

[0084] In some embodiments, the data addition and deletion operation may be a data write operation for indicating that the first target data is stored in the leaf node. Accordingly, the data write operation may be performed by the database computing layer to insert the first target data into the leaf node.

[0085] After the first target data is inserted into the leaf node, the leaf node adds the first target data, which is the node where the data has changed. Similarly, the node data information corresponding to the ancestor node of the leaf node will also be updated, and the ancestor node of the leaf node is also a node where the data has changed. For each node where the data has changed, the database computing layer encrypts the changed node data information and stores it in the database storage layer through the target tenant key to achieve encrypted storage of data.

[0086] Figure 5 FIG. 4 is a schematic diagram showing writing first target data according to some embodiments. Figure 5 As shown, the database computing layer loads the table metadata, and loads the index tree corresponding to the first target data according to the table metadata. Then, the encrypted node data information of the root node is loaded in the database storage layer through the node identifier of the root node in the index tree, and the encrypted node data information of the root node is decrypted through the target tenant key.

[0087] Next, the encrypted node data information of the next node is loaded on demand through the target key of the first target data and the node data information after decryption of the root node, and the encrypted node data information of the next node is decrypted through the target tenant key. By judging whether the next node loaded is a leaf node, it is determined whether to load into the leaf node of the index tree. If the next node is not a leaf node, continue to load the nodes of the next layer until the leaf node. It should be noted that the target key corresponding to the first target data can be understood as the key used to prepare the first target data to be written to the database system. In other words, the target key of the first target data can be understood as the key (key) to be used to write the first target data to the database system.

[0088] After loading into the leaf node, the first target data is inserted into the leaf node. Then, the node status of the ancestor node of the leaf node is updated. It is determined whether the leaf node needs to be split. If the leaf node needs to be split, the leaf node is split, and the node data information of the parent node is updated according to the node status of the leaf node. If the leaf node does not need to be split, the node data information of the parent node is directly updated according to the node status of the leaf node.

[0089] After each update of the node data information of a parent node (ancestor node), determine whether the parent node is a root node. If it is a root node, encrypt each changed node data information using the target tenant key and store the encrypted node data information persistently in the database storage layer. If it is not a root node, continue to update the node status of the next ancestor node until the root node is updated.

[0090] It is worth noting that each node of the index tree usually has a predefined maximum capacity. When new data is inserted into the index tree, if the capacity of the leaf node is not yet full, the new data can be inserted directly into the node. If the leaf node has reached its maximum capacity and attempts to insert more data, the node can be split. In order to accommodate the newly inserted data, the leaf node can be split into two nodes. In general, the split operation divides the node's data into two parts and promotes the middle key (or other appropriate key) to the parent node as the separator key of the newly split node.

[0091] Therefore, through the above implementation, when reading data in the database system, the target tenant key can be used to decrypt the data when querying, and the tenant's data can be encrypted when writing and decrypted when querying, thereby achieving isolation between multiple tenants.

[0092] In some embodiments, the data addition and deletion operation is a data deletion operation for instructing to delete the second target data in the leaf node. Accordingly, the data deletion operation can be performed by the database computing layer to delete the second target data stored in the leaf node.

[0093] The data deletion operation is used to indicate the deletion of the second target data in the database system. After the leaf node targeted by the data deletion operation is determined through the above implementation, the second target data is deleted from the leaf node (it may be the key-value pair corresponding to the second target data). And, according to the node state of the leaf node after the second target data is deleted, the node data information corresponding to the ancestor node of the leaf node is updated.

[0094] Then, for each node in the index tree where data is updated, the node data information corresponding to the node is encrypted using the target tenant key, and the encrypted node data information is stored in the database storage layer.

[0095] For example, after the leaf node deletes the second target data, the leaf node reduces the second target data, which is the node where data change occurs. Similarly, the node data information corresponding to the ancestor node of the leaf node will also be updated, and the ancestor node of the leaf node is also the node where data change occurs.

[0096] For each node in the index tree where data has changed, the database computing layer encrypts the changed node data information and stores it in the database storage layer through the target tenant key to achieve encrypted storage of data.

[0097] Figure 6 FIG. 4 is a schematic diagram showing deleting the second target data according to some embodiments. Figure 6 As shown, the database computing layer loads the table metadata, and loads the index tree corresponding to the second target data according to the table metadata. Then, the encrypted node data information of the root node is loaded in the database storage layer through the node identifier of the root node in the index tree, and the encrypted node data information of the root node is decrypted through the target tenant key.

[0098] Next, the encrypted node data information of the next node is loaded on demand through the target key of the second target data and the node data information after decryption of the root node, and the node data information of the next node is decrypted through the target tenant key. By judging whether the next node loaded is a leaf node, it is determined whether to load into the leaf node of the index tree. If the next node is not a leaf node, continue to load the nodes of the next layer until the leaf node. It should be noted that the target key corresponding to the second target data refers to the key used to store the second target data in the database storage layer in the form of a key-value pair.

[0099] After loading into the leaf node, the second target data is deleted from the leaf node. Then, the node data information of the ancestor node of the leaf node is updated. It is determined whether the leaf nodes need to be merged. If the leaf nodes need to be merged, the leaf nodes are merged, and the node data information of the parent node is updated according to the node status of the leaf nodes. If the leaf nodes do not need to be merged, the node data information of the parent node is directly updated according to the node status of the leaf nodes.

[0100] After each update of the node data information of a parent node (a node in the ancestor node), determine whether the parent node is the root node. If it is a root node, encrypt each changed node data information using the target tenant key and store the encrypted node data information persistently in the database storage layer. If it is not a root node, continue to update the node data information of the next ancestor node until the root node is updated.

[0101] It is worth noting that during the operation process where data deletion causes the amount of node data to decrease, when the number of records in a leaf node drops below a certain threshold, a merge operation can be performed to maintain the structure and performance of the index tree. The nodes of an index tree usually have a minimum capacity. When data is deleted from the index tree, especially when continuous deletion causes a significant reduction in the number of records in a node, a leaf node merge may be triggered. If the number of records in a leaf node is lower than the minimum capacity, the node can be merged with other nodes to ensure the balance and performance of the index tree. Among them, a node merge operation can be to merge the records of two nodes into one node, and it may be necessary to delete or update the corresponding separator key in the parent node.

[0102] Therefore, through the above implementation, when data is deleted in the database system, the target tenant key can be used to decrypt the data, so that the tenant data can be encrypted when writing and decrypted when querying, thereby achieving isolation between multiple tenants.

[0103] In some achievable implementations, the target data operation includes a data read operation for indicating reading the target data. Accordingly, in step 130, the database computing layer can respond to the data read operation, query the leaf node for the target value corresponding to the target data based on the target key corresponding to the target data, read the encrypted target data corresponding to the target value in the distributed key-value storage layer according to the target value, decrypt the encrypted target data according to the target tenant key, obtain the decrypted target data, and return the decrypted target data to the user end that sent the target data processing request.

[0104] Here, the data read operation is used to indicate reading target data in the database system. In the embodiment of the present disclosure, the database storage layer is a distributed key-value storage layer. That is, the tenant's data is stored in the distributed key-value storage layer in the form of key-value pairs.

[0105] In the following description, the target data to be read is indicated as the third target data for detailed description. After the leaf node for the data reading operation is determined through the above implementation, the target value (value) of the third target data is queried in the leaf node through the target key corresponding to the third target data, and the decrypted third target data corresponding to the value (value) of the third target data is returned to the user end that sent the target data processing request.

[0106] It is worth noting that the third target data is encrypted and stored in the distributed key-value storage layer by the target tenant key. After determining the leaf node where the third target data is located, the target value (value) corresponding to the third target data can be queried in the node data information corresponding to the leaf node through the target key corresponding to the third target data, thereby reading the encrypted third target data in the distributed key-value storage layer through the value (value) corresponding to the third target data, and then decrypting the encrypted third target data through the target tenant key, and returning the decrypted third target data to the user end, thereby finally realizing the reading of the third target data.

[0107] Figure 7 FIG. 4 is a schematic diagram showing how to read third target data according to some embodiments. Figure 7 As shown, the database computing layer loads the table metadata, and loads the index tree corresponding to the third target data according to the table metadata. Then, the encrypted node data information of the root node is loaded in the distributed key-value storage layer through the node identifier of the root node in the index tree, and the encrypted node data information of the root node is decrypted through the target tenant key.

[0108] Next, the encrypted node data information of the next node is loaded on demand through the target key of the third target data and the node data information decrypted by the root node, and the encrypted node data information of the next node is decrypted through the target tenant key. By judging whether the next node loaded is a leaf node, it is determined whether to load to the leaf node of the index tree. If the next node is not a leaf node, continue to load the nodes of the next layer until the leaf node. It should be noted that the target key corresponding to the third target data is the key used by the third target data to be stored in the storage layer through a key-value pair.

[0109] After loading into the leaf node, the target value of the third target data is read from the leaf node, and the corresponding encrypted third target data is read from the distributed key-value storage layer according to the target value, and then the encrypted third target data is decrypted by the target tenant key to obtain the decrypted third target data. The decrypted third target data is returned to the user end.

[0110] It is worth noting that, in the process of querying the third target data, the leaf nodes in the index tree are not updated, so the node status of the ancestor nodes of the leaf nodes will not be updated.

[0111] Therefore, through the above implementation, when reading data in the database system, the tenant key can be used to decrypt when querying, and the tenant data can be encrypted when writing and decrypted when querying, thereby achieving isolation between multiple tenants.

[0112] In some feasible implementations, in step 120, the tenant signature of the target tenant is obtained from the target data processing request, and the tenant signature is verified through a signature verification algorithm. When the tenant signature verification passes, the target data processing request is responded to through the database computing layer to obtain the target tenant key corresponding to the target tenant.

[0113] Here, tenant signature refers to a piece of verification information attached when a tenant performs an operation or request in a multi-tenant architecture. Through the tenant signature, the database computing layer can verify whether the target data operation sent by the user end has been tampered with during the transmission process.

[0114] The target data processing request may carry the tenant signature of the target tenant that initiated the target data processing request. After receiving the target data processing request, the database computing layer verifies the tenant signature in the target data processing request. If it is determined that the tenant signature verification is passed, the above step 120 is executed again to perform the target data operation. If it is determined that the tenant signature verification is not passed, the signature verification failure information is returned to the user end. Among them, the signature verification failure information can be used to inform the user that the target data operation initiated by the user has failed, and inform the specific reason for the failure.

[0115] Exemplarily, the tenant signature can be verified by a signature verification algorithm. It should be understood that the signature verification algorithm can be an ECDH signature verification algorithm, which is a method of using the Elliptic Curve Diffie-Hellman (ECDH) key exchange protocol combined with a digital signature to achieve secure communication. ECDH is a key exchange protocol, and a digital signature is used to verify the integrity and source of a message.

[0116] It is worth noting that, in the database system, each tenant may have its corresponding tenant signature. When a user initiates a target data processing request, the corresponding tenant signature is carried in the target data processing request.

[0117] like Figure 2 As shown in the figure, the database administrator (DBA) is a system tenant in the database system. In the process of managing the database system, the system tenant initiates relevant target data processing requests through its corresponding tenant signature. Because the tenant signature of the tenant needs to be verified before executing the target data operation on the database system, each user can only access the data to which he has permission, so that the tenant data is invisible to the database system administrator.

[0118] That is to say, the tenant's data is encrypted and stored in the database storage layer of the database system with the tenant's key. When the database system administrator accesses the tenant's data, the database system administrator's tenant signature will result in him not having the authority to access the tenant's data, thereby making the tenant's data invisible to the database system administrator, which greatly guarantees the privacy of the tenant's data. For the database system administrator, the tenant signature he uses only allows him to perform operations authorized by the database system administrator's tenant signature, but he cannot access the tenant's data.

[0119] Figure 8 FIG. 1 is a schematic diagram of signature verification according to some embodiments. Figure 8 As shown, the tenant signature can be verified by the following steps.

[0120] S801, the user terminal initializes the interface; wherein the interface may be a SDK (Software Development Kit) interface provided by the database system.

[0121] S802, the interface requests the database computing layer to establish a connection; S803, the database computing layer performs authentication and establishes a connection after the authentication is passed; S804, the database computing layer successfully establishes a connection with the interface; S805, the interface notifies the user end to complete the initialization interface; S806, the user terminal sends a target data processing request to the database computing layer through the interface; S807, the database computing layer verifies the tenant signature carried in the target data processing request; S808, when the tenant signature verification fails, the database computing layer returns the signature verification failure information to the user end through the interface; S809, when the signature verification is passed, the database computing layer executes the target data operation indicated by the target data processing request; S810, when the target data operation is executed, the database computing layer returns the result corresponding to the target data operation to the user end through the interface.

[0122] Therefore, through the above implementation, isolation between tenants can be achieved through tenant signatures, so that tenant data is invisible to database system administrators, thereby ensuring the privacy of tenant data.

[0123] Fig. 9 FIG. 1 is a schematic diagram showing a structure of a data processing device based on a database according to some embodiments. Fig. 9As shown, the embodiment of the present disclosure provides a data processing device 900 based on a database, and the data processing device 900 based on a database may include: The receiving module 901 is configured to receive a target data processing request sent by a target tenant of a database service, wherein the target data processing request is used to request the database to perform a target data operation on the target data, and the database adopts a computing / storage separation architecture to support data processing for serving multiple tenants; The determination module 902 is configured to respond to the target data processing request through the database computing layer, obtain the target tenant key corresponding to the target tenant, decrypt the encrypted node data information of the index tree corresponding to the target data processing request according to the target tenant key, obtain the decrypted node data information, and determine the leaf node targeted by the target data operation in the index tree based on the decrypted node data information and the target data, wherein the database computing layer is used to adopt the one-tenant-one-key principle, encrypt the tenant's data and the node data information corresponding to the index tree by the tenant key when writing and decrypt when querying, and store the encrypted tenant's encrypted data and the encrypted node data information of the index tree in the database storage layer of the database; The execution module 903 is configured to execute the target data operation based on the leaf node.

[0124] Optionally, the determining module 902 is specifically configured to: Starting from the root node of the index tree, the nodes of the index tree are traversed in sequence. When traversing a node, the encrypted node data information corresponding to the node is read from the database storage layer according to the node identifier, and the encrypted node data information is decrypted using the target tenant key to obtain the node data information. The next node is determined according to the node data information and the target key corresponding to the target data, until the leaf node targeted by the target data operation is traversed.

[0125] Optionally, the index tree uses a node identifier to represent each node in the index tree, and the node identifier is obtained by sorting digital symbols without business semantics.

[0126] Optionally, the target data operation includes an instruction to perform a data addition and deletion operation on the leaf node based on the target data; the execution module 903 is specifically configured to: Execute the data adding and deleting operations through the database computing layer, and add and delete data on the leaf nodes based on the target data; According to the node state of the leaf node after the data addition and deletion operation, updating the node data information corresponding to the ancestor node of the leaf node; For each node in the index tree where data changes occur, the database computing layer encrypts the node data information corresponding to the node according to the target tenant key, and stores the encrypted node data information in the database storage layer.

[0127] Optionally, the target data operation includes a data reading operation for indicating reading target data, and the database storage layer is a distributed key-value storage layer; the execution module 903 is specifically configured as follows: In response to the data reading operation through the database computing layer, based on the target key corresponding to the target data, querying in the leaf node to obtain the target value corresponding to the target data; According to the target value, reading the encrypted target data corresponding to the target value in the distributed key-value storage layer; The encrypted target data is decrypted according to the target tenant key to obtain the decrypted target data, and the decrypted target data is returned to the user end that sent the target data processing request.

[0128] Optionally, the determining module 902 is specifically configured to: Obtaining a tenant signature of the target tenant from the target data processing request, and verifying the tenant signature through a signature verification algorithm; When the tenant signature verification is passed, the target data processing request is responded to through the database computing layer to obtain the target tenant key corresponding to the target tenant.

[0129] The logic of the method executed by each functional module in the above-mentioned database-based data processing device 900 can refer to the part of the method related to the above-mentioned embodiment, and will not be repeated here.

[0130] Reference below Fig.10 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 1000 suitable for implementing the embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig.10 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 disclosure.

[0131] like Fig.10As shown, the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 to a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the electronic device 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0132] Typically, the following devices may be connected to the I / O interface 1005: an input device 1006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 1008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 may allow the electronic device 1000 to communicate with other devices wirelessly or by wire to exchange data. Although Fig.10 The electronic device 1000 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0133] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 1009, or installed from a storage device 1008, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0134] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0135] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0136] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0137] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: receives a target data processing request sent by a target tenant of a database service, wherein the target data processing request is used to request the database to perform a target data operation on the target data, and the database adopts a computing / storage separation architecture to support data processing for multiple tenants; responds to the target data processing request through a database computing layer, obtains a target tenant key corresponding to the target tenant, decrypts the encrypted node data information of the index tree corresponding to the target data processing request according to the target tenant key, obtains the decrypted node data information, and determines the leaf node targeted by the target data operation in the index tree based on the decrypted node data information and the target data, wherein the database computing layer is used to adopt the principle of one tenant and one key, encrypts the tenant's data and the node data information corresponding to the index tree when writing and decrypts it when querying through the tenant key, and stores the encrypted tenant's encrypted data and the encrypted node data information of the index tree in the database storage layer of the database; and performs the target data operation based on the leaf node.

[0138] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0139] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0140] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a module does not, in some cases, limit the module itself.

[0141] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0142] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0143] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0144] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0145] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. A data processing method based on a database, characterized in that: include: Receiving a target data processing request sent by a target tenant of a database service, wherein the target data processing request is used to request the database to perform a target data operation on the target data, and the database adopts a computing / storage separation architecture to support data processing for serving multiple tenants; Respond to the target data processing request through the database computing layer, obtain the target tenant key corresponding to the target tenant, decrypt the encrypted node data information of the index tree corresponding to the target data processing request according to the target tenant key, obtain the decrypted node data information, and determine the leaf node targeted by the target data operation in the index tree based on the decrypted node data information and the target data, wherein the database computing layer is used to adopt the one-tenant-one-key principle, encrypt the tenant's data and the node data information corresponding to the index tree when writing and decrypt when querying through the tenant key, and store the encrypted tenant's encrypted data and the encrypted node data information of the index tree in the database storage layer of the database; Based on the leaf node, the target data operation is performed.

2. The method according to claim 1, characterized in that The step of decrypting the encrypted node data information of the index tree corresponding to the target data processing request according to the target tenant key to obtain the decrypted node data information, and determining the leaf node targeted by the target data operation in the index tree based on the decrypted node data information and the target data, includes: Starting from the root node of the index tree, the nodes of the index tree are traversed in sequence. When traversing a node, the encrypted node data information corresponding to the node is read from the database storage layer according to the node identifier, and the encrypted node data information is decrypted using the target tenant key to obtain the node data information. The next node is determined according to the node data information and the target key corresponding to the target data, until the leaf node targeted by the target data operation is traversed.

3. The method according to claim 1, characterized in that The index tree uses node identifiers to represent each node in the index tree, and the node identifiers are obtained by sorting digital symbols without business semantics.

4. The method according to any one of claims 1 to 3, characterized in that The target data operation includes an instruction to perform a data addition and deletion operation on the leaf node based on the target data; The performing the target data operation based on the leaf node includes: Execute the data adding and deleting operations through the database computing layer, and add and delete data on the leaf nodes based on the target data; According to the node state of the leaf node after the data addition and deletion operation, updating the node data information corresponding to the ancestor node of the leaf node; For each node in the index tree where data changes occur, the database computing layer encrypts the node data information corresponding to the node according to the target tenant key, and stores the encrypted node data information in the database storage layer.

5. The method according to any one of claims 1 to 3, characterized in that The target data operation includes a data reading operation for indicating reading target data, and the database storage layer is a distributed key-value storage layer; The performing the target data operation based on the leaf node includes: In response to the data reading operation through the database computing layer, based on the target key corresponding to the target data, querying in the leaf node to obtain the target value corresponding to the target data; According to the target value, reading the encrypted target data corresponding to the target value in the distributed key-value storage layer; The encrypted target data is decrypted according to the target tenant key to obtain the decrypted target data, and the decrypted target data is returned to the user end that sent the target data processing request.

6. The method according to any one of claims 1 to 3, characterized in that The step of responding to the target data processing request through the database computing layer to obtain a target tenant key corresponding to the target tenant includes: Obtaining a tenant signature of the target tenant from the target data processing request, and verifying the tenant signature through a signature verification algorithm; When the tenant signature verification is passed, the target data processing request is responded to through the database computing layer to obtain the target tenant key corresponding to the target tenant.

7. A data processing device based on a database, characterized in that: include: a receiving module configured to receive a target data processing request sent by a target tenant of a database service, wherein the target data processing request is used to request the database to perform a target data operation on the target data, and the database adopts a computing / storage separation architecture to support data processing for serving multiple tenants; A determination module is configured to respond to the target data processing request through a database computing layer, obtain a target tenant key corresponding to the target tenant, decrypt the encrypted node data information of the index tree corresponding to the target data processing request according to the target tenant key, obtain the decrypted node data information, and determine the leaf node targeted by the target data operation in the index tree based on the decrypted node data information and the target data, wherein the database computing layer is used to adopt a one-tenant-one-key principle, encrypt the tenant's data and the node data information corresponding to the index tree when writing and decrypt when querying through the tenant key, and store the encrypted tenant's encrypted data and the encrypted node data information of the index tree in the database storage layer of the database; An execution module is configured to execute the target data operation based on the leaf node.

8. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 6 are implemented.

9. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.