DAG-based order-preserving encryption method, electronic equipment, storage medium and computer program product
By building a hierarchical DAG structure in multidimensional data, building DAG nodes for subdata in each dimension and adding unidirectional edges, the multidimensional data encryption problem is solved, and the logical and orderly encryption operations of multidimensional data are realized, and the data query and management efficiency is improved.
Patent Information
- Application Number
- CN202411878509.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-11
AI Technical Summary
The prior art is difficult to perform logical and orderly encryption operations on multidimensional data, and it is impossible to effectively realize order-preserved encryption of multidimensional data.
Using the DAG-based order-preserved encryption method, a DAG node is constructed by constructing a DAG node in each dimension for the multidimensional data and adding a one-way edge between the DAG levels to achieve the encryption of multidimensional data.
The logical and orderly encryption operation of multidimensional data is realized, and the logical order and dependence relationship between data in each dimension are clearly reflected through the hierarchical DAG structure, which improves the query and management efficiency of multidimensional data after order-preserved encryption.
Smart Images

Figure CN119808122A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a DAG-based order-preserving encryption method and electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Order-Preserving Encryption (OPE) is an encryption algorithm that preserves the order of data while encrypting it. Order-preserving encryption is particularly suitable for scenarios where operations such as sorting and range querying of encrypted data are required, such as multi-party data exchange, encrypted databases, cloud computing, and other scenarios. Through a properly designed order-preserving encryption algorithm, encrypted data can be directly compared and sorted without decrypting it first, thereby achieving efficient encryption and decryption operations on large-scale data while ensuring data security.
[0003] The core feature of the order-preserving encryption algorithm is that it maintains the relative size relationship of the plaintext, that is, for any two plaintexts x1 and x2, if x1<x2, the encrypted ciphertext E(x1) is still smaller than E(x2). This feature makes order-preserving encryption have significant advantages in certain specific application scenarios, such as encrypted sorting of financial data, range queries based on encrypted data, etc.
[0004] In order to ensure the security of order-preserving encryption, algorithms are usually based on the structure of complex data models, such as hypergeometric probability distribution or balanced trees, etc. These mathematical models can not only provide efficient data insertion, update and query operations, but also support complex operations across data.
[0005] However, there are still deficiencies in the order-preserving encryption of multidimensional data in related schemes, and it is impossible to perform encryption operations on multidimensional data in a logical and orderly manner. Summary of the invention
[0006] The purpose of the embodiments of the present application is to provide a DAG-based order-preserving encryption method and electronic device, storage medium, and computer program product, which are used to implement logical and orderly order-preserving encryption of multi-dimensional data.
[0007] On the one hand, the present application provides a DAG-based order-preserving encryption method, comprising:
[0008] For each multidimensional data in the multidimensional data set, a DAG node corresponding to the DAG level in the i-th dimension is constructed for the sub-data in the i-th dimension of the multidimensional data; wherein the order-preserving encryption value and the symmetric encryption value of the sub-data are written into the DAG node; the value range of i is 1 to m, and m is the total number of dimensions of the multidimensional data;
[0009] For the DAG level corresponding to the i-th dimension, based on the size relationship of the order-preserving encrypted values of the DAG nodes at the DAG level, add unidirectional edges between the DAG nodes at the DAG level;
[0010] For each DAG node in the DAG level corresponding to the jth dimension, add a unidirectional edge between the DAG node and each DAG node in the DAG level corresponding to the j+1th dimension that satisfies the association relationship; where j ranges from 1 to m-1;
[0011] A hierarchical DAG is constructed based on multiple DAG nodes of m dimension and multiple unidirectional edges that have been added.
[0012] Through the above measures, this scheme can perform logical and ordered encryption operations for multidimensional data, thereby clearly reflecting the logical order and dependency relationship between data of each dimension through the hierarchical DAG structure, which is helpful for the query and management of multidimensional data after order-preserving encryption.
[0013] In one embodiment, the step of calculating the order-preserving encryption value of the sub-data includes:
[0014] The sub-data of the multidimensional data in the i-th dimension is converted into an initial encryption value of the encryption range corresponding to the i-th dimension, and a random offset is added to the initial encryption value to obtain the order-preserving encryption value of the multidimensional data in the i-th dimension; wherein the order-preserving encryption process is high-precision floating-point arithmetic or fixed-point arithmetic.
[0015] Through this measure, the sub-data is mapped to a sufficiently large space by presetting the encryption range, adding a random offset in the confidentiality process, and improving the accuracy of the mapping step through high-precision floating-point operations or fixed-point operations. This can prevent different sub-data from obtaining the same order-preserving encryption value (that is, data collision) after order-preserving encryption, prevent attackers from inferring the original data distribution through frequency analysis, and further improve the resistance to frequency analysis attacks and the encryption security of the order-preserving encryption value.
[0016] In one embodiment, after adding a unidirectional edge between each DAG node in the DAG level corresponding to the jth dimension and each DAG node satisfying an association relationship with the DAG node in the DAG level corresponding to the j+1th dimension, the method further includes:
[0017] Determine the number of virtual nodes based on the preset disturbance ratio and the total number of original DAG nodes in m dimensions;
[0018] The virtual nodes indicated by the virtual node quantity are added to the corresponding DAG level according to the preset perturbation rule, and the unidirectional edges corresponding to the virtual nodes are added.
[0019] Through this measure, by adding virtual nodes and adding unidirectional edges to the virtual nodes, the path of the hierarchical DAG can be perturbed, and the real logical order and dependency relationship of the multidimensional data corresponding to the hierarchical DAG can be further hidden, which effectively prevents the leakage of frequency information, improves the defense capability against structural analysis attacks, and enhances data security.
[0020] In one embodiment, adding the corresponding DAG level according to the preset perturbation rule and adding the unidirectional edge corresponding to the virtual node includes:
[0021] Add each virtual node to a randomly selected DAG level;
[0022] Add unidirectional edges within the same DAG level and across DAG levels for virtual nodes that have been added to the DAG level.
[0023] Through this perturbation rule, virtual nodes can be used to form virtual paths in the hierarchical DAG to disrupt the original intuitive path relationship of the hierarchical DAG structure, enhance the defense level against external attackers, and improve the security based on order-preserving encryption.
[0024] In one embodiment, before adding a unidirectional edge between each DAG node in the DAG level corresponding to the jth dimension and each DAG node satisfying an association relationship with the DAG node in the DAG level corresponding to the j+1th dimension, the method further includes:
[0025] For each DAG node in the DAG level corresponding to the j-th dimension, determine whether the sub-data corresponding to the DAG node and the sub-data corresponding to each DAG node in the DAG level of the j+1-th dimension exist in the same multi-dimensional data;
[0026] If so, it is determined that the DAG node in the jth dimension and the DAG node in the j+1th dimension satisfy an association relationship.
[0027] Through this measure, for sub-data of multiple dimensions belonging to the same multi-dimensional data, it can be determined that there is an association relationship between the DAG nodes corresponding to the sub-data of the two previous and next DAG levels.
[0028] In one embodiment, each DAG node records the out-degree and the in-degree, and the method further includes:
[0029] If not, determine the relevant parameters of the two according to the number of out-degrees of the DAG node in the jth dimension and the number of in-degrees of the DAG node in the j+1th dimension;
[0030] Determine frequency parameters of both according to the number of visits to the DAG node in the jth dimension and the number of visits to the DAG node in the j+1th dimension;
[0031] Determine a weight coefficient according to the relevant parameters and the frequency parameter, and determine whether the weight coefficient reaches a preset weight threshold;
[0032] If the weight coefficient reaches the weight threshold, it is determined that the DAG node in the j-th dimension satisfies the association relationship with the DAG node in the j+1-th dimension.
[0033] Through this measure, for DAG nodes at two adjacent DAG levels, if the sub-data in the two DAG nodes do not exist in the same multidimensional data, their potential correlation can be fully explored to determine whether the association relationship is satisfied.
[0034] In one embodiment, the method further comprises:
[0035] In response to a query instruction for the hierarchical DAG, the query instruction is parsed to obtain conditional data of a plurality of target query levels, and the conditional data of each target query level is converted into a corresponding order-preserving encrypted value as a target data range of the target query level; wherein the query instruction includes a plurality of target output levels;
[0036] If the query instruction is a union query, traverse each DAG node of each target query level of the hierarchical DAG, and if the order-preserving encrypted value of any DAG node of any target query level is within the target data range of the target query level, add the DAG node to the temporary result set;
[0037] Determine the DAG nodes of the target output levels of the link where each DAG node in the temporary result set is located as the query result; wherein the link where the DAG node is located is determined according to the one-way edges across the levels passing through the DAG node.
[0038] Through the above measures, the union query process of hierarchical DAG can be completed. Due to the orderliness of the hierarchical DAG structure and the logic across DAG levels, the query efficiency of equality, range and comparison queries is significantly reduced, reducing the query overhead in traditional encryption methods.
[0039] In one embodiment, the method further comprises:
[0040] If the query instruction is an intersection query, traverse each DAG node of each target query level of the hierarchical DAG, and if the order-preserving encrypted value of any DAG node of any target query level is within the target data range of the target query level, add the DAG node to the temporary result set corresponding to the target query level;
[0041] From the temporary result sets corresponding to all target query levels, DAG nodes in the same link are screened out, thereby obtaining several target links; wherein the DAG nodes of each target link in each target query level are in the temporary result set of the target query level;
[0042] Determine the DAG nodes of the target link at the target output levels as the query result.
[0043] Through the above measures, the intersection query process of hierarchical DAG can be completed. Due to the orderliness of the hierarchical DAG structure and the logic across DAG levels, the query efficiency of equality, range and comparison queries is significantly reduced, reducing the query overhead in traditional encryption methods.
[0044] In one embodiment, the method further comprises:
[0045] The symmetric encryption value of each DAG node in the query result is decrypted with the key of the symmetric encryption algorithm to obtain the plaintext data of each DAG node.
[0046] Through this measure, plain text data can be returned to the source of the query instruction, making it easier for the querying party to read and use it.
[0047] In one embodiment, each DAG node records the out-degree and the in-degree, and the method further includes:
[0048] In response to an update instruction for the hierarchical DAG, obtaining, by querying, a link to be updated corresponding to the data to be updated in the update instruction in the hierarchical DAG;
[0049] Determine, from the to-be-updated link, the to-be-updated DAG node corresponding to the to-be-updated sub-data of the to-be-updated data;
[0050] Determine whether the number of in-degrees across DAG levels in the DAG node to be updated is greater than one; if not, calculate the order-preserving encryption value and the symmetric encryption value of the sub-data to be updated, and update the order-preserving encryption value and the symmetric encryption value of the sub-data to be updated to the DAG node to be updated.
[0051] Through this measure, when processing an update instruction, if any DAG node to be updated is only on a link to be updated, the DAG node to be updated can be directly updated.
[0052] In one embodiment, the method further comprises:
[0053] If the number of in-degrees across DAG levels in the DAG node to be updated is greater than one, construct a new DAG node for the sub-data to be updated, and add the new DAG node to the DAG level where the DAG node to be updated is located;
[0054] Based on the newly added DAG node, the unidirectional edges at the same DAG level and across DAG levels in the hierarchical DAG are adjusted accordingly.
[0055] Through this measure, the update process can be completed when any DAG node to be updated is located in a link other than the link to be updated.
[0056] In one embodiment, the method further comprises:
[0057] In the case of adding the newly added DAG node to the hierarchical DAG, determining the number of virtual nodes according to a preset disturbance ratio and the total number of original DAG nodes in m dimensions;
[0058] The virtual nodes indicated by the virtual node quantity are added to the corresponding DAG level according to the preset perturbation rule, and the unidirectional edges corresponding to the virtual nodes are added.
[0059] Through this measure, after adding DAG nodes to the hierarchical DAG, the real logical order and dependency relationship of the multidimensional data corresponding to the hierarchical DAG can be further hidden by adding virtual nodes and path perturbations, thus achieving stateless frequency hiding.
[0060] In one embodiment, each DAG node records the out-degree and the in-degree, and the method further includes:
[0061] In response to a deletion instruction for the hierarchical DAG, obtaining, by querying, a link to be deleted corresponding to the data to be deleted in the deletion instruction in the hierarchical DAG;
[0062] Selecting the DAG nodes in the link to be deleted as designated DAG nodes in descending order of DAG levels;
[0063] Determine whether the specified DAG node satisfies a deletion condition; wherein the deletion condition is: the number of out-degrees across DAG levels in the specified DAG node is one or zero, and the number of adjusted in-degrees across DAG levels in the specified DAG node is zero;
[0064] If any specified DAG node does not meet the deletion conditions, the specified DAG node is retained;
[0065] If any specified DAG node meets the deletion condition, the specified DAG node is isolated and then deleted.
[0066] Through the above measures, the data deletion process can be effectively implemented under the premise of ensuring that the integrity of the hierarchical DAG structure is not affected, avoiding the destruction of the original node dependency due to the deletion operation. In addition, isolating the specified DAG node before deleting it can effectively release system resources and reduce the storage space occupied by redundant data. When deleting a specified DAG node, you can first perform logical deletion and then physical deletion. The strategy of combining logical deletion and physical deletion is adopted to ensure the integrity and traceability of the DAG structure, effectively reduce redundant data, improve system resource utilization, and simplify the complexity of data deletion operations.
[0067] On the other hand, the present application provides an electronic device, the electronic device comprising:
[0068] processor;
[0069] a memory for storing processor-executable instructions;
[0070] Wherein, the processor is configured to execute the above-mentioned DAG-based order-preserving encryption method.
[0071] Furthermore, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program can be executed by a processor to complete the above-mentioned DAG-based order-preserving encryption method.
[0072] In addition, the present application provides a computer program product, including a computer program / instruction, which implements the above-mentioned DAG-based order-preserving encryption method when executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings required for use in the embodiments of the present application are briefly introduced below.
[0074] Figure 1 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;
[0075] Figure 2 A schematic diagram of the structure of a directed acyclic graph provided in one embodiment of the present application;
[0076] Figure 3 A flowchart of a DAG-based order-preserving encryption method provided in an embodiment of the present application;
[0077] Figure 4 A schematic diagram of the structure of a hierarchical directed acyclic graph provided in one embodiment of the present application;
[0078] Figure 5 A schematic flow chart of a method for reprocessing a layered directed acyclic graph provided in one embodiment of the present application;
[0079] Figure 6 A flowchart of a method for determining an association relationship provided in an embodiment of the present application;
[0080] Figure 7 A flowchart of a method for determining an association relationship provided in another embodiment of the present application;
[0081] Figure 8 A flowchart of a DAG-based query method provided in one embodiment of the present application;
[0082] Fig. 9 A flowchart of a DAG-based query method provided in another embodiment of the present application;
[0083] Fig.10 A flowchart of a DAG-based data update method provided in one embodiment of the present application;
[0084] Fig.11 A flowchart of a DAG-based data update method provided in another embodiment of the present application;
[0085] Fig.12 A flowchart of a DAG-based data deletion method provided in an embodiment of the present application;
[0086] Fig.13 A schematic diagram of the overall process of a DAG-based order-preserving encryption method provided in an embodiment of the present application;
[0087] Fig.14 A schematic diagram of the structure of a hierarchical DAG provided in an embodiment of the present application;
[0088] Fig.15 A schematic diagram of the structure of a hierarchical DAG provided in another embodiment of the present application;
[0089] Fig.16 A schematic diagram of a link to be updated provided in an embodiment of the present application;
[0090] Fig.17 A schematic diagram of a link to be deleted provided in an embodiment of the present application;
[0091] Fig.18 A block diagram of a DAG-based order-preserving encryption device provided in accordance with an embodiment of the present application. DETAILED DESCRIPTION
[0092] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0093] Similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0094] like Figure 1 As shown, this embodiment provides an electronic device 1, including: at least one processor 11 and a memory 12, Figure 1 A processor 11 is taken as an example. The processor 11 and the memory 12 are connected via a bus 10. The memory 12 stores instructions that can be executed by the processor 11. The instructions are executed by the processor 11 so that the electronic device 1 can execute all or part of the process of the method in the following embodiment. In one embodiment, the electronic device 1 can be a server, a server cluster or a cloud computing center, which is used to execute the DAG-based order-preserving encryption method.
[0095] The memory 12 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.
[0096] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by the processor 11 to complete the DAG-based order-preserving encryption method provided by the present application.
[0097] The present application also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the DAG-based order-preserving encryption method provided by the present application.
[0098] A directed acyclic graph (DAG) is a special type of graph data structure that consists of a set of nodes and a set of directed edges, and there is no path in the graph that starts from a node and returns to the node through several edges. This means that all edges are unidirectional and there are no closed loops in the DAG. Figure 2 , which is a schematic diagram of the structure of a directed acyclic graph provided in an embodiment of the present application, such as Figure 2 As shown, the circles numbered 1 to 8 represent nodes, there are unidirectional edges between some nodes, and there is no closed loop consisting of several edges in the directed acyclic graph.
[0099] Directed acyclic graphs have the following key features: First, acyclicity: No path in a DAG forms a cycle, which means that in a DAG, the dependencies between all data or nodes are ordered and irreversible. Second, topological sorting: Since DAG is acyclic, it can be topologically sorted, that is, all nodes are linearly sorted so that each unidirectional edge points from the previous node to the next node, thereby describing the data dependency through DAG. Third, efficient computing: In DAG, some computing is believed to be efficiently scheduled through topological sorting, avoiding the complexity brought by traditional cyclic dependencies.
[0100] See also Figure 3 , is a flowchart of a DAG-based order-preserving encryption method provided in an embodiment of the present application, such as Figure 3 As shown, the method may include the following steps 310 to 340.
[0101] Step 310: For each multidimensional data in the multidimensional data set, construct a DAG node at the DAG level corresponding to the i-th dimension for the sub-data in the i-th dimension of the multidimensional data; wherein the order-preserving encryption value and the symmetric encryption value of the sub-data are written into the DAG node; the value range of i is 1 to m, and m is the total number of dimensions of the multidimensional data.
[0102] The multidimensional dataset includes multiple multidimensional data, each of which includes sub-data of m dimensions. For example, the multidimensional dataset is a set of personal information of enterprise employees, each of which is the personal information of a single employee, and the sub-data may include the employee's name, gender, age, salary, work area, etc. Alternatively, the multidimensional dataset may be a set of commodity information in a supermarket, each of which is a commodity information, and the sub-data may include the commodity name, major category, minor category, price, origin, etc.
[0103] When building a hierarchical DAG for a multidimensional data set, each dimension corresponds to a DAG level, and multidimensional data with m dimensions requires m levels of hierarchical DAG to store. The order of each dimension in the multidimensional data can be configured as needed, or the order of the sub-data of each dimension contained in it can be selected as the order of the dimension.
[0104] Each DAG node can include a unique identifier (nodeID), an order-preserving encryption value, a symmetric encryption value, and edge information (edges) connected to other DAG nodes. Unique identifiers at the same level can be partially the same (for example, nodeID consists of two parts, the first part represents the DAG level, and the second part represents the node itself. In this case, the first part of the unique identifier of DAG nodes at the same level can be the same), which is convenient for identifying DAG nodes at the same level.
[0105] The edge information between any DAG node and other DAG nodes is represented by in-degree (inEdges) and out-degree (out Edges). The in-degree records the unique identifiers of other DAG nodes pointing to the current DAG node; the out-degree records the unique identifiers of the DAG nodes pointed to by the unidirectional edges starting from the current DAG node.
[0106] For any piece of multidimensional data, an order-preserving encryption value can be calculated for the sub-data of the multidimensional data in the i-th dimension by a preset order-preserving encryption algorithm, and a symmetric encryption value can be calculated for the sub-data of the multidimensional data in the i-th dimension by a preset symmetric encryption algorithm. Among them, the symmetric encryption algorithm can be selected as needed. Exemplarily, the symmetric encryption algorithm can be any one of the algorithms such as AES (Advanced Encryption Standard) and DES (Data Encryption Standard). The unique identifier of the DAG node is assigned to the sub-data of the multidimensional data in the i-th dimension, and then the DAG node corresponding to the sub-data of the i-th dimension can be constructed, and the DAG node is written with the assigned unique identifier, the symmetric encryption value of the sub-data of the i-th dimension, and the order-preserving encryption value.
[0107] By constructing DAG nodes for each sub-data in m dimensions of a multi-dimensional data, all DAG nodes of the multi-dimensional data in m DAG levels can be obtained.
[0108] By constructing a DAG node for each piece of multidimensional data, the nodes of all multidimensional data in the multidimensional data set at each DAG level can be obtained.
[0109] If different multidimensional data have the same sub-data in the same dimension, a unique DAG node can be constructed only for the same sub-data in the dimension. For example, if the multidimensional data is the personal information of a single employee, where the gender is divided into "male" and "female", then the DAG level corresponding to the gender only constructs one DAG node corresponding to "male" and one DAG node corresponding to "female", without having to construct multiple DAG nodes for "male" in multiple pieces of personal information. This measure can significantly reduce the number of DAG nodes and save storage space.
[0110] Step 320: For the DAG level corresponding to the i-th dimension, based on the size relationship of the order-preserving encrypted values of the DAG nodes at the DAG level, add unidirectional edges between the DAG nodes at the DAG level.
[0111] The multiple DAG nodes constructed by step 310 have not yet added unidirectional edges. In this case, for the DAG level corresponding to the i-th dimension, the multiple DAG nodes can be sorted in ascending order or descending order according to the order-preserving encryption values of the multiple DAG nodes of the DAG level. After sorting, a unidirectional edge pointing to the next DAG node can be added to the previous DAG node. In other words, the unique identifier of the next DAG node is recorded in the out-degree of the previous DAG node, and the unique identifier of the previous DAG node is recorded in the in-degree of the next DAG node.
[0112] Through this measure, unidirectional edges of the same DAG level can be added to several DAG nodes of each DAG level.
[0113] Step 330: For each DAG node in the DAG level corresponding to the jth dimension, add a unidirectional edge between the DAG node and each DAG node in the DAG level corresponding to the j+1th dimension that satisfies the association relationship; wherein the value range of j is 1 to m-1.
[0114] Starting from the first DAG level, traverse each DAG node to determine whether the DAG node satisfies the association relationship with each DAG node of the next level. If the association relationship is satisfied, add a unidirectional edge from the DAG node of the current DAG level to the DAG node of the next DAG level. When adding a cross-level unidirectional edge, the unique identifier of the DAG node of the next DAG level is recorded in the out-degree of the DAG node of the current DAG level; the unique identifier of the DAG node of the current DAG level is recorded in the in-degree of the DAG node of the next DAG level.
[0115] After adding the unidirectional edge from the 1st DAG level to the 2nd DAG level, the unidirectional edge from the 2nd DAG level to the 3rd DAG level, the unidirectional edge from the 3rd DAG level to the 4th DAG level, ... the unidirectional edge from the m-2th DAG level to the m-1th DAG level, and the unidirectional edge from the m-1th DAG level to the mth DAG level, the task of adding unidirectional edges across DAG levels in the hierarchical DAG is completed.
[0116] The unidirectional edges across DAG levels represent the association and dependency between sub-data of different dimensions.
[0117] Step 340: construct a hierarchical DAG according to the multiple DAG nodes of the m dimension and the multiple unidirectional edges that have been added.
[0118] After adding all unidirectional edges that can be added to all DAG nodes in m dimensions, we obtain the hierarchical DAG built for the multidimensional dataset.
[0119] See also Figure 4 , which is a schematic diagram of the structure of a hierarchical directed acyclic graph provided in an embodiment of the present application, such as Figure 4 As shown, the hierarchical DAG includes 4 levels (L1, L2, L3, L4), each level corresponds to a dimension of multidimensional data, and each level includes multiple DAG nodes. In the same DAG level, the previous DAG node is provided with a unidirectional edge pointing to the next DAG node. The DAG node of the L1 level is provided with a unidirectional edge pointing to the DAG node of the L2 level; the DAG node of the L2 level is provided with a unidirectional edge pointing to the DAG node of the L3 level; the DAG node of the L3 level is provided with a unidirectional edge pointing to the DAG node of the L4 level.
[0120] Through the above measures, this scheme can perform logical and ordered encryption operations for multidimensional data, thereby clearly reflecting the logical order and dependency relationship between data of each dimension through the hierarchical DAG structure, which is helpful for the query and management of multidimensional data after order-preserving encryption.
[0121] The order-preserving encrypted storage method of this solution is compatible with column-based databases and non-relational databases, achieving seamless integration without large-scale transformation and reducing system implementation costs.
[0122] In one embodiment, when executing step 310, when calculating the order-preserving encryption value for the sub-data in the i-th dimension of the multidimensional data, if the sub-data is a numerical value, the sub-data in the i-th dimension of the multidimensional data can be converted into the initial encryption value of the encryption range corresponding to the i-th dimension. Here, each dimension is pre-configured with a corresponding encryption range. Preferably, the encryption range corresponding to each dimension is larger than the actual range of the sub-data of the dimension, thereby ensuring that the sub-data has sufficient spatial distribution after mapping. Exemplarily, the actual range of the sub-data of the age dimension may be [0,100], while the encryption range is [1000,10000].
[0123] Furthermore, a random offset may be added to the initial encrypted value. Here, the random offset selected in each order-preserving encryption process is different, and the value range of the random offset may be 1% to 5% of the maximum value of the encryption range. In addition, the order-preserving encryption process is a high-precision floating-point operation or a fixed-point operation.
[0124] For example, if the sub-data is a numerical value, the order-preserving encryption algorithm is expressed by the following formula (1):
[0125]
[0126] Among them, y is the order-preserving encryption value; min i is the minimum value of the encryption range of the i-th dimension; max i is the maximum value of the encryption range of the i-th dimension; x is the sub-data of the i-th dimension; x min is the minimum value of the actual range of the sub-data of the i-th dimension; x max is the maximum value of the actual range of the sub-data in the i-th dimension.
[0127] In addition, if the sub-data is not a numerical value (for example, the sub-data is a name), a hash value is calculated for the sub-data, and the hash value is converted into an initial encrypted value of the encryption range corresponding to the i-th dimension. Here, the encryption range corresponding to each dimension may be smaller than the actual range of the hash value.
[0128] Furthermore, a random offset may be added to the initial encrypted value. Here, the random offset selected in each order-preserving encryption process is different, and the value range of the random offset may be 1% to 5% of the maximum value of the encryption range. In addition, the order-preserving encryption process is a high-precision floating-point operation or a fixed-point operation.
[0129] For example, if the sub-data is not a numerical value, the order-preserving encryption algorithm can be expressed by the following formula (2):
[0130]
[0131] Among them, y is the order-preserving encryption value; min iis the minimum value of the encryption range of the i-th dimension; max i is the maximum value of the encryption range of the i-th dimension; x is the sub-data of the i-th dimension; h(x) is the hash value of the sub-data; min is the minimum value of the actual range of the hash value; max is the maximum value of the actual range of the hash value. For example, if the hash algorithm is SHA-256, min is 0 and max is 2 256 -1.
[0132] Through this measure, the sub-data is mapped to a sufficiently large space by presetting the encryption range, adding a random offset in the confidentiality process, and improving the accuracy of the mapping step through high-precision floating-point operations or fixed-point operations. This can prevent different sub-data from obtaining the same order-preserving encryption value (that is, data collision) after order-preserving encryption, prevent attackers from inferring the original data distribution through frequency analysis, and further improve the resistance to frequency analysis attacks and the encryption security of the order-preserving encryption value.
[0133] In one embodiment, see Figure 5 , is a flow chart of a method for reprocessing a layered directed acyclic graph provided by an embodiment of the present application. Figure 5 As shown, after obtaining multiple DAG nodes and multiple unidirectional edges of m dimensions, the security of the hierarchical DAG can be improved through the following steps 510 to 520.
[0134] Step 510: Determine the number of virtual nodes according to the preset disturbance ratio and the total number of original DAG nodes in m dimensions.
[0135] The disturbance ratio is configured as required. For example, the disturbance ratio may be 10%, 15%, 20%, etc.
[0136] The original DAG node is a DAG node constructed for the sub-data of the multidimensional data.
[0137] Exemplarily, the number of virtual nodes can be determined by the following formula (3):
[0138]
[0139] Among them, N virtual is the number of virtual nodes; N is the total number of original DAG nodes; P d is the disturbance ratio.
[0140] Step 520: Add the virtual nodes indicated by the number of virtual nodes to the corresponding DAG level according to the preset perturbation rule, and add the unidirectional edges corresponding to the virtual nodes.
[0141] Here, the perturbation rule is a rule for performing path perturbation on the hierarchical DAG.
[0142] After obtaining the number of virtual nodes, virtual nodes indicated by the number of virtual nodes can be generated, and these virtual nodes can be added to the corresponding DAG level according to the perturbation rules, and unidirectional edges can be added to the virtual nodes added to the DAG level. These unidirectional edges can be unidirectional edges from other DAG nodes to virtual nodes and / or unidirectional edges from virtual nodes to other DAG nodes.
[0143] Among them, the unique identifier in the virtual node can be assigned after it is added to the DAG level, and random numbers can be used as order-preserving encryption values and symmetric encryption values in the virtual node.
[0144] Through this measure, by adding virtual nodes and adding unidirectional edges to the virtual nodes, the path of the hierarchical DAG can be perturbed, and the real logical order and dependency relationship of the multidimensional data corresponding to the hierarchical DAG can be further hidden, which effectively prevents the leakage of frequency information, improves the defense capability against structural analysis attacks, and enhances data security.
[0145] In one embodiment, when executing step 520 , a DAG level may be randomly selected for each virtual node, and the virtual node may be added to the randomly selected DAG level.
[0146] Furthermore, one-way edges of the same DAG level and across DAG levels can be added for virtual nodes that have been added to the DAG level. Virtual nodes can be randomly inserted into other DAG nodes of the selected DAG level, and then one-way edges between the virtual node and other DAG nodes of the same DAG level are added according to the arrangement order of the virtual node and other DAG nodes of the same DAG level.
[0147] In addition, a unidirectional edge between the virtual node and other DAG nodes of the previous DAG level can be added, or a unidirectional edge between the virtual node and other DAG nodes of the next DAG level can be added, or a unidirectional edge between the virtual node and other DAG nodes of the previous DAG level and other DAG nodes of the next DAG level can be added. Here, the number of unidirectional edges added across DAG levels can be configured as needed.
[0148] Through this perturbation rule, virtual nodes can be used to form virtual paths in the hierarchical DAG to disrupt the original intuitive path relationship of the hierarchical DAG structure, enhance the defense level against external attackers, and improve the security based on order-preserving encryption.
[0149] In one embodiment, see Figure 6 , is a flow chart of a method for determining an association relationship provided in an embodiment of the present application, such as Figure 6 As shown, the method may include the following steps 610 to 620.
[0150] Step 610: For each DAG node in the DAG level corresponding to the j-th dimension, determine whether the sub-data corresponding to the DAG node and the sub-data corresponding to each DAG node in the DAG level of the j+1-th dimension exist in the same multi-dimensional data.
[0151] Starting from 1, traverse layer by layer to determine whether the sub-data in each DAG node corresponding to the j-th dimension and the sub-data in each DAG node corresponding to the j+1-th dimension exist in the same multidimensional data.
[0152] Step 620: If yes, determine that the DAG node in the j-th dimension satisfies the association relationship with the DAG node in the j+1-th dimension.
[0153] On the one hand, if the sub-data in any DAG node of the jth dimension and the sub-data in any DAG node of the j+1th dimension are in the same multidimensional data, it can be determined that the DAG node of the jth dimension and the DAG node of the j+1th dimension satisfy the association relationship. In this case, a unidirectional edge across the DAG level can be added to these two DAG nodes later.
[0154] On the other hand, if the sub-data in any DAG node of the j-th dimension and the sub-data in any DAG node of the j+1-th dimension are not in the same multi-dimensional data, further judgment is required to determine whether the two are associated, as described below.
[0155] Through this measure, for sub-data of multiple dimensions belonging to the same multi-dimensional data, it can be determined that there is an association relationship between the DAG nodes corresponding to the sub-data of the two previous and next DAG levels.
[0156] In one embodiment, see Figure 7 , is a flow chart of a method for determining an association relationship provided in another embodiment of the present application, such as Figure 7 As shown, the method may include the following steps 630 to 660.
[0157] Step 630: If not, determine the relevant parameters of the two according to the number of out-degrees of the DAG node in the j-th dimension and the number of in-degrees of the DAG node in the j+1-th dimension.
[0158] When the sub-data corresponding to any DAG node in the jth dimension and the sub-data corresponding to any DAG node in the j+1th dimension are not in the same multi-dimensional data, the relevant parameters between the two DAG nodes can be calculated. For example, the calculation method of the relevant parameters can be expressed by the following formula (4):
[0159]
[0160] Among them, Correlation j,j+1 is the relevant parameter between two DAG nodes; γ and δ represent two weights, the sum of which is 1. The size of the two weights can be configured as needed. For example, if the out-degree is as important as the in-degree, both weights can be set to 0.5; D out (j) represents the number of out-degrees of the DAG node in the jth dimension; D in (j+1) represents the number of in-degrees of the DAG node in the j+1th dimension.
[0161] Here, the number of out-degrees of the DAG nodes in the j-th dimension and the number of in-degrees of the DAG nodes in the j+1-th dimension are both the number of out-degrees and the number of in-degrees corresponding to the unidirectional edges added according to the association relationship determined in the aforementioned steps 610 to 620. In other words, after executing steps 610 to 620, the DAG nodes that satisfy the association relationship in the adjacent DAG levels can be determined, and then the unidirectional edges can be added, and the process of steps 630 to 660 can be continued based on this to further explore the association relationship between the DAG nodes across the DAG levels.
[0162] In addition, to ensure that the relevant parameters are between 0 and 1, the relevant parameters may be normalized. Exemplarily, the normalization may be performed using the following formula (5):
[0163]
[0164] Among them, Corrleation j,j+1 Correlation is the normalized correlation parameter between two DAG nodes; j,j+1 Correlation is the correlation parameter between two DAG nodes; max Correlation is the maximum value of the correlation parameters of all DAG node pairs at adjacent DAG levels; min It is the minimum value of the relevant parameters of all pairs of DAG nodes at adjacent DAG levels.
[0165] Step 640: Determine frequency parameters of both according to the number of visits to the DAG node in the j-th dimension and the number of visits to the DAG node in the j+1-th dimension.
[0166] Here, the access count of the DAG node is updated after the hierarchical DAG is built. When the hierarchical DAG is built, the access count of all DAG nodes is 0.
[0167] First, the number of visits to each DAG node can be normalized. Exemplarily, the normalization is performed using the following formula (6):
[0168]
[0169] Where F′ is the normalized number of visits; F is the number of visits; F max is the maximum number of visits to all DAG nodes; F min It is the minimum number of visits to all DAG nodes.
[0170] Exemplarily, the frequency parameter between two nodes may be determined by the following formula (7):
[0171]
[0172] Among them, Frequency j,j+1 represents the frequency parameter between the DAG node in the jth dimension and the DAG node in the j+1th dimension; is the adjustment coefficient, which takes a value between 0 and 1 and is used to control the degree of assignment of potential access frequency. If the potential access frequency of two DAG nodes needs to be increased, the adjustment coefficient can be set to a larger value (for example, above 0.5); if the potential access frequency of two DAG nodes needs to be reduced, the adjustment coefficient can be set to a smaller value (for example, 0.1 or 0.2); F′ j represents the normalized number of visits to the DAG node in the jth dimension; F′ j+1 Indicates the normalized number of visits to the DAG node in the j+1th dimension.
[0173] Step 650: Determine a weight coefficient according to the relevant parameters and the frequency parameters, and determine whether the weight coefficient reaches a preset weight threshold.
[0174] Step 660: If the weight coefficient reaches the weight threshold, determine whether the DAG node in the j-th dimension satisfies the association relationship with the DAG node in the j+1-th dimension.
[0175] The weight threshold is used to filter the DAG node pairs with associated relationships, and the weight threshold can be configured as needed. For example, the weight threshold can be any value among 0.5, 0.55, and 0.6.
[0176] The weight coefficient is obtained by weighting the relevant parameters and the frequency parameters. For example, the calculation process can be expressed by the following formula (8):
[0177] W j,j+1 =α·Correlation' j,j+1 +β·Frequency j,j+1 (8)
[0178] Among them, W j,j+1Represents the weight coefficient between the DAG node in the jth dimension and the DAG node in the j+1th dimension; Correlation′ j,j+1 It is the normalized correlation parameter between two DAG nodes; Frequency j,j+1 Represents the frequency parameter between the DAG node in the j-th dimension and the DAG node in the j+1-th dimension; α and β are two weights, the sum of the two weights is 1, and the two weights can be configured as needed. Exemplarily, the relevant parameters are more important in this solution, then α is 0.7 and β is 0.3.
[0179] After calculating the weight coefficient, it can be determined whether the weight coefficient reaches the weight threshold. On the one hand, if the weight coefficient does not reach the weight threshold, it can be determined that there is no association relationship between the two DAG nodes; on the other hand, if the weight coefficient reaches the weight threshold, it can be determined that the DAG node in the jth dimension and the DAG node in the j+1th dimension meet the association relationship.
[0180] Through this measure, for DAG nodes at two adjacent DAG levels, if the sub-data in the two DAG nodes do not exist in the same multidimensional data, their potential correlation can be fully explored to determine whether the association relationship is satisfied.
[0181] In one embodiment, see Figure 8 , is a flowchart of a DAG-based query method provided in an embodiment of the present application, such as Figure 8 As shown, the method may include the following steps 810 to 830.
[0182] Step 810: Respond to a query instruction for a hierarchical DAG, parse out conditional data of several target query levels from the query instruction, and convert the conditional data of each target query level into a corresponding order-preserving encryption value as the target data range of the target query level; wherein the query instruction includes several target output levels.
[0183] The query instruction is used to instruct the query of data in the hierarchical DAG. The query instruction includes conditional data of several target query levels and several target output levels. Here, the target query level is the DAG level where the conditional data used as the query condition is located. The target output level is the DAG level where the query results need to be output. Exemplarily, the hierarchical DAG stores personal information of corporate employees. When querying, the salary of relevant employees is searched by the work area "Hangzhou" and the gender "female". The target query level is the DAG level corresponding to "work area" and "gender", "Hangzhou" and "female" are conditional data, and the target output level is the DAG level corresponding to "salary".
[0184] After obtaining the query instruction, the conditional data of several target query levels are parsed from the query instruction, and the conditional data are encrypted in an order-preserving manner using the order-preserving encryption algorithm corresponding to each target query level, thereby obtaining the order-preserving encryption value corresponding to the conditional data, and the order-preserving encryption value is used as the target data range of the target query level.
[0185] Through this measure, the conditional data is converted into an order-preserving encrypted value to be compared with the order-preserving encrypted value of the corresponding DAG level in the hierarchical DAG, so as to effectively retrieve the DAG nodes that meet the target data range.
[0186] Step 820: If the query instruction is a union query, traverse each DAG node of each target query level of the hierarchical DAG. If the order-preserving encrypted value of any DAG node of any target query level is within the target data range of the target query level, add the DAG node to the temporary result set.
[0187] The query type corresponding to the query instruction may be a union query or an intersection query. A union query is to find query results based on the condition data of multiple target query levels respectively, and use the union of the multiple query results as the final query result. An intersection query is to use the condition data of multiple target query levels as a whole query condition to find the final query result.
[0188] When the query instruction is an intersection query, the query process from step 840 to step 860 may be executed, as described below.
[0189] When the query instruction is a union query, for each target query level, each DAG node of the target query level can be traversed to determine whether the order-preserving encryption value of each DAG node is within the target data range of the target query level. On the one hand, if not, the DAG node can be ignored. On the other hand, if yes, the DAG nodes whose order-preserving encryption values are within the target data range can be added to the temporary result set.
[0190] After traversing all target query levels, eligible DAG nodes in all target query levels may be added to a temporary result set.
[0191] Step 830: Determine the DAG nodes in the target output levels of the links of each DAG node in the temporary result set as the query result; wherein the links of the DAG nodes are determined according to the multiple cross-level unidirectional edges passing through the DAG nodes.
[0192] It should be noted that in this solution, the link includes DAG nodes of multiple DAG levels, and the link has a unique DAG node at each DAG level, and there are unidirectional edges between DAG nodes of adjacent DAG levels in the link. Figure 4For example, N1-M1-D1-S1 constitutes a link; N2-M3-D4-S4 constitutes a link; and N1, M2, D1, S3 do not constitute a link.
[0193] After obtaining the temporary result set, based on each DAG node in the temporary result set, the link where the DAG node is located can be searched in the hierarchical DAG, so that the DAG node of each link at each target output level is used as the query result.
[0194] Through the above measures, the union query process of hierarchical DAG can be completed. Due to the orderliness of the hierarchical DAG structure and the logic across DAG levels, the query efficiency of equality, range and comparison queries is significantly reduced, reducing the query overhead in traditional encryption methods.
[0195] In one embodiment, see Fig. 9 , is a flowchart of a DAG-based query method provided by another embodiment of the present application, such as Fig. 9 As shown, when the query instruction is an intersection query, the query process from step 840 to step 860 can be executed.
[0196] Step 840: If the query instruction is an intersection query, traverse each DAG node of each target query level of the hierarchical DAG. If the order-preserving encrypted value of any DAG node of any target query level is within the target data range of the target query level, add the DAG node to the temporary result set corresponding to the target query level.
[0197] When the query instruction is a union query, for each target query level, each DAG node of the target query level can be traversed to determine whether the order-preserving encryption value of each DAG node is within the target data range of the target query level. On the one hand, if not, the DAG node can be ignored. On the other hand, if yes, the DAG nodes whose order-preserving encryption values are within the target data range can be added to the temporary result set.
[0198] After traversing all target query levels, eligible DAG nodes in all target query levels may be added to a temporary result set.
[0199] Step 850: Filter out DAG nodes in the same link from the temporary result sets corresponding to all target query levels, thereby obtaining several target links; wherein the DAG nodes of each target link in each target query level are in the temporary result set of the target query level.
[0200] After obtaining the temporary result set, the DAG nodes in the same link can be filtered out from the temporary result set to obtain several target links. In this process, for each link in the hierarchical DAG, it can be determined at each target query level whether the DAG node of the link at the target query level is in the temporary result set, thereby effectively filtering out the target link.
[0201] Step 860: Determine the DAG nodes of the target link at several target output levels as the query result.
[0202] After obtaining a number of target links, the DAG node of each target link at each target output level may be selected as a query result.
[0203] Through the above measures, the intersection query process of hierarchical DAG can be completed. Due to the orderliness of the hierarchical DAG structure and the logic across DAG levels, the query efficiency of equality, range and comparison queries is significantly reduced, reducing the query overhead in traditional encryption methods.
[0204] In one embodiment, after obtaining the query result from the hierarchical DAG in response to the query instruction, the symmetric encryption value of each DAG node in the query result may be decrypted using the key of the symmetric encryption algorithm to obtain the plaintext data of each DAG node.
[0205] In this case, plain text data can be returned to the source of the query instruction to facilitate reading and use by the querying party.
[0206] In one embodiment, see Fig.10 , is a flow chart of a DAG-based data updating method provided in an embodiment of the present application, such as Fig.10 As shown, the method may include the following steps 1010 to 1030.
[0207] Step 1010: In response to an update instruction for the hierarchical DAG, obtain, by querying, the link to be updated corresponding to the data to be updated in the update instruction in the hierarchical DAG.
[0208] The update instruction is used to instruct to update the data in the hierarchical DAG, and includes the data to be updated (multi-dimensional data) corresponding to the link to be updated and the sub-data to be updated of several dimensions in the data to be updated.
[0209] After obtaining the update instruction, the data to be updated can be parsed from the update instruction, and the sub-data of the data to be updated in each dimension can be converted into the order-preserving encryption value corresponding to each sub-data, and then the order-preserving encryption value of each dimension can be used to determine the matching DAG node in the corresponding DAG level, so as to determine the link to be updated with the DAG nodes of multiple DAG levels.
[0210] Step 1020: Determine the DAG node to be updated corresponding to the sub-data to be updated of the data to be updated from the link to be updated.
[0211] Based on the dimension corresponding to the sub-data to be updated, a DAG node at the DAG level corresponding to the dimension is determined from the link to be updated as the DAG node to be updated.
[0212] Step 1030: Determine whether the number of in-degrees across DAG levels in the DAG node to be updated is greater than one. If not, calculate the order-preserving encryption value and the symmetric encryption value of the sub-data to be updated, and update the order-preserving encryption value and the symmetric encryption value of the sub-data to be updated to the DAG node to be updated.
[0213] After determining the DAG node to be updated, it can be determined whether the number of in-degrees across DAG levels in the DAG node is greater than one. On the one hand, if not, it can be explained that the DAG node is only on the link to be updated, but not on other links, and updating the DAG node will not affect other links. At this time, the order-preserving encryption value and the symmetric encryption value of the sub-data to be updated are directly converted, and the order-preserving encryption value and the symmetric decryption value are updated to the DAG node to be updated. On the other hand, if yes, the update process from step 1040 to step 1050 can be executed, as described below.
[0214] Through this measure, when processing an update instruction, if any DAG node to be updated is only on a link to be updated, the DAG node to be updated can be directly updated.
[0215] In one embodiment, see Fig.11 , is a flow chart of a DAG-based data updating method provided in another embodiment of the present application, such as Fig.11 As shown, the method may include the following steps 1040 to 1050.
[0216] Step 1040: If the number of in-degrees across DAG levels in the DAG node to be updated is greater than one, construct a new DAG node for the sub-data to be updated, and add the new DAG node to the DAG level where the DAG node to be updated is located.
[0217] When the number of in-degrees across DAG levels in the DAG node to be updated is greater than one, it means that the DAG node to be updated is located on other links besides the link to be updated. In this case, directly updating the DAG node will affect other links (causing data on other links to change). To solve this problem, a new DAG node can be constructed for the sub-data to be updated, and the order-preserving encryption value and symmetric encryption value of the sub-data to be updated can be written into the new DAG node, and the new DAG node can be added to the DAG level where the node to be updated is located.
[0218] Step 1050: Based on the newly added DAG node, the unidirectional edges at the same DAG level and across DAG levels in the hierarchical DAG are adjusted accordingly.
[0219] After adding the newly added DAG node to the DAG level where the DAG node to be updated is located, the unidirectional edges of the newly added DAG node in the same DAG level and across DAG levels can be adjusted accordingly, so that the newly added DAG node is added to the link to be updated, and the original DAG node to be updated is removed from the link to be updated. After the unidirectional edge is adjusted, the in-degree and out-degree of the newly added DAG node, the original DAG node to be updated, and other DAG nodes connected by the adjusted unidirectional edge can be adjusted accordingly.
[0220] Through this measure, the update process can be completed when any DAG node to be updated is located in a link other than the link to be updated.
[0221] In one embodiment, after updating the hierarchical DAG, when adding new DAG nodes to the hierarchical DAG, the number of virtual nodes can be determined according to the preset disturbance ratio and the total number of original DAG nodes in m dimensions. Since the total number of original DAG nodes changes due to the addition of new DAG nodes, the number of virtual nodes may also change. The calculation method of the number of virtual nodes is as described above and will not be repeated here.
[0222] After obtaining the number of virtual nodes, the virtual nodes indicated by the number of virtual nodes can be added to the corresponding DAG level according to the preset perturbation rules, and the unidirectional edges corresponding to the virtual nodes can be added. The specific processing method is as mentioned above and will not be repeated here.
[0223] Through this measure, after adding DAG nodes to the hierarchical DAG, the real logical order and dependency relationship of the multidimensional data corresponding to the hierarchical DAG can be further hidden by adding virtual nodes and path perturbations, thus achieving stateless frequency hiding.
[0224] In one embodiment, see Fig.12 , is a flow chart of a DAG-based data deletion method provided in an embodiment of the present application, such as Fig.12 As shown, the method may include the following steps 1210 to 1250.
[0225] Step 1210: In response to a delete instruction for the hierarchical DAG, obtain, by querying, the link to be deleted corresponding to the data to be deleted in the hierarchical DAG.
[0226] The delete instruction is used to instruct to delete the data in the hierarchical DAG. The delete instruction includes the data to be deleted (multi-dimensional data).
[0227] After obtaining the deletion instruction, the data to be deleted can be parsed from the deletion instruction, and the sub-data of the data to be deleted in each dimension can be converted into the order-preserving encryption value corresponding to each sub-data, and then the order-preserving encryption value of each dimension can be used to determine the matching DAG nodes (with the same order-preserving encryption value) in the corresponding DAG level, and the DAG nodes of multiple DAG levels can be used to determine the link to be deleted.
[0228] Step 1220: Select the DAG nodes in the link to be deleted as designated DAG nodes in descending order of DAG levels.
[0229] The order of DAG levels from high to low is the order in which the one-way edges point to. In this solution, the DAG node corresponding to the level of the jth dimension points to the DAG node corresponding to the level of the j+1th dimension. Therefore, the DAG level corresponding to the 1st dimension is the highest, and the DAG level corresponding to the mth dimension is the lowest.
[0230] After determining the link to be deleted, starting from the DAG level corresponding to the first dimension, the DAG nodes on the link to be deleted in each DAG level can be used as designated DAG nodes in turn, and the deletion process from step 1230 to step 1250 is executed as follows, until the deletion process is completed for the DAG nodes on the link to be deleted in the DAG level corresponding to the mth dimension, and the deletion process is terminated.
[0231] Step 1230: Determine whether the specified DAG node satisfies a deletion condition; wherein the deletion condition is: the number of out-degrees across DAG levels in the specified DAG node is one or zero, and the number of adjusted in-degrees across DAG levels in the specified DAG node is zero.
[0232] For any specified DAG node, it can be determined whether the number of out-degrees across DAG levels in the specified DAG node is 1 (for the specified DAG node of the last DAG level, it can be determined whether the number of out-degrees across DAG levels is 0).
[0233] On the one hand, if not, it means that the designated DAG node does not meet the deletion condition. On the other hand, if yes, it can be further determined whether the number of adjusted in-degrees across DAG levels in the designated DAG node is 0. Here, the number of adjusted in-degrees refers to the number of in-degrees after the number of in-degrees across DAG levels is reduced by one. This is because when determining whether the designated DAG node meets the deletion condition level by level, the designated DAG node of the previous level may meet the deletion condition or may not meet the deletion condition. By adjusting the number of in-degrees across DAG levels of the designated DAG node of the current level, an effective evaluation basis can be obtained to determine whether the designated DAG node of the current level is only on the link to be deleted. For the designated DAG node of the first level, the number of in-degrees across DAG levels is originally zero. Therefore, the number of adjusted in-degrees across DAG levels is equivalent to the number of in-degrees across DAG levels.
[0234] In one case, if yes, it can be indicated that the specified DAG node meets the deletion condition. In another case, if no, it can be indicated that the specified DAG node does not meet the deletion condition.
[0235] Step 1240: If any designated DAG node does not meet the deletion condition, the designated DAG node is retained.
[0236] Step 1250: If any designated DAG node meets the deletion condition, the designated DAG node is isolated and then deleted.
[0237] If any designated DAG node does not meet the deletion condition, it means that the designated DAG node is not only on the link to be deleted, but also on other links. Even if the designated DAG node on the link to be deleted is deleted, the DAG node on other links needs to be retained. In this case, the designated DAG is not deleted and is retained.
[0238] If any specified DAG node meets the deletion condition, it means that the specified DAG node is only on the link to be deleted, but not on other links. In this case, the specified DAG node can be isolated, that is, the two DAG nodes before and after the same DAG level of the specified DAG node skip the specified DAG node to add a unidirectional edge, and then delete the specified DAG node.
[0239] Through the above measures, the data deletion process can be effectively implemented under the premise of ensuring that the integrity of the hierarchical DAG structure is not affected, avoiding the destruction of the original node dependency due to the deletion operation. In addition, isolating the specified DAG node before deleting it can effectively release system resources and reduce the storage space occupied by redundant data. When deleting a specified DAG node, you can first perform logical deletion and then physical deletion. The strategy of combining logical deletion and physical deletion is adopted to ensure the integrity and traceability of the DAG structure, effectively reduce redundant data, improve system resource utilization, and simplify the complexity of data deletion operations.
[0240] To illustrate the order-preserving encryption process based on hierarchical DAG in this solution, see Fig.13 , is a schematic diagram of the overall process of the DAG-based order-preserving encryption method provided in an embodiment of the present application, such as Fig.13 As shown in the figure, by constructing the storage structure of DAG nodes and defining the hierarchical DAG structure, multidimensional data can be encrypted and inserted during the encryption process. This process can calculate the order-preserving encryption value of each dimensional sub-data through an anti-collision encryption algorithm, and establish the dependency relationship between sub-data of different dimensions through cross-layer connections. By adding virtual nodes and path perturbations, external attackers are prevented from inferring actual data or operations through structural analysis.
[0241] Based on the established hierarchical DAG, data can be read from it through query instructions, and the symmetric encrypted values in the queried DAG nodes can be decrypted to return plaintext data.
[0242] Based on the established hierarchical DAG, the data therein can be updated through update instructions, and the update process involves order-preserving encryption calculations.
[0243] Based on the established hierarchical DAG, data therein can be deleted through the delete instruction.
[0244] To more clearly illustrate the entire process of the DAG-based order-preserving encryption algorithm, the following uses a four-dimensional send and receive data as an example to illustrate each link. Here, the four dimensions include sender (Sender), recipient (Recipitent), date (Date) and subject (Subject).
[0245] The data of the cube is as follows:
[0246] data=[
[0247] {"Sender":"alice@example.com", "Recipient":"bob@example.com", "Date": "2021-01-01", "Subject": "Meeting"},
[0248] {"Sender":"alice@example.com","Recipient":"dave@example.com","Date":"2021-02-01","Subject":"Update"},
[0249] {"Sender":"charlie@example.com","Recipient":"bob@example.com","Date":"2021-03-01","Subject":"Report"},
[0250] {"Sender":"charlie@example.com","Recipient":"eve@example.com","Date":"2021-04-01","Subject":"Review"} ]
[0252] For the above multidimensional data set, an initialized hierarchical DAG structure is constructed, where each dimension corresponds to a DAG level: sender corresponds to L1 level, recipient corresponds to L2 level, date corresponds to L3 level, and subject corresponds to L4 level. DAG nodes are constructed one by one at each DAG level. Taking L1 level as an example, for each sender in the sender and receiver data, the order-preserving encryption value and symmetric encryption value corresponding to the sender are calculated.
[0253] When calculating the order-preserving encryption value, the hash value corresponding to the sender can be calculated first, and then the hash value is converted to the initial encryption value within the encryption range of the L1 layer, and the initial encryption value is added with a random offset to obtain the order-preserving encryption value. This process is a high-precision floating-point operation or a fixed-point operation.
[0254] For example, the sender "alice@example.com" calculates the hash value "4872638472638476238" through SHA-256, and then substitutes the hash value into the above formula (2) to calculate the order-preserving encryption value. Among them, the minimum encryption range of the L1 layer corresponding to the sender can be 1000, and the maximum encryption range can be 9999. In the same way, the order-preserving encryption value can be calculated for another sender "charlie@example.com" at the L1 layer.
[0255] In the same way, the order-preserving encryption values are calculated for each recipient of the L2 layer "bob@example.com", "dave@example.com", and "eve@example.com".
[0256] In the same way, the order-preserving encryption values are calculated for the dates "2021-01-01", "2021-02-01", "2021-03-01", and "2021-04-01" of the L3 layer.
[0257] In the same way, the order-preserving encryption values are calculated for each topic of the L4 layer, "Meeting", "Update", "Report", and "Review".
[0258] After constructing DAG nodes for the sub-data of each dimension at its corresponding DAG level, unidirectional edges may be added to several DAG nodes of each DAG level, and further, unidirectional edges may be added to DAG nodes of adjacent DAG levels.
[0259] See also Fig.14 , which is a schematic diagram of the structure of a hierarchical DAG provided in an embodiment of the present application, such as Fig.14 As shown in the figure, the sub-data of the sender dimension in the multiple sent and received email data constructs two DAG nodes N1 and N2 in the L1 layer, and the DAG node N1 corresponds to "alice@example.com", and the DAG node N2 corresponds to "charlie@example.com"; the sub-data of the recipient dimension in the multiple sent and received email data is constructed into three DAG nodes M1, M2 and M3 in the L2 layer, and the DAG node M1 corresponds to "bob@example.com", the DAG node M2 corresponds to "dave@example.com", and the DAG node M3 corresponds to "eve@example.com"; the sub-data of the date dimension in the multiple sent and received email data The sub-data of the degree is constructed as 4 DAG nodes D1, D2, D3 and D4 at the L3 layer. DAG node D1 corresponds to "2021-01-01", DAG node D2 corresponds to "2021-02-01", DAG node D3 corresponds to "2021-03-01", and DAG node D4 corresponds to "2021-04-01"; the sub-data of the subject dimension in multiple transceiver data are constructed as 4 DAG nodes S1, S2, S3 and S4 at the L4 layer. DAG node S1 corresponds to "Meeting", DAG node S2 corresponds to "Update", DAG node S3 corresponds to "Report", and DAG node S4 corresponds to "Review".
[0260] Fig.14In the hierarchical DAG, in the same level, the DAG node on the left points to the DAG node on the right; and the unidirectional edge across the DAG level is determined according to the association relationship between the sub-data in the same data in the transceiver data. For example: Since there is an association relationship between the sub-data in the first transceiver data, DAG node N1 points to DAG node M1, DAG node M1 points to DAG node D1, and DAG node D1 points to DAG node S1.
[0261] In this case, a hierarchical DAG is constructed with multiple DAG nodes in 4 dimensions and multiple unidirectional edges have been added.
[0262] Furthermore, the number of virtual nodes can be determined based on the total number of original DAG nodes and the disturbance ratio in the current hierarchical DAG. Here, the total number of original DAG nodes is 13, the disturbance ratio is 10%, and the number of virtual nodes is determined to be 2 by the aforementioned formula (3). Therefore, 2 virtual nodes need to be added.
[0263] Randomly select and add virtual nodes at the L3 and L4 layers: Add virtual node D at the L3 layer v1 , the corresponding sub-data is "2017-02-30"; add a virtual node S in the L4 layer v2 , the corresponding sub-data is "Virutal".
[0264] See also Fig.15 , which is a schematic diagram of the structure of a hierarchical DAG provided in another embodiment of the present application, such as Fig.15 As shown, for virtual node D v1 , add DAG node D1 to point to virtual node D v1 One-way edge, add virtual node D v1 The one-way edge pointing to DAG node D2 is used as the perturbation connection at the same level. In addition, DAG node M3 at layer L2 is selected as the virtual node D v1 Add DAG node M3 to virtual node D v1 , as a perturbation connection across DAG levels.
[0265] For virtual node S v2 , add DAG node S2 to point to virtual node S v2 One-way edge, add virtual node S v2 The one-way edge pointing to DAG node S3 is used as the perturbation connection at the same level. In addition, DAG node D2 at layer L3 is selected as the virtual node S v2 Add DAG node D2 to virtual node S v2 , as a perturbation connection across DAG levels.
[0266] In this case, the confidentiality of the hierarchical DAG is improved by adding virtual nodes and path perturbations.
[0267] When querying data, if you want to query all email subjects between 2021-03-01 and 2021-04-01, you can construct a query instruction in which the target query level is L3, the condition data is "2021-03-01≤date≤2021-04-01", and the target output level is L4.
[0268] In this case, the order-preserving encryption values are calculated for "2021-03-01" and "2021-04-01" respectively to obtain the target data range, and then the DAG nodes whose order-preserving encryption values are in the target data range are found in the L3 layer, and DAG nodes D3 and D4 are found. DAG nodes S3 and S4 that are in the same link as DAG nodes D3 and D4 are found in the target output layer. The symmetric encryption values in DAG nodes S3 and S4 are decrypted to return the topics "Report" and "Review".
[0269] When updating data, if you need to update the subject from "Update" to "Discussion", that is, modify {"Sender":"alice@example.com", "Recipient":"dave@example.com", "Date":"2021-02-01", "Subject":"Update"} to:
[0270] {"Sender":"alice@example.com","Recipient":"dave@example.com","Date":"2021-02-01","Subject":"Discussion"}.
[0271] At this time, the update instruction may include the data to be updated {"Sender":"alice@example.com", "Recipient":"dave@example.com", "Date":"2021-02-01", "Subject":"Update"}, the sub-data to be updated "Discussion" of the subject dimension, and the dimension set {sender, recipient, date, subject}.
[0272] The order-preserving encryption value is calculated for the sub-data of each dimension in the data to be updated, and then the matching DAG node is determined in the corresponding DAG level by the order-preserving encryption value, so as to determine the link to be updated by the DAG nodes of multiple DAG levels.
[0273] See also Fig.16 , is a schematic diagram of a link to be updated provided in an embodiment of the present application, such as Fig.16 As shown, from Fig.15 The links to be updated obtained from the hierarchical DAG include DAG nodes N1, M2, D2, and S2, and S2 can be determined to be the DAG node that needs to be updated. Since the number of in-degrees across DAG levels of DAG node S2 is 1, the order-preserving encryption value and symmetric encryption value of the sub-data "Discussion" to be updated can be directly updated to the DAG node S2, thereby completing the update process.
[0274] When deleting data, if you need to delete {"Sender":"charlie@example.com", "Recipient":"bob@example.com", "Date":"2021-03-01", "Subject":"Report"} from the hierarchical DAG structure, the deletion instruction includes the data to be deleted {"Sender":"charlie@example.com", "Recipient":"bob@example.com", "Date":"2021-03-01", "Subject":"Report"}.
[0275] The order-preserving encryption value is calculated for the sub-data of each dimension in the data to be deleted, and then the matching DAG nodes are determined in the corresponding DAG level by using each order-preserving encryption value, so as to determine the link to be deleted by using the DAG nodes of multiple DAG levels.
[0276] See also Fig.17 , is a schematic diagram of a link to be deleted provided in an embodiment of the present application, such as Fig.17 As shown, from Fig.15 The links to be deleted are queried in the hierarchical DAG, including DAG nodes N2, M1, D3, and S3. First, the DAG node N2 at the L1 level can be used as the designated DAG node, and it is determined whether the designated DAG node meets the deletion condition. Since the number of out-degrees across DAG levels in DAG node N2 is 2, DAG node N2 does not meet the deletion condition.
[0277] Secondly, the DAG node M1 at the L2 level can be used as a designated DAG node, and it is determined whether the designated DAG node meets the deletion condition. Since the number of out-degrees across DAG levels in the DAG node M1 is 2, the DAG node M1 does not meet the deletion condition.
[0278] Furthermore, the DAG node D3 at the L3 level can be used as a designated DAG node, and it is determined whether the designated DAG node meets the deletion condition. Since the number of out-degrees across DAG levels in DAG node D3 is 1, and the number of adjusted in-degrees across DAG levels in DAG node D3 is 0, DAG node D3 meets the deletion condition. In this case, DAG node D3 can be deleted, and a unidirectional edge from DAG node D2 to DAG node D4 can be added.
[0279] Finally, the DAG node S3 at the L4 level can be used as the designated DAG node, and it is determined whether the designated DAG node meets the deletion condition. Since the number of out-degrees across DAG levels in DAG node S3 is 0, and the number of adjusted in-degrees across DAG levels in DAG node S3 is 0, DAG node S3 meets the deletion condition. In this case, DAG node S3 can be deleted and DAG node S v2 A unidirectional edge pointing to DAG node S4.
[0280] Fig.18 is a block diagram of a DAG-based order-preserving encryption device according to an embodiment of the present invention. Fig.18 As shown, the device may include:
[0281] A construction module 1810 is used to construct, for each multidimensional data in the multidimensional data set, a DAG node of a DAG level corresponding to the i-th dimension for the sub-data of the multidimensional data in the i-th dimension; wherein the order-preserving encryption value and the symmetric encryption value of the sub-data are written into the DAG node; the value range of i is 1 to m, and m is the total number of dimensions of the multidimensional data;
[0282] A first adding module 1820 is configured to add, for a DAG level corresponding to the i-th dimension, a unidirectional edge between a plurality of DAG nodes at the DAG level based on a size relationship of order-preserving encrypted values of a plurality of DAG nodes at the DAG level;
[0283] The second adding module 1830 is used to add a unidirectional edge between each DAG node in the DAG level corresponding to the jth dimension and each DAG node in the DAG level corresponding to the j+1th dimension that satisfies the association relationship between the DAG node and the DAG level corresponding to the j+1th dimension; wherein the value range of j is 1 to m-1;
[0284] The generating module 1840 is used to construct a hierarchical DAG according to the multiple DAG nodes of the m dimension and the multiple unidirectional edges that have been added.
[0285] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned DAG-based order-preserving encryption method, which will not be repeated here.
[0286] In several embodiments provided in the present application, the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0287] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0288] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, 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, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform 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, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
Claims
1. A DAG-based order-preserving encryption method, characterized in that: include: For each multidimensional data in the multidimensional data set, a DAG node corresponding to the DAG level in the i-th dimension is constructed for the sub-data in the i-th dimension of the multidimensional data; wherein the order-preserving encryption value and the symmetric encryption value of the sub-data are written into the DAG node; the value range of i is 1 to m, and m is the total number of dimensions of the multidimensional data; For the DAG level corresponding to the i-th dimension, based on the size relationship of the order-preserving encrypted values of the DAG nodes at the DAG level, add unidirectional edges between the DAG nodes at the DAG level; For each DAG node in the DAG level corresponding to the jth dimension, add a unidirectional edge between the DAG node and each DAG node in the DAG level corresponding to the j+1th dimension that satisfies the association relationship; where j ranges from 1 to m-1; A hierarchical DAG is constructed based on multiple DAG nodes of m dimension and multiple unidirectional edges that have been added.
2. The method according to claim 1, characterized in that The step of calculating the order-preserving encryption value of the sub-data includes: The sub-data of the multidimensional data in the i-th dimension is converted into an initial encryption value of the encryption range corresponding to the i-th dimension, and a random offset is added to the initial encryption value to obtain the order-preserving encryption value of the multidimensional data in the i-th dimension; wherein the order-preserving encryption process is high-precision floating-point arithmetic or fixed-point arithmetic.
3. The method according to claim 1, characterized in that After adding a unidirectional edge between each DAG node in the DAG level corresponding to the jth dimension and each DAG node satisfying an association relationship with the DAG node in the DAG level corresponding to the j+1th dimension, the method further includes: Determine the number of virtual nodes based on the preset disturbance ratio and the total number of original DAG nodes in m dimensions; The virtual nodes indicated by the virtual node quantity are added to the corresponding DAG level according to the preset perturbation rule, and the unidirectional edges corresponding to the virtual nodes are added.
4. The method according to claim 3, characterized in that: The adding of the corresponding DAG level according to the preset perturbation rule and adding the unidirectional edge corresponding to the virtual node includes: Add each virtual node to a randomly selected DAG level; Add unidirectional edges within the same DAG level and across DAG levels for virtual nodes that have been added to the DAG level.
5. The method according to claim 1, characterized in that Before adding a unidirectional edge between each DAG node in the DAG level corresponding to the jth dimension and each DAG node satisfying an association relationship with the DAG node in the DAG level corresponding to the j+1th dimension, the method further includes: For each DAG node in the DAG level corresponding to the j-th dimension, determine whether the sub-data corresponding to the DAG node and the sub-data corresponding to each DAG node in the DAG level of the j+1-th dimension exist in the same multi-dimensional data; If so, it is determined that the DAG node in the jth dimension and the DAG node in the j+1th dimension satisfy an association relationship.
6. The method according to claim 5, characterized in that Each DAG node records the out-degree and the in-degree, and the method further includes: If not, determine the relevant parameters of the two according to the number of out-degrees of the DAG node in the jth dimension and the number of in-degrees of the DAG node in the j+1th dimension; Determine frequency parameters of both according to the number of visits to the DAG node in the jth dimension and the number of visits to the DAG node in the j+1th dimension; Determine a weight coefficient according to the relevant parameters and the frequency parameter, and determine whether the weight coefficient reaches a preset weight threshold; If the weight coefficient reaches the weight threshold, it is determined that the DAG node in the j-th dimension satisfies the association relationship with the DAG node in the j+1-th dimension.
7. The method according to claim 1 or 3, characterized in that: The method further comprises: In response to a query instruction for the hierarchical DAG, the query instruction is parsed to obtain conditional data of a plurality of target query levels, and the conditional data of each target query level is converted into a corresponding order-preserving encrypted value as a target data range of the target query level; wherein the query instruction includes a plurality of target output levels; If the query instruction is a union query, traverse each DAG node of each target query level of the hierarchical DAG, and if the order-preserving encrypted value of any DAG node of any target query level is within the target data range of the target query level, add the DAG node to the temporary result set; Determine the DAG nodes of the target output levels of the link where each DAG node in the temporary result set is located as the query result; wherein the link where the DAG node is located is determined according to the one-way edges across the levels passing through the DAG node.
8. The method according to claim 7, characterized in that The method further comprises: If the query instruction is an intersection query, traverse each DAG node of each target query level of the hierarchical DAG, and if the order-preserving encrypted value of any DAG node of any target query level is within the target data range of the target query level, add the DAG node to the temporary result set corresponding to the target query level; From the temporary result sets corresponding to all target query levels, DAG nodes in the same link are screened out, thereby obtaining several target links; wherein the DAG nodes of each target link in each target query level are in the temporary result set of the target query level; Determine the DAG nodes of the target link at the target output levels as the query result.
9. The method according to claim 8, characterized in that The method further comprises: The symmetric encryption value of each DAG node in the query result is decrypted with the key of the symmetric encryption algorithm to obtain the plaintext data of each DAG node.
10. The method according to claim 1 or 3, characterized in that: Each DAG node records the out-degree and the in-degree, and the method further includes: In response to an update instruction for the hierarchical DAG, obtaining, by querying, a link to be updated corresponding to the data to be updated in the update instruction in the hierarchical DAG; Determine, from the to-be-updated link, the to-be-updated DAG node corresponding to the to-be-updated sub-data of the to-be-updated data; Determine whether the number of in-degrees across DAG levels in the DAG node to be updated is greater than one; if not, calculate the order-preserving encryption value and the symmetric encryption value of the sub-data to be updated, and update the order-preserving encryption value and the symmetric encryption value of the sub-data to be updated to the DAG node to be updated.
11. The method according to claim 10, characterized in that The method further comprises: If the number of in-degrees across DAG levels in the DAG node to be updated is greater than one, construct a new DAG node for the sub-data to be updated, and add the new DAG node to the DAG level where the DAG node to be updated is located; Based on the newly added DAG node, the unidirectional edges at the same DAG level and across DAG levels in the hierarchical DAG are adjusted accordingly.
12. The method according to claim 11, characterized in that The method further comprises: In the case of adding the newly added DAG node to the hierarchical DAG, determining the number of virtual nodes according to a preset disturbance ratio and the total number of original DAG nodes in m dimensions; The virtual nodes indicated by the virtual node quantity are added to the corresponding DAG level according to the preset perturbation rule, and the unidirectional edges corresponding to the virtual nodes are added.
13. The method according to claim 1 or 3, characterized in that: Each DAG node records the out-degree and the in-degree, and the method further includes: In response to a deletion instruction for the hierarchical DAG, obtaining, by querying, a link to be deleted corresponding to the data to be deleted in the deletion instruction in the hierarchical DAG; Selecting the DAG nodes in the link to be deleted as designated DAG nodes in descending order of DAG levels; Determine whether the specified DAG node satisfies a deletion condition; wherein the deletion condition is: the number of out-degrees across DAG levels in the specified DAG node is one or zero, and the number of adjusted in-degrees across DAG levels in the specified DAG node is zero; If any specified DAG node does not meet the deletion conditions, the specified DAG node is retained; If any specified DAG node meets the deletion condition, the specified DAG node is isolated and then deleted.
14. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to execute the DAG-based order-preserving encryption method described in any one of claims 1-13.
15. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program can be executed by a processor to complete the DAG-based order-preserving encryption method described in any one of claims 1-13.
16. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the DAG-based order-preserving encryption method described in any one of claims 1-13 is implemented.