Data management method, device and system
By establishing a correspondence between ciphertext index values and storage locations in the cloud database, the problem of ciphertext data storage expansion is solved, efficient query of sequential operations is achieved, and the storage scalability and query efficiency of cloud devices are improved.
Patent Information
- Application Number
- CN202110098939.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-25
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2041-01-25
AI Technical Summary
In traditional databases, user data encryption schemes lead to the expansion of ciphertext data storage, reducing the scalability of the database. Especially in cloud database scenarios, the sequential operation of user data cannot be effectively guaranteed.
By establishing a correspondence between the ciphertext index value and the storage location of the ciphertext data in the cloud device, using order-preserving encryption or order-revealing encryption, sequential operations on the ciphertext data can be achieved, avoiding the increase of data table fields and the number of interactions, and using the ciphertext index value instead of the key value in the data column for search.
It reduces the table expansion of encrypted data storage, improves the storage scalability of cloud devices, and maintains the efficiency of regular queries and indexing functions.
Smart Images

Figure CN114792009B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of database technology, and in particular to a method, device, and system for data management. Background Art
[0002] Traditional databases can ensure security through the use of permissions, but relying on permissions to manage databases can expose internal administrators to data tampering. Furthermore, due to the open environment and blurred network boundaries, user data is more exposed to attackers throughout the entire business process, making it vulnerable to attacks during transmission, storage, maintenance, and operation.
[0003] For cloud database scenarios, a fully encrypted database solution is proposed to ensure user data security. This solution encrypts user data on the client side using a user key, and then stores the encrypted data in the database. Because only the client has the user key, the security of the encrypted data stored in the database is guaranteed.
[0004] Currently, user data encryption schemes typically use symmetric encryption, which cannot guarantee sequential operations based on sequentially encrypted data. When a client needs to store data with order-preserving requirements in the database, the database will add a new data column for the data with order-preserving requirements. This will cause the data columns used to store the data with order-preserving requirements to expand, reducing the scalability of the database. Summary of the Invention
[0005] The present invention provides a data management method, device, and system for reducing the space occupied by the expansion of tables used to store encrypted data, thereby improving the scalability of data storage in cloud devices. The present invention also provides corresponding devices, systems, computer-readable storage media, and computer program products.
[0006] The first aspect of the present application provides a method for data management, including: obtaining a first statement, the first statement including plaintext data; determining a ciphertext index value based on information of the plaintext data; sending a second statement to a cloud device, the second statement including a ciphertext index value, the ciphertext index value being used by the cloud device to establish a correspondence between the ciphertext index value and information on the storage location of the ciphertext data in an index structure, or querying information on the storage location of the ciphertext data from the index structure, the ciphertext data being encrypted data of the plaintext data, and the storage location information indicating the storage location of the ciphertext data corresponding to the plaintext data.
[0007] In a possible implementation, the first statement is a first statement based on a sequential operation.
[0008] The solution provided in the first aspect above can be applied to the end-to-cloud scenario of the database, and can also be applied to the end-to-cloud scenario of non-database. The end side can be a client, which can be hardware (such as a terminal device) or software (such as an application (APP)), and the cloud side can be a cloud device, which can be a physical machine or a virtual machine (VM) or a container. The plaintext data on the end side can be encrypted by the user key to obtain ciphertext data, and then the ciphertext data is sent to the cloud side for storage. Insertion (insert), update (update), query (select / query) and deletion (delete) operations can be performed on the ciphertext data between the end and the cloud. A lot of plaintext data on the end side is data based on sequential records, such as employee information lists, student information lists and other data, which are all based on sequential records. These data based on sequential records also need to be arranged in sequence after being encrypted by the user key. These data can also be called data with sequential requirements. The encryption method for these data with order requirements can be order-preserving encryption (OPE), order-revealing encryption (ORE), or other order-based encryption methods. In this application, statements that operate on these order-related data can be referred to as statements based on sequence operations. Input conditions based on sequence operations can include comparison operators, range queries, sorting (ORDER BY), minimum value (MIN), maximum value (MAX), and sorting (SORT).
[0009] In the first aspect described above, both the first statement and the second statement may be Structured Query Language (SQL) statements. The first statement is typically generated based on user input, such as a statement generated based on a query condition input by the user, or a statement generated based on an insert instruction, update instruction, or delete instruction input by the user. The operation indicated by the second statement is the same as the operation indicated by the first statement.
[0010] In this application, plaintext data can also be described as "plaintext of data", and ciphertext data can also be described as "ciphertext of data". The ciphertext index value refers to an index value that has a pointing relationship with the ciphertext data. The index structure is a structure established by the cloud device to store the correspondence between the ciphertext index value and the storage location information of the ciphertext data. The index structure can be a tree structure or other types of structures. The information of the storage location of the ciphertext data may include the address of the storage location or the identifier of the ciphertext data in the stored list. If the operation indicated by the second statement is an insert operation, the cloud device will establish a correspondence between the ciphertext index value and the storage location information of the ciphertext data in the index structure. If the operation indicated by the second statement is a query operation, an update operation or a delete operation, the cloud device will query the storage location information of the ciphertext data from the index structure, and then can query the ciphertext data based on the storage location information.
[0011] In this first aspect, the client can generate a ciphertext index value for plaintext data based on sequential operations, and the cloud device can then store the ciphertext index value in an index structure, establishing a correspondence between the ciphertext index value and the storage location information of the ciphertext data. When the ciphertext data corresponding to the ciphertext index value needs to be queried, the corresponding ciphertext data can be retrieved based on the correspondence in the index structure, and the corresponding operation on the ciphertext data can be performed. It can be seen that in this application, the ciphertext index value replaces the field in the data column as the key value in the conventional ordered index to realize the search of ciphertext data. Without adding data table fields, the ciphertext data stored in the table can be queried based on the sequence, thereby reducing the space occupied by the expansion of the table used to store ciphertext data and improving the scalability of data storage in the cloud device. In other words, the solution of this application realizes the function based on sequential operations without changing the interaction mode, increasing the number of additional interactions, maintaining the efficiency of conventional queries, and without adding data table fields, changing the conventional index function, or adding additional SQL statements to change the query mode.
[0012] In a possible implementation manner of the first aspect, the information of the plaintext data includes a value of the plaintext data, a type of the plaintext data, and a value range of the plaintext data.
[0013] In this possible implementation, the types of plaintext data may include integer (int), floating point (float), string (string), and character (char). In addition, integer can be further divided into int1, int2, int4, and int8, floating point can be further divided into floating point types of different granularities, string can be further divided into long string and short string, and character can be further divided into readable character and full character, etc. The value range of plaintext data is related to the type of plaintext data. For example, if the type of plaintext data is int4, the value range of the plaintext data can be [-2 31 ,2 31 In this possible implementation, the ciphertext index value determined by the value of the plaintext data, the type of the plaintext data, and the value range of the plaintext data improves the efficiency of obtaining the ciphertext index value while ensuring the security of the ciphertext.
[0014] In a possible implementation of the first aspect, the above-mentioned steps of: determining the ciphertext index value based on the information of the plaintext data, include: normalizing the value of the plaintext data, the type of the plaintext data, and the value range of the plaintext data to obtain the plaintext value, the plaintext space, and the ciphertext space; and determining the ciphertext index value based on the plaintext value, the plaintext space, and the ciphertext space.
[0015] In this possible implementation, the normalization process may be to determine the normalization parameters of the plaintext data based on the type of plaintext data and the value range of the plaintext data; based on the normalization parameters, the value of the plaintext data is normalized to obtain a plaintext value, a plaintext space, and a ciphertext space. The plaintext value is a normalized plaintext value, and the plaintext space is also a normalized plaintext space. The normalization process may be to use different processing methods for different types, such as: using a normalization processing method of translation or shifting for integers, using a normalization processing method such as truncation and compression for character strings, and using a normalization processing method such as truncation and translation for floating-point types. In the present application, the ciphertext space is obtained by amplifying the plaintext space according to the expansion coefficient. In the present application, normalization parameters are added and different normalization processing methods are used for different types of plaintext data, so that the ciphertext index value generation algorithm of the present application is adaptable to all data types without input range restrictions.
[0016] In a possible implementation of the first aspect, the step of determining the ciphertext index value based on the plaintext value, the plaintext space, and the ciphertext space includes: sampling in a sampling interval of the ciphertext space to obtain sampling points, where the sampling interval corresponds to the midpoint of the plaintext space; reducing the plaintext space and the ciphertext space based on the midpoint and the plaintext value to obtain a reduced plaintext space and a reduced ciphertext space, where the reduced plaintext space has the midpoint as a boundary and contains the plaintext value, and the reduced ciphertext space has the sampling point as a boundary; and repeatedly performing the steps of sampling and reducing the plaintext space and the ciphertext space until the upper boundary and the lower boundary of the reduced plaintext space coincide, where the sampling point of the reduced ciphertext space corresponding to the coincidence of the upper boundary and the lower boundary is the ciphertext index value.
[0017] In this possible implementation, the plaintext space is a numerical range, including upper and lower bounds. For example, the plaintext space is represented as [a1, a2]. The ciphertext space is obtained by scaling the plaintext space by an expansion factor. The scaling factor can be 1.3, 1.5, or other multiples. Of course, the ciphertext space can also be the same size as the plaintext space. For example, the ciphertext space can be represented as [b1, b2]. The plaintext space and ciphertext space correspond to each other. The midpoint of the plaintext space is the midpoint (mid) determined by the upper and lower bounds of the plaintext space. That is, half the sum of the upper and lower bounds of the plaintext space is the midpoint of the plaintext space. For example, the midpoint of [a1, a2] is (a1 + a2) / 2. Because the ciphertext space is larger than the plaintext space, the midpoint of the plaintext space corresponds to an interval in the ciphertext space. The client can perform deterministic sampling within this sampling interval, which can also be understood as pseudo-random sampling, that is, sampling according to the user key and obtaining a sampling point (y) within this sampling interval. Based on the size relationship between the midpoint (mid) and the plaintext value (m), the reduced plaintext space and the reduced ciphertext space can include cases where the plaintext value is greater than the midpoint, or cases where the plaintext value is less than the midpoint. If m>mid, the reduced plaintext space is from the next number after the midpoint to the lower boundary of the original plaintext space, which can be expressed as [mid+1,a2], and the reduced ciphertext space is from the next number after the sampling point to the lower boundary of the ciphertext space, which can be expressed as [y+1,b2]. If m≤mid, the reduced plaintext space is from the upper boundary of the plaintext space to the midpoint, which can be expressed as [a1,mid], and the reduced ciphertext space is from the upper boundary of the ciphertext space to the sampling point, which can be expressed as [b1,y]. After multiple recursions, the upper and lower bounds of the reduced plaintext space are equal, and will be equal to the plaintext value and the midpoint, which can be expressed as a1 = a2 = mid = m. At this time, the sampling point of the ciphertext space corresponding to the reduced plaintext space is the ciphertext index value. In this application, the ciphertext index value is obtained by recursion, which can reduce the probability of ciphertext index value leakage and improve the security of the ciphertext index value.
[0018] In a possible implementation of the first aspect, the above-mentioned step of: sampling in a sampling interval of the ciphertext space to obtain a sampling point includes: performing a modulo calculation on the size of the sampling interval through an unpredictable pseudo-random number to obtain a modulo value; and determining a corresponding sampling point from the sampling interval according to the modulo value.
[0019] In this possible implementation, during the sampling process, sampling is performed by taking a modulus value, which can improve the sampling efficiency and thus improve the calculation efficiency of the ciphertext index value.
[0020] In a possible implementation of the first aspect, when the upper boundary and the lower boundary coincide with each other, sampling of the reduced ciphertext space is non-deterministic sampling.
[0021] In this possible implementation, the last sampling of the ciphertext space uses non-deterministic sampling to determine the ciphertext index value, which can resist inference attacks.
[0022] In a possible implementation of the first aspect, the first statement indicates an insert operation or an update operation, and the method also includes: performing symmetric encryption processing on the plaintext data to obtain ciphertext data of the plaintext data; the second statement also includes or indicates the ciphertext data, and the ciphertext data is stored in a corresponding storage location by the cloud device.
[0023] In this possible implementation, when the first statement indicates to perform an insert operation or an update operation, the client will also send the ciphertext data corresponding to the plaintext data to the cloud device for storage. The second statement can directly include the ciphertext data, or it can include a link to the storage location of the ciphertext data, and the storage location of the ciphertext data is indicated by the link.
[0024] In a possible implementation of the first aspect, when the first statement is used to perform a query operation, the method further includes: scrambling the second statement; receiving a query result returned by the cloud device, and descrambling the query result.
[0025] In this possible implementation, scrambling the second statement before sending it can reduce the chance of query leakage. If the client scrambles the query, after the cloud device returns the query result, the client decrypts the symmetric ciphertext. The decrypted query result may contain some false positives but no false negatives. The decrypted result is then filtered and verified before outputting the final result.
[0026] In a possible implementation of the first aspect, after the above-mentioned step obtains the first statement, the method further includes: sending a create index statement to the cloud device, the create index statement indicating a specified column of a specified table of the first statement; receiving existing data on the specified column returned by the cloud device; determining the ciphertext index value of the existing data; and sending the ciphertext index value of the existing data to the cloud device.
[0027] In this possible implementation, for the existing data in the cloud device, the above method can be used to sample the ciphertext index value of the existing data, and the ciphertext index value can be inserted into the index structure, so that the existing data can adapt to the data management process of this application.
[0028] A second aspect of the present application provides a method for data management, comprising: receiving a second statement from a client, the second statement comprising a ciphertext index value determined by the client in response to the first statement based on information of plaintext data, the first statement comprising plaintext data; in response to the second statement, establishing a correspondence between the ciphertext index value and information on the storage location of the ciphertext data in an index structure based on the ciphertext index value, or querying information on the storage location of the ciphertext data from the index structure, the ciphertext data being encrypted data corresponding to the plaintext data, and the storage location information indicating the storage location of the ciphertext data.
[0029] The solution provided in the second aspect is applied to a cloud device corresponding to the client in the first aspect, which can be a physical machine, a virtual machine, or a container. The features of the second aspect that are the same as those in the first aspect can be understood by referring to the introduction to the first aspect.
[0030] In this second aspect, the cloud device can store the ciphertext index value determined by the client in an index structure, establish a correspondence between the ciphertext index value and the storage location information of the ciphertext data, and when it is necessary to query the ciphertext data corresponding to the ciphertext index value, the corresponding ciphertext data can be queried according to the correspondence in the index structure, and then the corresponding operation on the ciphertext data can be performed. As can be seen from this, in this application, the ciphertext index value is used instead of the field in the data column as the key value in the conventional ordered index to realize the search of ciphertext data. Without adding data table fields, the ciphertext data stored in the table can be queried based on the sequence, thereby reducing the space occupied by the expansion of the table used to store ciphertext data and improving the scalability of data storage in the cloud device. In other words, the solution of this application realizes the function based on sequence operation without changing the interaction mode, increasing the number of additional interactions, maintaining the efficiency of conventional queries, and without adding data table fields, changing the conventional index function, or adding additional SQL statements to change the query mode.
[0031] In a possible implementation of the second aspect, the second statement indicates an insert operation. Before establishing the corresponding relationship, the method also includes: determining the ciphertext data corresponding to the plaintext data based on the second statement; storing the ciphertext data in a corresponding storage location, which is the location indicated by the storage position information in the corresponding relationship.
[0032] In this possible implementation, when the second statement sent by the client indicates an insert operation, the cloud device will first store the ciphertext data in the corresponding storage location, which can be one or more rows in a column of a table used to store ciphertext data. The cloud device then establishes a correspondence between the ciphertext index value and the storage location information of the ciphertext data in the index structure. In this way, when the ciphertext data is to be queried subsequently, the ciphertext data can be queried from the table used to store the ciphertext data through the correspondence in the index structure. In this way, while maintaining the conventional query method, fast search of the ciphertext data can be achieved.
[0033] In a possible implementation of the second aspect, the second statement indicates a query operation. After querying the storage location information of the ciphertext data from the index structure, the method further includes: querying the ciphertext data based on the storage location information; and returning the ciphertext data to the client.
[0034] In this possible implementation, when the second statement sent by the client indicates a query operation, the cloud device searches the index structure based on the ciphertext index value in the second statement. Using the established correspondence between the ciphertext index value and the storage location information in the index structure, the cloud device searches for the storage location information of the ciphertext data. Based on the storage location information, the cloud device then searches the table for the ciphertext data and returns the ciphertext data to the client. In this way, while maintaining a conventional query method, rapid search of ciphertext data can be achieved.
[0035] In a possible implementation of the second aspect, the second statement indicates updating the index value, and the second statement also includes the original ciphertext index value of the plaintext data. The method also includes: querying the correspondence between the original ciphertext index and the information of the storage location based on the original ciphertext index value; and updating the correspondence between the original ciphertext index value in the index structure and the information of the storage location based on the ciphertext index value.
[0036] In this possible implementation, if the second statement indicates to update the ciphertext index value, the old ciphertext index value and the new ciphertext index value of the plaintext data will be included in the second statement. The cloud device searches the index structure for the established correspondence between the old ciphertext index value and the storage location information of the ciphertext data based on the old ciphertext index value, and then replaces the old ciphertext index value in the correspondence with the new ciphertext index value. In this way, the flexibility of managing the correspondence between the ciphertext index value and the storage location information of the ciphertext data is enhanced.
[0037] In a possible implementation of the second aspect, the second statement indicates updating the ciphertext data, and the second statement also includes or indicates the ciphertext data of the plaintext data, and the ciphertext index value of the plaintext data before the update. The method also includes: querying the correspondence between the ciphertext index value of the plaintext data before the update and the information of the storage location based on the ciphertext index value of the plaintext data before the update; updating the correspondence between the ciphertext index value of the plaintext data before the update and the information of the storage location based on the ciphertext index value of the plaintext data; and updating the ciphertext data of the storage location based on the ciphertext data of the plaintext data.
[0038] In this possible implementation, if the user updates the plaintext data, the corresponding ciphertext index value and new ciphertext data will be regenerated based on the updated plaintext data. The client can send the new ciphertext data, the new ciphertext index value, and the ciphertext index value before the update to the cloud device. In this way, the cloud device can search for the corresponding relationship in the index structure based on the ciphertext index value before the update, replace the ciphertext index value before the update in the corresponding relationship with the new ciphertext index value, and then update the old ciphertext data with the new ciphertext data in the corresponding storage location based on the storage location information in the corresponding relationship. The update solution provided in this possible implementation can achieve flexible management of ciphertext data and ciphertext index values in the cloud device.
[0039] In a possible implementation manner of the second aspect, the second statement indicates deleting the index value, and the method further includes: deleting the ciphertext index value from the correspondence between the ciphertext index value of the index structure and the information of the storage location.
[0040] In this possible implementation, if the user wants to delete the ciphertext index value of a certain plaintext data, the client will send a second statement to the cloud device instructing to delete the ciphertext index value. The cloud device will find the corresponding correspondence in the index structure based on the ciphertext index value in the second statement, and then delete the ciphertext index value in the correspondence, or delete the correspondence.
[0041] In a possible implementation of the second aspect, the second statement indicates deletion of ciphertext data, and the method further includes: deleting the ciphertext data at the storage location based on the information of the storage location, and deleting the correspondence between the ciphertext index value and the information of the storage location of the ciphertext data from the index structure.
[0042] In this possible implementation method, if the user wants to delete the ciphertext data of a certain plaintext data, the client will send a second statement to the cloud device to instruct the deletion of the ciphertext data. The cloud device will find the corresponding correspondence in the index structure based on the ciphertext index value in the second statement, and then delete the ciphertext data at the corresponding location according to the storage location information in the correspondence, and delete the correspondence from the index structure.
[0043] In a possible implementation of the second aspect, the method further includes: receiving a create index statement; querying a specified column of a specified table of a second statement based on the create index statement; when there is existing data on the specified column, sending the existing data to the client; receiving a ciphertext index value of the existing data; and establishing a correspondence between the ciphertext index value of the existing data and information about the storage location of the existing data in the index structure.
[0044] In this possible implementation, for the existing data in the cloud device, the above method can be used to sample the ciphertext index value of the existing data, and the ciphertext index value can be inserted into the index structure, so that the existing data can adapt to the data management process of this application.
[0045] In a third aspect of the present application, a client is provided for executing the method of the first aspect or any possible implementation of the first aspect. Specifically, the device includes modules or units for executing the method of the first aspect or any possible implementation of the first aspect, such as an acquisition unit, a processing unit, a sending unit, and a receiving unit.
[0046] In a fourth aspect of the present application, a cloud device is provided for executing the method of the second aspect or any possible implementation of the second aspect. Specifically, the device includes modules or units for executing the method of the second aspect or any possible implementation of the second aspect, such as a receiving unit, a processing unit, and a sending unit.
[0047] In a fifth aspect, the present application provides a client. The client may include at least one processor, a memory, and a communication interface. The processor is coupled to the memory and the communication interface. The memory is configured to store instructions, the processor is configured to execute the instructions, and the communication interface is configured to communicate with other network elements under the control of the processor. When executed by the processor, the instructions cause the processor to perform the method of the first aspect or any possible implementation of the first aspect.
[0048] In a sixth aspect of the present application, a cloud device is provided. The cloud device may include at least one processor, a memory, and a communication interface. The processor is coupled to the memory and the communication interface. The memory is configured to store instructions, the processor is configured to execute the instructions, and the communication interface is configured to communicate with other network elements under the control of the processor. When executed by the processor, the instructions cause the processor to perform the method of the second aspect or any possible implementation of the second aspect.
[0049] In a seventh aspect of the present application, a computer-readable storage medium is provided, which stores a program, and the program enables a processor to execute the above-mentioned first aspect and any one of its various implementation methods.
[0050] In an eighth aspect of the present application, a computer-readable storage medium is provided, which stores a program, and the program enables a processor to execute the above-mentioned second aspect and any one of its various implementation methods.
[0051] In a ninth aspect of the present application, a computer program product is provided, which includes computer execution instructions, which are stored in a computer-readable storage medium; at least one processor of a device can read the computer execution instructions from the computer-readable storage medium, and at least one processor executes the computer execution instructions so that the device implements a method provided by the above-mentioned first aspect or any possible implementation of the first aspect.
[0052] In the tenth aspect, a computer program product is provided, which includes computer execution instructions, which are stored in a computer-readable storage medium; at least one processor of the device can read the computer execution instructions from the computer-readable storage medium, and at least one processor executes the computer execution instructions so that the device implements a method provided by the above-mentioned second aspect or any possible implementation of the second aspect.
[0053] In an eleventh aspect of the present application, a chip system is provided, comprising a processor configured to support a client in implementing the functions described in the first aspect or any one of the possible implementations of the first aspect. In one possible design, the chip system may further comprise a memory configured to store program instructions and data necessary for the client. The chip system may consist of a chip alone or may include a chip and other discrete components.
[0054] A twelfth aspect of the present application provides a chip system, which includes a processor for supporting a cloud device in implementing the functions involved in the second aspect or any possible implementation of the second aspect. In one possible design, the chip system may also include a memory for storing program instructions and data necessary for the cloud device. The chip system may be composed of a chip or may include a chip and other discrete devices.
[0055] In a nineteenth aspect of the present application, a data management system is provided. The data management system includes a client and a cloud device, wherein the client is used to perform the functions involved in the first aspect or any possible implementation of the first aspect, and the cloud device is used to perform the functions involved in the second aspect or any possible implementation of the second aspect.
[0056] It can be understood that the above-mentioned client, cloud device, computer storage medium, computer program product or chip system is used to execute the corresponding data management method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method provided above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 This is a schematic diagram of the architecture of the data management system provided by an embodiment of the present application;
[0058] Figure 2A It is a schematic diagram of a stand-alone database system;
[0059] Figure 2B This is a schematic diagram of a cluster database system using a shared disk architecture;
[0060] Figure 2C This is a schematic diagram of a cluster database system using a shared-nothing architecture;
[0061] Figure 3 This is a schematic diagram of an embodiment of a data management method provided by an embodiment of the present application;
[0062] Figure 4 is a schematic diagram of another embodiment of the data management method provided in an embodiment of the present application;
[0063] Figure 5 is a schematic diagram of another embodiment of the data management method provided in an embodiment of the present application;
[0064] Figure 6 is a schematic diagram of another embodiment of the data management method provided in an embodiment of the present application;
[0065] Figure 7 is a schematic diagram of another embodiment of the data management method provided in an embodiment of the present application;
[0066] Figure 8 is a schematic diagram of another embodiment of the data management method provided in an embodiment of the present application;
[0067] Figure 9 is a schematic diagram of another embodiment of the data management method provided in an embodiment of the present application;
[0068] Figure 10 is a schematic diagram of another embodiment of the data management method provided in an embodiment of the present application;
[0069] Figure 11 This is a schematic diagram of the structure of the client provided in an embodiment of the present application;
[0070] Figure 12 This is a schematic diagram of the structure of a cloud device provided in an embodiment of the present application;
[0071] Figure 13 This is a schematic diagram of the structure of the client provided in an embodiment of the present application;
[0072] Figure 14 This is a structural diagram of a cloud device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0073] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the present application, rather than all the embodiments. Those skilled in the art will appreciate that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0074] The terms "first," "second," and the like in the specification and claims of this application and in the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that such references are interchangeable where appropriate so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such processes, methods, products, or apparatus.
[0075] Embodiments of the present application provide a data management method, device, and system for reducing the space occupied by the expansion of tables used to store encrypted data, thereby improving the scalability of data storage in cloud devices. Embodiments of the present application also provide corresponding apparatus, systems, computer-readable storage media, and computer program products. These are described in detail below.
[0076] Because the client's storage space is limited, the client's user data is usually stored in the cloud device. To ensure the security of the user data, these user data are usually stored in the cloud device in the form of encrypted data. The cloud device can manage the stored encrypted data. The system formed by the client and cloud device related to the embodiment of the present application is called a data management system. The data management system can be referred to in Figure 1 Understand.
[0077] like Figure 1 As shown, a data management system may include clients and cloud devices. There may be one or more clients and one or more cloud devices. Different cloud devices may manage data on different clients. For example, cloud device 1 may manage data on clients in region 1, while cloud device 2 may manage data on clients in region 2. Alternatively, different cloud devices may manage different types of user data. For example, cloud device 1 may manage type A data generated by clients, while cloud device 2 may manage type B data generated by clients.
[0078] The client can be hardware (such as a terminal device) or software (such as an application (APP)).
[0079] If the client is a terminal device, the terminal device (also called user equipment (UE)) is a device with wireless transceiver capabilities. It can be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; it can also be deployed on water (such as ships); it can also be deployed in the air (for example, on airplanes, balloons, and satellites). The terminal can be a mobile phone, tablet computer, computer with wireless transceiver capabilities, virtual reality (VR) terminal, augmented reality (AR) terminal, wireless terminal in industrial control (industrial control), wireless terminal in self-driving (autonomous driving), wireless terminal in remote medical care, wireless terminal in smart grid (smart grid), wireless terminal in transportation safety (transportation safety), wireless terminal in smart city (smart city), wireless terminal in smart home (smart home), wireless terminal in the Internet of Things (IoT), etc.
[0080] The cloud device can be a physical machine or a virtual machine (VM) or a container. The above-mentioned cloud device can be a device that carries the database management system (DBMS) in the database system. The method provided in the embodiment of the present application can be implemented as a part of the database management system or as an independent component. The method provided in the embodiment of the present application can be applied to a stand-alone database system or a cluster database system. The database system (database system) generally consists of the following three parts: (1) Database (DB), which refers to a collection of organized and shareable data stored in a computer for a long time. The data in the database is organized, described and stored according to a certain mathematical model, with low redundancy, high data independence and easy scalability, and can be shared by various users. (2) Hardware, including data storage required to store data, such as memory and / or disk. (3) Software, including DBMS. DBMS is the core software of the database system. It is system software used to scientifically organize and store data, and efficiently obtain and maintain data. The database engine is the core component of DBMS.
[0081] Specifically, Figure 2A This diagram shows a stand-alone database system, which includes a database management system (DBMS) and data storage. The DBMS provides services such as database queries and modifications, and the DBMS stores data in the data storage. In a stand-alone database system, the DBMS and data storage are typically located on a single server, such as a symmetric multi-processor (SMP) server. An SMP server includes multiple processors, all of which share resources such as a bus, memory, and I / O system. The DBMS's functions are implemented by one or more processors executing programs in memory.
[0082] Figure 2B This is a diagram of a cluster database system using a shared-storage architecture, including multiple nodes (such as Figure 2BIn the embodiment of the present invention, there are nodes 1-N in the cluster database system), each node is deployed with a database management system, which provides users with services such as database query and modification. Multiple database management systems store shared data in a shared data storage device, and perform read and write operations on the data in the data storage device through a switch. The shared data storage device can be a shared disk array. The nodes in the cluster database system can be physical machines, such as database servers, or virtual machines (VMs) or containers running on abstract hardware resources. When the node is a virtual machine or a container, the database management system deployed in the node is a DBMS instance, which can be a process or a thread. If the node is a physical machine, the switch is a storage area network (SAN) switch, an Ethernet switch, a fiber optic switch or other physical switching devices. If the node is a virtual machine or a container, the switch is a virtual switch.
[0083] Figure 2C This is a diagram of a cluster database system that uses a shared-nothing architecture. Each node has its own dedicated hardware resources (such as data storage), operating system, and database, and nodes communicate with each other through the network. In this system, data will be distributed to each node based on the database model and application characteristics. Query tasks will be divided into several parts and executed in parallel on all nodes. They collaborate with each other to provide database services as a whole. All communication functions are implemented on a high-bandwidth network interconnection system. Figure 2B Like the cluster database system with the shared-storage architecture described above, the nodes here can be either physical machines or virtual machines.
[0084] In all embodiments of the present application, the data storage of the database system includes but is not limited to solid state drives (SSDs), disk arrays, or other types of non-transitory computer-readable media. Figure 2A-2C Although the database is not shown in the figure, it should be understood that the database is stored in the data storage. Those skilled in the art will understand that a database system may include Figure 2A-2C Fewer or more components than those shown in, or including Figure 2A-2C The components shown in the figure are different components. Figure 2A-2C Only components that are more relevant to the implementation disclosed in the embodiments of this application are shown. Figure 2B and Figure 2CAlthough four nodes have been described, those skilled in the art will appreciate that a cluster database system may include any number of nodes. The database management system functions of each node may be implemented by an appropriate combination of software, hardware, and / or firmware running on each node.
[0085] above Figures 2A to 2C The database system includes a node. The structure of the node is introduced below with reference to the accompanying drawings. The node may include: at least one processor, a non-transitory computer-readable medium storing executable code, and a database management system. The executable code is configured to implement the components and functions of the database management system when executed by at least one processor. The non-transitory computer-readable medium may include one or more non-volatile memories. As an example, the non-volatile memory includes semiconductor memory devices, such as erasable programmable read only memory (EPROM), electrically erasable programmable read only memory (EEPROM) and flash memory; disks, such as internal hard disks or removable disks, magneto-optical disks, and CD ROMs and DVD-ROMs. In addition, the non-transitory computer-readable medium may also include any device configured as main memory. The at least one processor may include any type of general-purpose computing circuit or specialized logic circuit, such as a field-programmable gate array (FPGA) or an application-specific integrated circuit (ASIC). The at least one processor 104 may also be one or more processors coupled to one or more semiconductor substrates, such as a CPU.
[0086] Database management systems support structured query language (SQL). Generally, SQL refers to a specialized programming language specifically designed for managing data stored in relational databases. SQL can refer to various types of data-related languages, including, for example, data definition languages and data manipulation languages, where the scope of SQL can include data insertion, querying, updating and deleting, schema creation and modification, and data access control. In addition, in some examples, SQL can include descriptions related to various language elements, including clauses, expressions, predicates, and query statements, which are often also referred to as "queries." For example, clauses can refer to various components of statements and queries, and in some cases, clauses can be considered optional. In addition, expressions can be configured to generate scalar values and / or tables including data columns and / or rows. In addition, predicates can be configured to specify conditions for regulating the effects of statements and queries.
[0087] A query statement is a request to view, access, and / or manipulate data stored in a database. A database management system can receive SQL-formatted queries (called SQL queries) from a client. This SQL query can also be called an SQL statement. Typically, a database management system generates query results corresponding to the query by accessing and manipulating relevant data from the database and returns the query results to the database client. A database is a collection of data organized, described, and stored according to a specific mathematical model. A database can include one or more database structures or formats, such as row-store and column-store.
[0088] The above-mentioned cloud device can be applied to database scenarios or non-database scenarios. Regardless of whether the cloud device is applied to database scenarios, the data management method provided by the embodiment of the present application can be applied. The data management method provided by the embodiment of the present application is described below with reference to the accompanying drawings.
[0089] like Figure 3 Schematic diagram of an embodiment of a data management method shown. An embodiment of the data management method provided in the embodiment of the present application includes:
[0090] 101. A client obtains a first statement, where the first statement includes plaintext data.
[0091] The first statement may be a first statement based on a sequential operation.
[0092] Plaintext data can also be described as "data in plaintext." Many plaintext data are based on sequential records, such as employee and student information lists. These sequentially recorded data also need to be arranged in sequence after being encrypted with the user key. These data are also called data with sequential requirements.
[0093] The table is based on sequential records and can be understood by referring to Table 1 below.
[0094] Table 1: Employee Information
[0095] Logo Name age department 0001 Zhao Yi 24 Quality Control 0002 Li Er 26 Production 0003 Zhang San 28 project …… …… …… ……
[0096] The plaintext data may be any column in Table 1, or information in one or more rows in a column.
[0097] The encryption method for these data with order requirements can be order-preserving encryption (OPE), order-revealing encryption (ORE), or other order-based encryption methods. In this application, statements for operations on these order-related data can be referred to as statements based on order operations. Input conditions based on order operations can include comparison operators, range queries, sorting (ORDERBY), minimum value (MIN), maximum value (MAX), and sorting (SORT).
[0098] The first statement may be a Structured Query Language (SQL) statement. The first statement is typically generated based on user input, such as a statement generated based on a query condition input by the user, or a statement generated based on an insert instruction, update instruction, or delete instruction input by the user.
[0099] 102. The client determines the ciphertext index value based on the information of the plaintext data.
[0100] The ciphertext index value refers to the index value that has a pointing relationship with the ciphertext data.
[0101] 103. The client sends a second statement to the cloud device, where the second statement includes the ciphertext index value. In response, the cloud device receives the second statement.
[0102] The second statement may also be an SQL statement. The operation indicated by the second statement is the same as the operation indicated by the first statement.
[0103] 104. In response to the second statement, the cloud device establishes a correspondence between the ciphertext index value and the storage location information of the ciphertext data in the index structure according to the ciphertext index value, or queries the storage location information of the ciphertext data from the index structure, where the ciphertext data is encrypted data corresponding to the plaintext data, and the storage location information indicates the storage location of the ciphertext data.
[0104] The ciphertext data is encrypted data corresponding to the plaintext data, and the storage location information indicates the storage location of the ciphertext data.
[0105] The index structure is a structure established by the cloud device to store the correspondence between the ciphertext index value and the storage location information of the ciphertext data. The index structure can be a tree structure, such as a B-tree, or other types of structures. The information about the storage location of the ciphertext data can include the address of the storage location or the identifier of the ciphertext data in the stored list. If the operation indicated by the second statement is an insert operation, the cloud device will establish a correspondence between the ciphertext index value and the storage location information of the ciphertext data in the index structure. If the operation indicated by the second statement is a query operation, an update operation, or a delete operation, the cloud device will query the storage location information of the ciphertext data from the index structure, and then query the ciphertext data based on the storage location information.
[0106] In the solution provided by the embodiment of the present application, the client can generate a ciphertext index value for plaintext data based on sequential operations, and then the cloud device can store the ciphertext index value in the index structure, establish a correspondence between the ciphertext index value and the storage location information of the ciphertext data, and when it is necessary to query the ciphertext data corresponding to the ciphertext index value, the corresponding ciphertext data can be queried according to the correspondence in the index structure, and then the corresponding operation on the ciphertext data can be performed. As can be seen, in the present application, the ciphertext index value is used instead of the field in the data column as the key value in the conventional ordered index to realize the search of ciphertext data. It is possible to perform a sequential query on the ciphertext data stored in the table without adding data table fields, thereby reducing the space occupied by the expansion of the table used to store ciphertext data and improving the scalability of data storage in the cloud device. In other words, the solution of the present application realizes the function based on sequential operations without changing the interaction mode, increasing the number of additional interactions, maintaining the efficiency of conventional queries, and without adding data table fields, changing the conventional index function, or adding additional SQL statements to change the query mode.
[0107] Optionally, the information of the plaintext data involved in step 102 may include the value of the plaintext data, the type of the plaintext data, and the value range of the plaintext data. The value range of the plaintext data may include the size of the plaintext data or the lower limit of the plaintext data.
[0108] The embodiments of the present application can be achieved by: normalizing the value of the plaintext data, the type of the plaintext data, and the value range of the plaintext data to obtain the plaintext value, the plaintext space, and the ciphertext space; and determining the ciphertext index value based on the plaintext value, the plaintext space, and the ciphertext space.
[0109] The plaintext value is a normalized plaintext value, and the plaintext space is also a normalized plaintext space.
[0110] The process of determining the ciphertext index value based on the plaintext value, the plaintext space, and the ciphertext space can be performed using a binary recursive method. The process may include: sampling in a sampling interval of the ciphertext space to obtain a sampling point, where the sampling interval corresponds to the midpoint of the plaintext space; reducing the plaintext space and the ciphertext space based on the midpoint and the plaintext value to obtain a reduced plaintext space and a reduced ciphertext space, where the reduced plaintext space has the midpoint as a boundary and contains the plaintext value, and the reduced ciphertext space has the sampling point as a boundary; repeatedly performing the steps of sampling and reducing the plaintext space and the ciphertext space until the upper boundary and the lower boundary of the reduced plaintext space coincide, and the sampling point of the reduced ciphertext space corresponding to the coincidence of the upper boundary and the lower boundary is the ciphertext index value.
[0111] The above process of determining the ciphertext index value can be found in Figure 4 Understand. Figure 4 As shown, the process of determining the ciphertext index value may include:
[0112] 201. The client parses the first statement to determine the value of the plaintext data, the data type of the plaintext data, and the value range of the plaintext data.
[0113] The value range of the plaintext data may be determined according to the data type of the plaintext data, may be a pre-configured default range, or may be a range dynamically input by a user.
[0114] The types of plaintext data can include integer (int), floating point (float), string (string), and character (char). Integer can be further divided into int4 and int8, floating point can be further divided into floating point types of different granularities, string can be further divided into long string and short string, and character can be further divided into readable character and full character. The value range of plaintext data is related to the type of plaintext data. For example, if the type of plaintext data is int4, the value range of the plaintext data can be [-2 31 ,2 31 ].
[0115] 202. The client determines a normalization parameter of the plaintext data according to the type of the plaintext data and the value range of the plaintext data.
[0116] 203. The client normalizes the value of the plaintext data according to the normalization parameter to obtain the plaintext value, the plaintext space, and the ciphertext space.
[0117] The normalization process may adopt different processing methods for different types, such as using translation or shift normalization methods for integer types, using truncation, compression and other normalization processing methods for string types, and using truncation, translation and other normalization processing methods for floating-point types.
[0118] For example, for integer types (int1, int2, int4, int8), negative numbers must be normalized to non-negative values. For int8 encryption exceeding the limit, the BN library from the OpenSSL open-source library can be used before encryption (all conversions exceeding the int8 range must use the BIGNUM library). This allows for unlimited data in practical applications.
[0119] Character types (text, varchar(n), char, char(n), varchar2(n), bytea): Let n be the size of the valid character space for the current type + 1. The full valid character space, such as bytea, is 256. Long strings are truncated to a fixed length using the normalization parameter. The low-order bits of short strings are complemented with 0s. The string is then converted to base-n before being transferred to a BN structure.
[0120] Floating-point types (float4, float8, and double precision): Normalization constructs the exponent concatenated with the significand, supporting negative numbers and negative exponents. The maximum exponent for the current type is emax, and the exponent exp. The exponent of a negative number is corrected to emax - exp, and for a positive number to 3 * emax + exp. The significand (decimal) of a negative number is corrected to 9 minus the significand. If the number of significands is insufficient, the lower-order digits are padded with zeros according to the normalization parameter before concatenation. If the significand is too long, the lower digits are truncated.
[0121] To reduce the occurrence of weak key situations in consecutive ciphertexts, the normalized plaintext values can be multiplied by the same ratio (for example, 8) to prevent the existence of two ciphertexts whose difference is less than the ratio. The ratio refers to the ratio by which the normalized plaintext values are multiplied.
[0122] The plaintext space is determined by the type of plaintext data and the upper and lower bounds of the plaintext data determined by the normalization parameters. The size of the ciphertext space can generally be a fixed multiple of the bit length of the plaintext space (for example, 1.3 times, 1.5 times, of course, other multiples are also possible and are not limited in this application). If it exceeds a certain lower limit (for example, limiting the ciphertext space bit length to at least 10 bits longer than the plaintext), the lower bound of the ciphertext space can be 1.
[0123] In this application, the ciphertext space is obtained by amplifying the plaintext space according to the expansion coefficient. In this application, normalization parameters are added and different normalization processing methods are adopted for different types of plaintext data, so that the ciphertext index value generation algorithm of this application is adaptable to all data types without input range restrictions.
[0124] The plaintext space is a numerical range, including an upper bound and a lower bound. For example, the plaintext space is represented as [a1, a2]. The ciphertext space is obtained by amplifying the plaintext space according to the expansion coefficient. For example, the ciphertext space can be represented as [b1, b2].
[0125] 204. The client performs sampling in the sampling interval of the ciphertext space to obtain a sampling point, where the sampling interval corresponds to the midpoint of the plaintext space.
[0126] The plaintext space and ciphertext space correspond to each other. The midpoint of the plaintext space is the midpoint (mid) determined by the upper and lower bounds of the plaintext space. That is, half the sum of the upper and lower bounds of the plaintext space is the midpoint of the plaintext space. For example, the midpoint of [a1, a2] is (a1 + a2) / 2. Because the ciphertext space is larger than the plaintext space, the midpoint of the plaintext space corresponds to a sampling interval in the ciphertext space. The client can perform deterministic sampling within this sampling interval, which can also be understood as pseudo-random sampling, that is, sampling according to the user key, and obtaining a sampling point (y) within this sampling interval.
[0127] The relationship between the sampling point y can be expressed as: y = unisample ([b1 + mid - a1, b2 - a2 + mid] * K sam ,coin), where coin=SHA256(mid‖key), where SHA256 represents a secure hash function, K sam It is a parameter added before sampling, for example, the value can be 0.9, and the K sam The parameter can increase the smoothness of the actual ciphertext distribution. key is a secure random number or user key.
[0128] 205. The client reduces the plaintext space and the ciphertext space according to the midpoint and the plaintext value to obtain a reduced plaintext space and a reduced ciphertext space.
[0129] The reduced plaintext space is bounded by the midpoint and contains the plaintext value, and the reduced ciphertext space is bounded by the sampling point.
[0130] Repeat the above steps of sampling and reducing the plaintext space and ciphertext space until the upper boundary and the lower boundary of the reduced plaintext space coincide with each other. The sampling point of the reduced ciphertext space corresponding to the coincidence of the upper boundary and the lower boundary is the ciphertext index value.
[0131] Based on the size relationship between the midpoint (mid) and the plaintext value (m), the reduced plaintext space and reduced ciphertext space can include cases where the plaintext value is greater than the midpoint, or cases where the plaintext value is less than the midpoint. This comparison relationship and the corresponding result can be expressed as follows: if m>mid, the reduced plaintext space is [mid+1,a2], and the reduced ciphertext space is [y+1,b2]; if m≤mid, the reduced plaintext space is [a1,mid], and the reduced ciphertext space is [b1,y].
[0132] It can also be described as follows: If m>mid, the reduced plaintext space is from the next number after the midpoint to the lower boundary of the original plaintext space, which can be expressed as [mid+1,a2], and the reduced ciphertext space is from the next number after the sampling point to the lower boundary of the ciphertext space, which can be expressed as [y+1,b2]. If m≤mid, the reduced plaintext space is from the upper boundary of the plaintext space to the midpoint, which can be expressed as [a1,mid], and the reduced ciphertext space is from the upper boundary of the ciphertext space to the sampling point, which can be expressed as [b1,y].
[0133] 206. The client performs multiple recursions until the upper and lower boundaries of the reduced plaintext space are equal, and the output sampling points are ciphertext index values.
[0134] The upper and lower bounds of the reduced plaintext space are equal, and also equal to the plaintext value and the midpoint, which can be expressed as a1 = a2 = mid = m. In this case, the sampling point in the ciphertext space corresponding to the reduced plaintext space is the ciphertext index value. In other words, when a1 = a2 = mid = m, the output y is the ciphertext index value. In this application, the ciphertext index value is obtained recursively, which can reduce the probability of ciphertext index value leakage and improve the security of the ciphertext index value.
[0135] In the embodiments of the present application, sampling the sampling interval corresponding to the midpoint of the plaintext space to obtain a sampling point may include: performing a modulo calculation on the size of the sampling interval using an unpredictable pseudo-random number to obtain a modulo value; and determining the corresponding sampling point from the sampling interval based on the modulo value. This method of sampling using a modulo value during the sampling process can improve sampling efficiency, thereby improving the efficiency of calculating the ciphertext index value.
[0136] In the embodiment of the present application, when the upper and lower boundaries coincide, the sampling of the reduced ciphertext space is non-deterministic sampling. This last sampling of the ciphertext space uses non-deterministic sampling to determine the ciphertext index value, which can resist inference attacks.
[0137] Optionally, the client can scramble the second statement before sending it, reducing the chance of query leakage. If the client scrambles the query, after the cloud device returns the query results, the client decrypts the symmetric ciphertext. The decrypted query results may contain some false positives but no false negatives. The decrypted results are then filtered and verified before the final result is output.
[0138] In an embodiment of the present application, the above-mentioned first statement and second statement can indicate multiple operations such as insertion, query, update and deletion. For different operations, the data management processes of the client and the cloud device are slightly different. The following introduces the data management process provided by the embodiment of the present application from the perspective of the first statement and the second statement indicating the insertion operation, query operation, update operation and deletion operation.
[0139] 1. The first statement and the second statement indicate an insert operation.
[0140] like Figure 5 As shown, another embodiment of the data management method provided in the embodiment of the present application may include:
[0141] 301. The client symmetrically encrypts the plaintext data in the first statement to obtain ciphertext data.
[0142] 302. The client determines the ciphertext index value based on the information of the plaintext data.
[0143] This step can be understood by referring to the previous process of determining the ciphertext index value, and will not be repeated here.
[0144] 303. The client adds the ciphertext data and the ciphertext index value to the second statement.
[0145] If the ciphertext data is stored on other devices, a link to the storage location of the ciphertext data may be added to the second statement, so that the cloud device may obtain the ciphertext data through the link to the storage location.
[0146] 304. The client sends a second statement to the cloud device. Correspondingly, the cloud device receives the second statement.
[0147] 305. The cloud device parses the second statement and stores the ciphertext data in a corresponding storage location.
[0148] The second statement can carry the table identifier and column identifier of the table where the encrypted data is to be stored. In this way, the cloud device can find the corresponding table based on the table identifier, insert the data carried in the second statement into the corresponding column, and store the encrypted data in the column indicated by the column identifier.
[0149] 306. The cloud device establishes a correspondence between the ciphertext index value and the information of the storage location where the ciphertext data is located in the index structure.
[0150] The corresponding relationship is a key-value (KV) relationship, where the ciphertext index value is the key and the storage location information is the value.
[0151] 307. The cloud device returns an execution message to the client.
[0152] Such as: insert successful response message.
[0153] The solution provided in the embodiment of the present application can insert the ciphertext index value into the index structure, thereby enabling fast search of ciphertext data when executing a query on the ciphertext data.
[0154] 2. The first statement and the second statement indicate a query operation.
[0155] like Figure 6 As shown, another embodiment of the data management method provided in the embodiment of the present application may include:
[0156] 401. The client determines a ciphertext index value based on information about the plaintext data in the first statement.
[0157] This step can be understood by referring to the previous process of determining the ciphertext index value, and will not be repeated here.
[0158] 402. The client adds the ciphertext index value to the second statement.
[0159] 403. The client sends a second statement to the cloud device. Correspondingly, the cloud device receives the second statement.
[0160] 404. The cloud device parses the second statement and searches the index structure for a KV relationship of the ciphertext index value according to the ciphertext index value.
[0161] 405. The cloud device queries the ciphertext data from the corresponding storage location according to the storage location information in the KV relationship of the ciphertext index value.
[0162] 406. The cloud device returns the query result to the client, where the query result includes the encrypted data.
[0163] The solution provided in the embodiment of the present application can quickly find ciphertext data through ciphertext index values and KV relationships.
[0164] 3. The first statement and the second statement indicate the operation of updating the index value.
[0165] like Figure 7 As shown, another embodiment of the data management method provided in the embodiment of the present application may include:
[0166] 501. The client determines a ciphertext index value based on information about the plaintext data in the first statement.
[0167] The ciphertext index value is the new ciphertext index value.
[0168] 502. The client adds the ciphertext index value of the plaintext data and the original ciphertext index value of the plaintext data to the second statement.
[0169] 503. The client sends a second statement to the cloud device. Correspondingly, the cloud device receives the second statement.
[0170] The second statement includes the original ciphertext index value of the plaintext data and the new ciphertext index value.
[0171] 504. The cloud device searches the index structure for a KV relationship containing the original ciphertext index value based on the original ciphertext index value.
[0172] 505. The cloud device replaces the original ciphertext index value in the KV relationship according to the new ciphertext index value.
[0173] 506. The cloud device returns the execution result to the client.
[0174] The execution result may be a response of an updated index value.
[0175] The solution provided by the embodiment of the present application enhances the flexibility of managing the correspondence between the ciphertext index value and the storage location information of the ciphertext data.
[0176] 4. The first statement and the second statement indicate the operation of updating the ciphertext data.
[0177] like Figure 8 As shown, another embodiment of the data management method provided in the embodiment of the present application may include:
[0178] 601. The client determines a ciphertext index value based on information about the plaintext data in the first statement.
[0179] The plaintext data is the updated plaintext data, and the ciphertext index value is the new ciphertext index value.
[0180] 602. The client symmetrically encrypts the plaintext data to generate ciphertext data.
[0181] The ciphertext data is the ciphertext data corresponding to the plaintext data updated by the client.
[0182] 603. The client adds the ciphertext data corresponding to the updated plaintext data, the new ciphertext index value, and the ciphertext index value of the plaintext data before the update to the second statement.
[0183] 604. The client sends a second statement to the cloud device. Correspondingly, the cloud device receives the second statement.
[0184] The second statement includes the ciphertext data corresponding to the updated plaintext data, as well as the new ciphertext index value and the ciphertext index value of the plaintext data before the update.
[0185] 605. The cloud device searches the index structure for a KV relationship containing the ciphertext index value of the plaintext data before the update based on the ciphertext index value of the plaintext data before the update.
[0186] 606. The cloud device replaces the ciphertext data at the corresponding location with the ciphertext data corresponding to the updated plaintext data based on the information of the storage location in the KV relationship.
[0187] 607. The cloud device replaces the ciphertext index value of the plaintext data before the update in the KV relationship according to the new ciphertext index value.
[0188] 608. The cloud device returns the execution result to the client.
[0189] The execution result may be a response of updating the ciphertext data.
[0190] The solution provided in the embodiment of the present application can realize flexible management of ciphertext data and ciphertext index values in cloud devices.
[0191] 5. The first statement and the second statement indicate an operation of deleting an index value or an operation of deleting ciphertext data.
[0192] like Figure 9 As shown, another embodiment of the data management method provided in the embodiment of the present application may include:
[0193] 701. The client determines a ciphertext index value based on information about the plaintext data in the first statement.
[0194] 702. The client adds the ciphertext index value to the second statement.
[0195] 703. The client sends a second statement to the cloud device. Correspondingly, the cloud device receives the second statement.
[0196] 704. The cloud device searches the index structure for the corresponding KV relationship based on the ciphertext index value in the second statement.
[0197] 705. The cloud device deletes the ciphertext index value from the KV relationship, or deletes the ciphertext data according to the storage location information in the KV relationship, and deletes the KV relationship.
[0198] 706. The cloud device returns the execution result to the client.
[0199] The execution result may be a response indicating successful deletion.
[0200] The above describes the execution process of inserting, querying, updating and deleting operations designed for the client and cloud device in the data management process. In fact, there may be some existing data in the cloud device that does not have a ciphertext index value. For these existing data, the embodiment of the present application also provides a corresponding management process. Figure 10 Understand.
[0201] like Figure 10 As shown, another embodiment of the data management method provided in the embodiment of the present application may include:
[0202] 801. The client sends a create index statement to the cloud device. Correspondingly, the cloud device receives the create index statement.
[0203] Create an index statement (create index). The create index statement specifies the specified column of the specified table in the first statement. The create statement contains the identifier of the specified table (table ID) and the identifier of the specified column (column ID).
[0204] 802. The cloud device queries the specified column of the specified table of the second statement according to the create index statement.
[0205] 803. When there is existing data in the designated column, the cloud device sends the existing data to the client. Correspondingly, the client receives the existing data in the designated column returned by the cloud device.
[0206] 804. The client determines the ciphertext index value of the existing data.
[0207] 805. The client sends the ciphertext index value of the existing data to the cloud device. Correspondingly, the cloud device receives the ciphertext index value of the existing data sent by the client.
[0208] The ciphertext index value of the existing data may be sent via an update statement.
[0209] 806. The cloud device establishes a correspondence between the ciphertext index value of the existing data and the storage location information of the existing data in the index structure.
[0210] In an embodiment of the present application, the existing data in the cloud device can be adapted to the above data management process. This process can be performed before the above insert, query, update and delete operations.
[0211] The data management method provided in the embodiment of the present application is configured with a Gaussian order preserving encryption (GSOPE) algorithm in the client. The GSOPE algorithm is more computationally efficient than the existing BCLO algorithm or the Lewi-Wu algorithm. A comparison is made below using a set of experimental data as an example.
[0212] Table 2: Experimental data (unit: microseconds)
[0213] GSOPE BCLO Lewi-Wu (block size 10) INT4 88 3000+ 300 INT8 360 7000+ 527 FLOAT8 343 Not supported Not supported 0-1 string
[25] 99 Not supported 223 CHAR
[15] (readable character) 515 Not supported 900+ CHAR
[15] (full character) 728 Not supported 1200+
[0214] In Table 2, Lewi-Wu is a trapdoor block evolution algorithm that reduces ciphertext leakage based on the CLWW algorithm.
[0215] From the data comparison results in Table 2, it can be seen that for the plaintext data of INT4, the GSOPE algorithm provided by this application only takes 88 microseconds, while the BCLO algorithm takes more than 3000 microseconds, and the Lewi-Wu algorithm also takes 300 microseconds. For the float type, neither the BCLO algorithm nor the Lewi-Wu algorithm supports float calculations, and the BCLO algorithm also does not support string and CHAR type calculations. Although the Lewi-Wu algorithm supports string and CHAR type calculations, its computational efficiency is far lower than the GSOPE algorithm provided by this application.
[0216] It can be seen from this that the GSOPE algorithm provided in the embodiment of the present application supports all data types of plaintext data, and objectively has no data range restrictions, and subjectively the range is controllable.
[0217] The above introduces the method for data management by which the client and cloud device cooperate to complete the embodiment of the present application. The following introduces the client and cloud device provided in the embodiment of the present application with reference to the accompanying drawings.
[0218] like Figure 11 As shown, an embodiment of the client 90 provided in the embodiment of the present application includes:
[0219] The acquiring unit 901 is configured to acquire a first statement, where the first statement includes plaintext data.
[0220] The processing unit 902 is configured to determine a ciphertext index value according to the plaintext data information obtained by the obtaining unit 901 .
[0221] The sending unit 903 is used to send a second statement to the cloud device, where the second statement includes the ciphertext index value determined by the processing unit 902. The ciphertext index value is used by the cloud device to establish a correspondence between the ciphertext index value and the storage location information of the ciphertext data in the index structure, or to query the storage location information of the ciphertext data from the index structure. The ciphertext data is encrypted data corresponding to the plaintext data, and the storage location information indicates the storage location of the ciphertext data.
[0222] In the solution provided by the embodiments of the present application, the client can generate a ciphertext index value for plaintext data based on sequential operations, and then the cloud device can store the ciphertext index value in the index structure, establish a correspondence between the ciphertext index value and the storage location information of the ciphertext data, and when it is necessary to query the ciphertext data corresponding to the ciphertext index value, the corresponding ciphertext data can be queried based on the correspondence in the index structure, and then the corresponding operation on the ciphertext data can be performed. As can be seen, in this application, the ciphertext index value replaces the field in the data column as the key value in the conventional ordered index to realize the search of ciphertext data. Without adding data table fields, the ciphertext data stored in the table can be queried based on the sequence, thereby reducing the space occupied by the expansion of the table used to store ciphertext data and improving the scalability of data storage in the cloud device. In other words, the solution of the present application realizes the function based on sequential operations without changing the interaction mode, increasing the number of additional interactions, maintaining the efficiency of conventional queries, and without adding data table fields, changing the conventional index function, or adding additional SQL statements to change the query mode.
[0223] Optionally, the information of the plaintext data includes the value of the plaintext data, the type of the plaintext data, and the value range of the plaintext data.
[0224] Optionally, the processing unit 902 is configured to normalize the value of the plaintext data, the type of the plaintext data, and the value range of the plaintext data to obtain a plaintext value, a plaintext space, and a ciphertext space; and determine a ciphertext index value based on the plaintext value, the plaintext space, and the ciphertext space.
[0225] Optionally, the processing unit 902 is configured to perform sampling in a sampling interval of the ciphertext space to obtain a sampling point, where the sampling interval corresponds to the midpoint of the plaintext space; reduce the plaintext space and the ciphertext space according to the midpoint and the plaintext value to obtain a reduced plaintext space and a reduced ciphertext space, where the reduced plaintext space has the midpoint as a boundary and contains the plaintext value, and the reduced ciphertext space has the sampling point as a boundary; and repeatedly perform the above steps of sampling and reducing the plaintext space and the ciphertext space until the upper boundary and the lower boundary of the reduced plaintext space coincide, and the sampling point of the reduced ciphertext space corresponding to the coincidence of the upper boundary and the lower boundary is the ciphertext index value.
[0226] Optionally, the processing unit 902 is configured to perform a modulo calculation on the size of the sampling interval using an unpredictable pseudo-random number to obtain a modulo value; and determine a corresponding sampling point from the sampling interval according to the modulo value.
[0227] Optionally, when the upper boundary and the lower boundary coincide, the sampling of the reduced ciphertext space is non-deterministic sampling.
[0228] Optionally, the processing unit 902 is also used for the first statement to indicate an insert operation or an update operation, and to perform symmetric encryption processing on the plaintext data to obtain ciphertext data of the plaintext data; the second statement also includes ciphertext data, and the ciphertext data is stored in a corresponding storage location by the cloud device.
[0229] Optionally, the processing unit 902 is further configured to use the first statement to indicate a query operation and to scramble the second statement.
[0230] The receiving unit 904 is configured to receive the query result returned by the cloud device.
[0231] The processing unit 902 is further configured to descramble the query result.
[0232] Optionally, the sending unit 903 is further configured to send a create index statement to the cloud device, where the create index statement indicates a specified column of a specified table of the first statement.
[0233] The receiving unit 904 is configured to receive the existing data on the specified column returned by the cloud device.
[0234] The processing unit 902 is further configured to determine the ciphertext index value of the existing data.
[0235] The sending unit 903 is also used to send the ciphertext index value of the existing data to the cloud device.
[0236] like Figure 12 As shown, an embodiment of the cloud device 100 provided in the embodiment of the present application includes:
[0237] The receiving unit 1001 is configured to receive a second statement from a client, where the second statement includes a ciphertext index value determined by the client in response to a first statement based on information about plaintext data, and the first statement includes plaintext data.
[0238] The processing unit 1002 is used to establish a correspondence between the ciphertext index value and the storage location information of the ciphertext data in the index structure according to the ciphertext index value in response to the second statement received by the receiving unit 1001, or to query the storage location information of the ciphertext data from the index structure, where the ciphertext data is encrypted data corresponding to the plaintext data, and the storage location information indicates the storage location of the ciphertext data.
[0239] In an embodiment of the present application, the cloud device can store the ciphertext index value determined by the client in an index structure, establish a correspondence between the ciphertext index value and the storage location information of the ciphertext data, and when it is necessary to query the ciphertext data corresponding to the ciphertext index value, the corresponding ciphertext data can be queried according to the correspondence in the index structure, and then the corresponding operation on the ciphertext data can be performed. As can be seen, in the present application, the ciphertext index value is used instead of the field in the data column as the key value in the conventional ordered index to realize the search of ciphertext data. Without adding data table fields, the ciphertext data stored in the table can be queried based on the sequence, thereby reducing the space occupied by the expansion of the table used to store ciphertext data and improving the scalability of the stored data in the cloud device. In other words, the solution of the present application realizes the function based on the sequence operation without changing the interaction mode, increasing the number of additional interactions, maintaining the efficiency of conventional queries, and without adding data table fields, changing the conventional index function, or adding additional SQL statements to change the query mode.
[0240] Optionally, the processing unit 1002 is also used to determine the ciphertext data corresponding to the plaintext data according to the second statement before establishing the corresponding relationship if the second statement indicates an insert operation; and store the ciphertext data in a corresponding storage location, which is the location indicated by the storage position information in the corresponding relationship.
[0241] Optionally, the processing unit 1002 is further configured to, if the second statement indicates a query operation, query the storage location information of the ciphertext data from the index structure, and then query the ciphertext data according to the storage location information.
[0242] The sending unit 1003 is used to return the encrypted data to the client.
[0243] Optionally, the processing unit 1002 is also used to query the correspondence between the original ciphertext index and the storage location information based on the original ciphertext index value if the second statement indicates to update the index value, and the second statement also includes the original ciphertext index value of the plaintext data; and update the correspondence between the original ciphertext index value in the index structure and the storage location information based on the ciphertext index value.
[0244] Optionally, the processing unit 1002 is further used to query the correspondence between the ciphertext index value of the plaintext data before the update and the information of the storage location based on the ciphertext index value of the plaintext data before the update if the second statement indicates updating the ciphertext data, and the second statement also includes or indicates the ciphertext data of the plaintext data, and the ciphertext index value of the plaintext data before the update; update the correspondence between the ciphertext index value of the plaintext data before the update and the information of the storage location based on the ciphertext index value of the plaintext data; and update the ciphertext data at the storage location based on the ciphertext data of the plaintext data.
[0245] Optionally, the processing unit 1002 is further configured to delete the ciphertext index value from the correspondence between the ciphertext index value and the storage location information in the index structure if the second statement indicates to delete the index value.
[0246] Optionally, the processing unit 1002 is further used to delete the ciphertext data at the storage location according to the storage location information if the second statement indicates to delete the ciphertext data, and delete the correspondence between the ciphertext index value and the storage location information of the ciphertext data from the index structure.
[0247] Optionally, the receiving unit 1001 is further configured to receive a create index statement.
[0248] The processing unit 1002 is further configured to query a specified column of a specified table in the second statement according to the create index statement.
[0249] The sending unit 1003 is configured to send the existing data to the client when there is existing data in the designated column.
[0250] The receiving unit 1001 is further configured to receive a ciphertext index value of existing data.
[0251] The processing unit 1002 is further configured to establish a correspondence between the ciphertext index value of the existing data and the storage location information of the existing data in the index structure.
[0252] The functions of the client and cloud devices described above can be found in the Figures 1 to 10 Please refer to the corresponding description of the previous part for understanding, and no further repetition will be given here.
[0253] Figure 13 The block diagram shows a partial structure of a mobile phone client provided by an embodiment of the present application. Figure 13 The mobile phone includes components such as a radio frequency (RF) circuit 810, a memory 820, an input unit 830, a display unit 840, a sensor 850, an audio circuit 860, a wireless fidelity (WiFi) module 870, a processor 880, and a power supply 890. Those skilled in the art will appreciate that Figure 13 The mobile phone structure shown in the figure does not constitute a limitation to the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0254] The following combination Figure 13 A detailed introduction to the various components of a mobile phone:
[0255] RF circuitry 810 is used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and transmits it to processor 880 for processing. Furthermore, it transmits uplink data to the base station. Typically, RF circuitry 810 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), and a duplexer.
[0256] The memory 820 can be used to store software programs and modules. The processor 880 executes the various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 820. The memory 820 can mainly include a program storage area and a data storage area. The program storage area can store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created based on the phone's settings (such as audio data, a phone book, etc.). In addition, the memory 820 can include a high-speed random access memory and a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0257] The input unit 830 can be used to receive information input by the user, such as a user password, and to generate key signal inputs related to the user settings and function control of the mobile phone. Specifically, the input unit 830 may include a touch panel 831 and other input devices 832. The touch panel 831, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user on or near the touch panel 831 using any suitable object or accessory such as a finger or stylus) and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 831 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch direction and detects the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 880. It can also receive commands sent by the processor 880 and execute them. In addition, the touch panel 831 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 831, the input unit 830 may further include other input devices 832. Specifically, the other input devices 832 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick.
[0258] The display unit 840 can be used to display the interface content of the APP. The display unit 840 may include a display panel 841. Optionally, the display panel 841 may be configured in the form of a liquid crystal display (English full name: Liquid Crystal Display, English abbreviation: LCD), an organic light-emitting diode (English full name: Organic Light-Emitting Diode, English abbreviation: OLED), etc. Further, the touch panel 831 may cover the display panel 841. When the touch panel 831 detects a touch operation on or near it, it is transmitted to the processor 880 to determine the type of touch event. Subsequently, the processor 880 provides corresponding visual output on the display panel 841 according to the type of touch event. Although in Figure 13 In the embodiment, the touch panel 831 and the display panel 841 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 831 and the display panel 841 can be integrated to realize the input and output functions of the mobile phone.
[0259] The mobile phone may also include at least one sensor 850, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 841 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 841 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that the mobile phone can also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described here.
[0260] Audio circuit 860, speaker 861, and microphone 862 provide an audio interface between the user and the phone. Audio circuit 860 converts received audio data into electrical signals and transmits them to speaker 861, which then converts them into sound signals for output. Microphone 862, on the other hand, converts collected sound signals into electrical signals, which are then received by audio circuit 860 and converted into audio data. The audio data is then processed by processor 880 and transmitted via RF circuit 810 to, for example, another phone. Alternatively, the audio data can be output to memory 820 for further processing.
[0261] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse the web and access streaming media through the WiFi module 870. It provides users with wireless broadband Internet access. Figure 13A WiFi module 870 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0262] Processor 880 is the control center of the mobile phone, connecting all parts of the phone using various interfaces and circuits. By running or executing software programs and / or modules stored in memory 820 and accessing data stored in memory 820, it performs various functions of the mobile phone and processes data, thereby providing overall monitoring of the mobile phone. Optionally, processor 880 may include one or more processing units; preferably, processor 880 may integrate an application processor and a modem processor, wherein the application processor primarily handles the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 880.
[0263] The mobile phone also includes a power supply 890 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 880 through a power management system, thereby managing charging, discharging, and power consumption management functions through the power management system.
[0264] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0265] In the embodiment of the present application, the processor 880 also has the client data management function described above.
[0266] Figure 14 1 is a possible logical structure diagram of the cloud device involved in the above embodiments provided in the embodiment of the present application. The cloud device 110 includes: a processor 1101, a communication interface 1102, a memory 1103 and a bus 1104. The processor 1101, the communication interface 1102 and the memory 1103 are interconnected via the bus 1104. In the embodiment of the present application, the processor 1101 is used to control and manage the actions of the cloud device 110, for example, the processor 1101 is used to execute Figures 3 to 10 The cloud device 110 may also include a token verification process, and / or other processes used for the techniques described herein. Communication interface 1102 is used to support communication with cloud device 110. For example, communication interface 1102 may perform the steps of sending and receiving data in the above-described method embodiments. Memory 1103 is used to store program code and data for cloud device 110.
[0267] Among them, the processor 1101 can be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It can implement or execute the various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a digital signal processor and a microprocessor, and so on. The bus 1104 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 14 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0268] In another embodiment of the present application, a computer-readable storage medium is further provided. The computer-readable storage medium stores computer-executable instructions. When at least one processor of the device executes the computer-executable instructions, the device executes the above-mentioned Figures 3 to 10 Some embodiments describe a method for data management.
[0269] In another embodiment of the present application, a computer program product is further provided. The computer program product includes computer-executable instructions, which are stored in a computer-readable storage medium. At least one processor of the device can read the computer-executable instructions from the computer-readable storage medium, and at least one processor executes the computer-executable instructions so that the device performs the above-mentioned Figures 3 to 10 Some embodiments describe a method for data management.
[0270] In another embodiment of the present application, a chip system is further provided, which includes a processor for supporting the client to implement the above Figures 3 to 10 The data management method described in some embodiments. In one possible design, the chip system may also include a memory for storing necessary program instructions and data. The chip system may be composed of a chip or may include a chip and other discrete devices.
[0271] In another embodiment of the present application, a chip system is also provided, which includes a processor for supporting the cloud device to implement the above Figures 3 to 10The data management method described in some embodiments. In one possible design, the chip system may also include a memory for storing necessary program instructions and data. The chip system may be composed of a chip or may include a chip and other discrete devices.
[0272] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can implement the described functions according to different methods for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of this application.
[0273] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0274] In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0275] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0276] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0277] If the function is implemented in the form of a software functional unit and sold or based as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0278] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited to this.
Claims
1. A data management method, characterized in that: include: Obtaining a first statement, where the first statement includes plaintext data, and information about the plaintext data includes a value of the plaintext data, a type of the plaintext data, and a value range of the plaintext data; Normalizing the value of the plaintext data, the type of the plaintext data, and the value range of the plaintext data to obtain a plaintext value, a plaintext space, and a ciphertext space; Sampling in a sampling interval of the ciphertext space to obtain a sampling point, wherein the sampling interval corresponds to a midpoint of the plaintext space; Reducing the plaintext space and the ciphertext space according to the midpoint and the plaintext value to obtain a reduced plaintext space and a reduced ciphertext space, wherein the reduced plaintext space is bounded by the midpoint and contains the plaintext value, and the reduced ciphertext space is bounded by the sampling point; Repeat the above steps of sampling and reducing the plaintext space and the ciphertext space until the upper boundary and the lower boundary of the reduced plaintext space coincide with each other, and the sampling point of the reduced ciphertext space corresponding to the coincidence of the upper boundary and the lower boundary is the ciphertext index value; A second statement is sent to the cloud device, where the second statement includes the ciphertext index value, and the ciphertext index value is used by the cloud device to establish a correspondence between the ciphertext index value and the storage location information of the ciphertext data in the index structure, or to query the storage location information of the ciphertext data from the index structure, where the ciphertext data is encrypted data corresponding to the plaintext data, and the storage location information indicates the storage location of the ciphertext data.
2. The method according to claim 1, characterized in that The sampling in the sampling interval of the ciphertext space to obtain sampling points includes: Performing a modulo calculation on the size of the sampling interval using an unpredictable pseudo-random number to obtain a modulo value; A corresponding sampling point is determined from the sampling interval according to the modulo value.
3. The method according to claim 2, characterized in that When the upper boundary and the lower boundary coincide with each other, the sampling of the reduced ciphertext space is non-deterministic sampling.
4. The method according to any one of claims 1 to 3, characterized in that The first statement indicates an insert operation or an update operation, and the method further includes: Performing symmetric encryption on the plaintext data to obtain ciphertext data of the plaintext data; The second statement also includes or indicates the ciphertext data, and the ciphertext data is stored in a corresponding storage location by the cloud device.
5. The method according to any one of claims 1 to 3, characterized in that The first statement indicates a query operation, and the method further includes: scrambling the second sentence; Receive the query result returned by the cloud device and descramble the query result.
6. The method according to any one of claims 1 to 3, characterized in that After obtaining the first statement, the method further includes: Sending a create index statement to the cloud device, where the create index statement indicates a specified column of a specified table of the first statement; Receiving existing data on the specified column returned by the cloud device; Determining a ciphertext index value of the existing data; Send the ciphertext index value of the existing data to the cloud device.
7. A data management method, characterized in that: include: receiving a second statement from a client, the second statement including a ciphertext index value determined by the client in response to the first statement based on information about plaintext data, the first statement including the plaintext data; wherein the information about the plaintext data includes a value of the plaintext data, a type of the plaintext data, and a value range of the plaintext data; and the ciphertext index value is obtained by normalizing the value of the plaintext data, the type of the plaintext data, and the value range of the plaintext data to obtain a plaintext value, a plaintext space, and a ciphertext space; Sampling is performed in a sampling interval of the ciphertext space to obtain a sampling point, wherein the sampling interval corresponds to a midpoint of the plaintext space; reducing the plaintext space and the ciphertext space based on the midpoint and the plaintext value to obtain a reduced plaintext space and a reduced ciphertext space, wherein the reduced plaintext space has the midpoint as a boundary and contains the plaintext value, and the reduced ciphertext space has the sampling point as a boundary; repeatedly performing the above steps of sampling and reducing the plaintext space and the ciphertext space until the upper boundary and the lower boundary of the reduced plaintext space coincide with each other, and the sampling point of the reduced ciphertext space corresponding to the coincidence of the upper boundary and the lower boundary is the ciphertext index value; In response to the second statement, a correspondence between the ciphertext index value and the storage location information of the ciphertext data is established in the index structure according to the ciphertext index value, or the storage location information of the ciphertext data is queried from the index structure, the ciphertext data is the encrypted data corresponding to the plaintext data, and the storage location information indicates the storage location of the ciphertext data.
8. The method according to claim 7, characterized in that The second statement indicates an insert operation. Before establishing the corresponding relationship, the method further includes: Determining the ciphertext data corresponding to the plaintext data according to the second statement; The ciphertext data is stored in a corresponding storage location, where the storage location is the location indicated by the storage location information in the corresponding relationship.
9. The method according to claim 7, characterized in that The second statement indicates a query operation. After querying the storage location of the ciphertext data from the index structure, the method further includes: Querying the ciphertext data according to the storage location information; Return the encrypted data to the client.
10. The method according to claim 7, characterized in that The second statement indicates an updated index value, and the second statement also includes an original ciphertext index value of the plaintext data. The method further includes: Querying the correspondence between the original ciphertext index and the storage location information according to the original ciphertext index value; The corresponding relationship between the original ciphertext index value and the storage location information in the index structure is updated according to the ciphertext index value.
11. The method according to claim 7, characterized in that The second statement indicates updating the ciphertext data, and the second statement also includes or indicates the ciphertext data of the plaintext data and the ciphertext index value of the plaintext data before the update. The method further includes: Querying the correspondence between the ciphertext index value of the plaintext data before the update and the information of the storage location according to the ciphertext index value of the plaintext data before the update; updating the correspondence between the ciphertext index value of the plaintext data before the update and the information of the storage location according to the ciphertext index value of the plaintext data; The ciphertext data in the storage location is updated according to the ciphertext data of the plaintext data.
12. The method according to claim 7, characterized in that The second statement indicates deleting the index value, and the method further includes: The ciphertext index value is deleted from the correspondence between the ciphertext index value and the storage location information of the index structure.
13. The method according to claim 7, characterized in that The second statement instructs to delete the ciphertext data, and the method further includes: According to the information of the storage location, the ciphertext data at the storage location is deleted, and the correspondence between the ciphertext index value and the information of the storage location of the ciphertext data is deleted from the index structure.
14. The method according to any one of claims 7 to 13, characterized in that: The method further comprises: Receive a create index statement; Querying a specified column of a specified table in the second statement according to the create index statement; When there is existing data in the designated column, sending the existing data to the client; Receiving the ciphertext index value of the existing data; A correspondence between the ciphertext index value of the existing data and the information of the storage location of the existing data is established in the index structure.
15. A client, characterized in that: include: an acquiring unit, configured to acquire a first statement, the first statement including plaintext data, wherein information about the plaintext data includes a value of the plaintext data, a type of the plaintext data, and a value range of the plaintext data; a processing unit, configured to normalize the value of the plaintext data, the type of the plaintext data, and the value range of the plaintext data to obtain a plaintext value, a plaintext space, and a ciphertext space; Sampling is performed in a sampling interval of the ciphertext space to obtain a sampling point, wherein the sampling interval corresponds to a midpoint of the plaintext space; reducing the plaintext space and the ciphertext space based on the midpoint and the plaintext value to obtain a reduced plaintext space and a reduced ciphertext space, wherein the reduced plaintext space has the midpoint as a boundary and contains the plaintext value, and the reduced ciphertext space has the sampling point as a boundary; repeatedly performing the above steps of sampling and reducing the plaintext space and the ciphertext space until the upper boundary and the lower boundary of the reduced plaintext space coincide, wherein the sampling point of the reduced ciphertext space corresponding to the coincidence of the upper boundary and the lower boundary is the ciphertext index value; A sending unit is used to send a second statement to the cloud device, where the second statement includes a ciphertext index value determined by the processing unit, and the ciphertext index value is used by the cloud device to establish a correspondence between the ciphertext index value and the storage location information of the ciphertext data in the index structure, or to query the storage location information of the ciphertext data from the index structure, where the ciphertext data is encrypted data corresponding to the plaintext data, and the storage location information indicates the storage location of the ciphertext data.
16. A cloud device, characterized in that: include: The receiving unit is configured to receive a second statement from a client, wherein the second statement includes a ciphertext index value determined by the client in response to the first statement according to information of the plaintext data, wherein the first statement includes the plaintext data; wherein the information of the plaintext data includes the value of the plaintext data, the type of the plaintext data, and the value range of the plaintext data; the ciphertext index value is obtained by: normalizing the value of the plaintext data, the type of the plaintext data, and the value range of the plaintext data to obtain a plaintext value, a plaintext space, and a ciphertext space; and sampling in a sampling interval of the ciphertext space. The plaintext space and the ciphertext space are sampled to obtain sampling points, wherein the sampling interval corresponds to the midpoint of the plaintext space; based on the midpoint and the plaintext value, the plaintext space and the ciphertext space are reduced to obtain a reduced plaintext space and a reduced ciphertext space, wherein the reduced plaintext space has the midpoint as a boundary and contains the plaintext value, and the reduced ciphertext space has the sampling point as a boundary; the above steps of sampling and reducing the plaintext space and the ciphertext space are repeated until the upper boundary and the lower boundary of the reduced plaintext space coincide with each other, and the sampling point of the reduced ciphertext space corresponding to the coincidence of the upper boundary and the lower boundary is the ciphertext index value; A processing unit is configured to establish, in response to a second statement received by the receiving unit, a correspondence between the ciphertext index value and the storage location information of the ciphertext data in an index structure according to the ciphertext index value, or to query the storage location information of the ciphertext data from the index structure, wherein the ciphertext data is encrypted data corresponding to the plaintext data, and the storage location information indicates the storage location of the ciphertext data.
17. The cloud device according to claim 16, wherein: The cloud device further includes a sending unit, The receiving unit is further configured to receive a create index statement; The processing unit is further configured to query a specified column of a specified table of the second statement according to the create index statement received by the receiving unit; The sending unit is further configured to send the existing data to the client when there is existing data in the designated column; The receiving unit is further configured to receive the ciphertext index value of the existing data; The processing unit is further configured to establish, in the index structure, a correspondence between the ciphertext index value of the existing data and the information of the storage location of the existing data.
18. A client, characterized in that: The client includes at least one processor, a memory, and instructions stored in the memory and executable by the at least one processor, wherein the at least one processor executes the instructions to implement the steps of the method according to any one of claims 1 to 6.
19. A cloud device, characterized in that: include: The cloud device includes at least one processor, a memory, and instructions stored in the memory and executable by the at least one processor, wherein the at least one processor executes the instructions to implement the steps of the method according to any one of claims 7 to 14.
20. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
21. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 7 to 14 is implemented.
22. A data management system, characterized in that: include: A client and a cloud device, wherein the client is used to execute the method according to any one of claims 1 to 6, and the cloud device is used to execute the method according to any one of claims 7 to 14.
Citation Information
Patent Citations
Ciphertext insertion, query and deletion method without interactive frequency hiding
CN112231752A