Data anonymization methods, data query methods, and their apparatus, equipment, and storage media
By generating master-slave relationships and constructing data sub-tables, the relationship between data items is hidden, solving the problem of information loss caused by data anonymization in existing technologies, and achieving efficient data privacy protection and querying.
Patent Information
- Application Number
- CN202310993958.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-08
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2043-08-08
AI Technical Summary
Existing data anonymization methods result in changes to the content of data items, leading to information loss and irreversible data alterations.
By randomly generating primary related items and encrypting secondary related items, a primary data sub-table and a secondary data sub-table are constructed to hide the relationships between data items. The Shamir secret sharing algorithm is used to process intermediate data, generating N secondary related items, and query efficiency is improved by using dataset numbering.
This allows for hiding the relationships between data items without altering their content, protecting data privacy, preventing information loss, and ensuring the efficiency and accuracy of data queries.
Smart Images

Figure CN118821188B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and in particular to a data desensitization method, a data query method, and related apparatus, equipment, and storage medium. Background Technology
[0002] In the current environment, data security is receiving increasing attention, and data desensitization has become a key focus of current data security work. Data desensitization refers to the transformation of sensitive information in data through desensitization rules to achieve reliable protection of sensitive and private data.
[0003] Currently used data anonymization methods, such as data anonymization, hash anonymization, data mapping replacement, data encryption, and data masking, all achieve the goal of data anonymization by changing the content of data items. However, these data anonymization methods can lead to the loss of information and irreversible data changes due to the changes in the content of data items. Summary of the Invention
[0004] This invention provides a data anonymization method, a data query method, and related apparatus, devices, and storage media to solve the problem that changes in the content of data items in existing technologies can lead to information loss and irreversible data alteration. This invention can achieve data anonymization by hiding the relationships between data items without changing the content of the data items.
[0005] To achieve the above objectives, embodiments of the present invention provide a data anonymization method, comprising:
[0006] Obtain the original data to be anonymized; wherein, the original data includes a master data item and N slave data items, the master data item serves as an index for querying the original data, and N is a positive integer;
[0007] Randomly generate a primary associated item, and encrypt the primary associated item to generate N secondary associated items;
[0008] The primary associated item is associated with the primary data item to form a primary data sub-table, and the secondary associated item is associated with the secondary data item one by one to form N secondary data sub-tables.
[0009] As an improvement to the above scheme, the random generation of the primary associated item and the encryption of the primary associated item to generate N secondary associated items include:
[0010] Randomly generate primary related items;
[0011] The main associated item is encrypted to obtain intermediate data;
[0012] The intermediate data is processed using the Shamir secret sharing algorithm to generate N related items.
[0013] As an improvement to the above scheme, the data sub-table further includes: a dataset number corresponding to the data item, wherein all data items of the original data have the same dataset number.
[0014] As an improvement to the above scheme, the dataset number is determined through the following steps:
[0015] Calculate the summary value of the master data item;
[0016] Using the summary value of the master data item, a modulo operation is performed on the preset dataset size to obtain the dataset number of the original data, and the dataset number of the original data is used as the dataset number of the slave data item.
[0017] To achieve the above objectives, embodiments of the present invention also provide a data query method, including:
[0018] Receive and parse data query requests to obtain the index of the original data to be queried, wherein the original data includes a master data item and N slave data items, where N is a positive integer;
[0019] In the de-identified data table, confirm the first master data item that is identical to the index;
[0020] Based on the first master associated item, obtain all first slave associated items corresponding to the first master associated item;
[0021] Retrieve all slave data associated with the first slave item;
[0022] The de-identified data table includes a master data sub-table and N slave data sub-tables. In the master data sub-table, master data items are associated with master related items one-to-one, and in the slave data sub-tables, slave data items are associated with slave related items one-to-one. N is a positive integer.
[0023] As an improvement to the above scheme, the data sub-table further includes: a dataset number corresponding to the data item, wherein all data items of the original data have the same dataset number.
[0024] As an improvement to the above scheme, the step of identifying the first master data item that is the same as the index in the de-identified data table includes:
[0025] The index is used to calculate the dataset number to be queried from the original data;
[0026] Retrieve each group of second related items belonging to the number of the dataset to be queried;
[0027] Decrypt all the second secondary related items in each group to obtain each second primary related item;
[0028] The index is compared with the master data item associated with each of the second master association items. When the comparison results are the same, the first master data item that is the same as the index is obtained.
[0029] As an improvement to the above scheme, the step of decrypting all the second secondary related items in each group to obtain each second primary related item includes:
[0030] By using the inverse operation of the Shamir secret sharing algorithm, all the associated items in each group are processed to recover each intermediate data;
[0031] Each of the intermediate data is decrypted to obtain each second main related item.
[0032] As an improvement to the above scheme, the step of calculating the query dataset number of the original data using the index includes:
[0033] Calculate the summary value of the index;
[0034] Using the summary value of the index, a modulo operation is performed on the preset dataset size to obtain the dataset number to be queried.
[0035] To achieve the above objectives, embodiments of the present invention also provide a data desensitization device, comprising:
[0036] The raw data acquisition module is used to acquire the raw data to be de-identified; wherein, the raw data includes a master data item and N slave data items, the master data item serves as an index for querying the raw data, and N is a positive integer;
[0037] The association item generation module is used to randomly generate a main association item and encrypt the main association item to generate N secondary association items;
[0038] The data anonymization module is used to associate the main related item with the main data item to form a main data sub-table, and to associate the subordinate related item with the subordinate data item one by one to form N subordinate data sub-tables.
[0039] To achieve the above objectives, embodiments of the present invention also provide a data query device, comprising:
[0040] The index acquisition module is used to receive and parse data query requests and obtain the index of the original data to be queried, wherein the original data includes a main data item and N secondary data items, where N is a positive integer;
[0041] The first master data item confirmation module is used to confirm the first master data item that is the same as the index in the de-identified data table;
[0042] The first associated item acquisition module is used to acquire all first associated items corresponding to the first main associated item based on the first main associated item associated with the first main data item;
[0043] The data acquisition module is used to acquire all data associated with all the first associated items;
[0044] The de-identified data table includes a master data sub-table and N slave data sub-tables. In the master data sub-table, master data items are associated with master related items one-to-one, and in the slave data sub-tables, slave data items are associated with slave related items one-to-one. N is a positive integer.
[0045] To achieve the above objectives, embodiments of the present invention also provide an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the above-described method when executing the computer program.
[0046] To achieve the above objectives, embodiments of the present invention also provide a computer-readable storage medium, the computer-readable storage medium including a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the above-described method.
[0047] Compared with existing technologies, the data anonymization method, data query method, apparatus, device, and storage medium provided in this invention split the original data into a main data sub-table and N subordinate data sub-tables. In the main data sub-table, each main related item is associated with a main data item, and in each subordinate data sub-table, each subordinate data item is associated with a subordinate related item. This allows the anonymization of data to be achieved by hiding the relationships between data items in the original data without changing the data content. This invention is applicable to scenarios with high data security and privacy requirements, achieving a high degree of privacy de-identification in data storage and querying. Attached Figure Description
[0048] Figure 1 This is a flowchart of a data desensitization method provided in an embodiment of the present invention;
[0049] Figure 2 This is a schematic diagram of data splitting provided in an embodiment of the present invention;
[0050] Figure 3 This is a schematic diagram of a dataset mapping provided by an embodiment of the present invention;
[0051] Figure 4 This is a flowchart of a data query method provided in an embodiment of the present invention.
[0052] Figure 5 This is a structural block diagram of a data desensitization device provided in an embodiment of the present invention;
[0053] Figure 6 This is a structural block diagram of a data query device provided in an embodiment of the present invention;
[0054] Figure 7 This is a structural block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0055] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0056] See Figure 1 , Figure 1 This is a flowchart of a data anonymization method provided in an embodiment of the present invention. The data anonymization method includes:
[0057] S11. Obtain the original data to be de-identified; wherein, the original data includes a master data item and N slave data items, the master data item serves as an index for querying the original data, and N is a positive integer;
[0058] S12. Randomly generate a primary associated item, and encrypt the primary associated item to generate N secondary associated items;
[0059] S13. Associate the main associated item with the main data item to form a main data sub-table, and associate the secondary associated item with the secondary data item one by one to form N secondary data sub-tables.
[0060] It is understood that each piece of original data has several data items, and each piece of original data has a unique master data item, which serves as an index and is used as a query condition. The remaining data items are secondary data items, belonging to attribute data items. In this embodiment of the invention, by splitting the original data into a master data sub-table and N secondary data sub-tables, the data items contained in the original data are no longer easily accessible, personal privacy is protected, and data anonymization is achieved. Figure 2 As shown, Figure 2This paper provides an example of splitting original data containing one main data item (data item A) and two subordinate data items (data item B and data item C). Through this embodiment of the invention, the original data is split into a main data sub-table (data sub-table 1) and two subordinate data sub-tables (data sub-table 2 and data sub-table 3). This embodiment of the invention achieves data anonymization by hiding the relationships between data items without changing their content. It avoids the loss of original data information and irreversible data alteration, prevents data collisions, maintains the original data order, and does not affect the statistical analysis of the original data.
[0061] In one optional embodiment, the random generation of the primary associated item and the encryption of the primary associated item to generate N secondary associated items include:
[0062] Randomly generate primary related items;
[0063] The main associated item is encrypted to obtain intermediate data;
[0064] The intermediate data is processed using the Shamir secret sharing algorithm to generate N related items.
[0065] For example, firstly, an integer R is randomly generated as the primary associated item. Then, the primary associated item is processed using a preset encryption algorithm to generate intermediate data T. Finally, the intermediate data T is processed using the Shamir secret sharing algorithm to generate N secondary associated items. The encryption algorithm is the SM4 cryptographic algorithm. This embodiment of the invention forms a new association relationship, namely the association relationship between the primary associated item and the secondary associated items.
[0066] For example, N=2. The Shamir secret sharing algorithm pre-sets a large prime number P as a parameter, randomly generates a parameter a1, and assigns the intermediate data T as the "secret s" to a0. Then, it constructs the polynomial: Y = a0 + a1 * X (mod P).
[0067] Take any two numbers x1 and x2, and substitute them into the above polynomial to obtain two sets of Shadows: {x1, y1} and {x2, y2}. After formatting, they are used as related item 1 and related item 2, respectively.
[0068] In an optional embodiment, the data sub-table further includes: a dataset number corresponding to the data item, wherein all data items of the original data have the same dataset number.
[0069] It is understood that all data items in the original data include both the main data items and all the secondary data items. By assigning dataset numbers to the secondary data items, the dataset numbers can be used to locate the combination of secondary data items to be queried during the data query phase, thereby improving query efficiency.
[0070] In one optional embodiment, the dataset number is determined by the following steps:
[0071] Calculate the summary value of the master data item;
[0072] Using the summary value of the master data item, a modulo operation is performed on the preset dataset size to obtain the dataset number of the original data, and the dataset number of the original data is used as the dataset number of the slave data item.
[0073] Specifically, determine the size M of the dataset. For example, for a dataset with 1 million data points, M can be set to 10,000, so that each dataset has an average of 1 million / 10,000 = 100 data points.
[0074] For each piece of original information data, using an index, a one-way function is used to calculate the mapping value H. The one-way function can employ the SM3 algorithm.
[0075] Using the mapping value H and the dataset size M, calculate H mod M. The result is the dataset number of this original data entry. This dataset number is then used as the dataset number for all data items within this original data entry. A dataset mapping diagram is shown below. Figure 3 As shown.
[0076] For example, for the first piece of original data, let N = 10000;
[0077] The digest value of the string "13601234567" is calculated using the SM3 algorithm: "0d54e8b87db09c8e811f18b2ebb101fa348b960ba324cbadfbe57942ae7ac071".
[0078] H mod 10000 = 1;
[0079] Therefore, after the first piece of original data is split, its dataset number is 1.
[0080] This invention improves query efficiency by partitioning the dataset. Specifically, by pre-determining the dataset size, the number of data sub-tables that need to be queried each time is controlled within a fixed range, ensuring query response time and improving query efficiency.
[0081] In an optional embodiment, the data anonymization method further includes:
[0082] The master associated item is encrypted and N slave associated items are generated in the Trusted Execution Environment (TEE) of the computer.
[0083] Understandably, SGX technology is used to encapsulate the aforementioned preset encryption algorithm and Shamir secret sharing algorithm and parameters into the Tee's trusted enclave for execution, in order to protect the algorithms and parameters used when constructing the association between master and slave items.
[0084] See Figure 4 , Figure 4 This is a flowchart of a data query method provided in an embodiment of the present invention. The data query method includes:
[0085] S21. Receive and parse the data query request to obtain the index of the original data to be queried, wherein the original data includes a master data item and N slave data items, where N is a positive integer;
[0086] S22. In the de-identified data table, confirm the first master data item that is the same as the index;
[0087] S23. Based on the first master associated item, obtain all first slave associated items corresponding to the first master associated item;
[0088] S24. Obtain all slave data associated with all the first slave association items;
[0089] The de-identified data table includes a master data sub-table and N slave data sub-tables. In the master data sub-table, master data items are associated with master related items one-to-one, and in the slave data sub-tables, slave data items are associated with slave related items one-to-one. N is a positive integer.
[0090] Understandably, when it is necessary to query the original data, the query is performed using the index carried in the data query request to confirm the first primary data item that is the same as the index in the desensitized data table. Then, all the corresponding first secondary data items are queried using the first primary data item, and the secondary data items are obtained. Finally, the original data is restored, achieving a high degree of de-privacy in data storage and query.
[0091] In an optional embodiment, after obtaining all data items corresponding to the index, the data query method further includes:
[0092] The index is combined with all the data items to obtain the original data.
[0093] In an optional embodiment, the data sub-table further includes: a dataset number corresponding to the data item, wherein all data items of the original data have the same dataset number.
[0094] For example, the dataset number from the data sub-table is determined by the following steps:
[0095] Calculate the summary value of the master data item corresponding to the slave data item;
[0096] Using the summary value of the master data item, a modulo operation is performed on the preset dataset size to obtain the dataset number of the original data, and the dataset number of the original data is used as the dataset number of the slave data item.
[0097] In an optional embodiment, confirming the first master data item in the de-identified data table that is identical to the index includes:
[0098] The index is used to calculate the dataset number to be queried from the original data;
[0099] Retrieve each group of second related items belonging to the number of the dataset to be queried;
[0100] Decrypt all the second secondary related items in each group to obtain each second primary related item;
[0101] The index is compared with the master data item associated with each of the second master association items. When the comparison results are the same, the first master data item that is the same as the index is obtained.
[0102] It is understood that the index is used to confirm the query dataset number of the original data, and the query range is locked based on the query dataset number; the second secondary related item of each group is decrypted to obtain the second primary related item of each group, and all primary data items associated with each second primary related item are obtained, from which the primary related item that is the same as the index is retrieved. Therefore, this embodiment of the invention controls the number of data sub-tables that need to be queried each time within a fixed range, ensuring query response time and improving query efficiency.
[0103] In an optional embodiment, the step of decrypting all the second secondary associated items in each group to obtain each second primary associated item includes:
[0104] By using the inverse operation of the Shamir secret sharing algorithm, all the associated items in each group are processed to recover each intermediate data;
[0105] Each of the intermediate data is decrypted to obtain each second main related item.
[0106] For example, the inverse operation of the Shamir secret sharing algorithm is used to process all the associated items to recover the intermediate data T. Then, the inverse operation of the preset encryption algorithm is used to decrypt the intermediate data T to obtain the main associated item.
[0107] For example, N=2, the Shamir secret sharing algorithm pre-sets a large prime number P as a parameter, and associate term 1 and associate term 2 represent two sets of shadows: {x1,y1} and {x2,y2}, respectively. The following system of equations is constructed (all operations are performed within GF(p)):
[0108] a0 + a1 * X1 = Y1 (mod P)
[0109] a0 + a1 * X2 = Y2 (mod P)
[0110] The "secret s" a0 can be recovered by matrix multiplication or Lagrange interpolation, which is the intermediate data T.
[0111] In an optional embodiment, calculating the query dataset number of the original data using the index includes:
[0112] Calculate the summary value of the index;
[0113] Using the summary value of the index, a modulo operation is performed on the preset dataset size to obtain the dataset number to be queried.
[0114] It is understood that the embodiments of the present invention improve query efficiency by dividing the dataset. Specifically, by determining the size of the dataset in advance, the number of data sub-tables that need to be queried each time is controlled within a fixed range, ensuring query response time and improving query efficiency.
[0115] See Figure 5 , Figure 5 This is a structural block diagram of a data desensitization device 10 provided in an embodiment of the present invention. The data desensitization device 10 includes:
[0116] The raw data acquisition module 11 is used to acquire the raw data to be de-identified; wherein, the raw data includes a master data item and N slave data items, the master data item serves as an index for querying the raw data, and N is a positive integer;
[0117] The association item generation module 12 is used to randomly generate a main association item and encrypt the main association item to generate N secondary association items;
[0118] The data desensitization module 13 is used to associate the main related item with the main data item to form a main data sub-table, and to associate the secondary related item with the secondary data item one by one to form N secondary data sub-tables.
[0119] Optionally, the random generation of the primary associated item, and the encryption of the primary associated item to generate N secondary associated items, includes:
[0120] Randomly generate primary related items;
[0121] The main associated item is encrypted to obtain intermediate data;
[0122] The intermediate data is processed using the Shamir secret sharing algorithm to generate N related items.
[0123] Optionally, the data sub-table further includes: a dataset number corresponding to the data item, wherein all data items of the original data have the same dataset number.
[0124] Optionally, the data desensitization device 10 further includes a dataset number determination module, which is used for:
[0125] Calculate the summary value of the master data item;
[0126] Using the summary value of the master data item, a modulo operation is performed on the preset dataset size to obtain the dataset number of the original data, and the dataset number of the original data is used as the dataset number of the slave data item.
[0127] It is worth noting that the working process of each module in the data desensitization device 10 described in the embodiments of the present invention can refer to the working process of the data desensitization method described in the above embodiments, and will not be repeated here.
[0128] See Figure 6 , Figure 6 This is a structural block diagram of a data query device 20 provided in an embodiment of the present invention. The data query device 20 includes:
[0129] The index acquisition module 21 is used to receive and parse the data query request and obtain the index of the original data to be queried, wherein the original data includes a main data item and N secondary data items, where N is a positive integer;
[0130] The first master data item confirmation module 22 is used to confirm the first master data item that is the same as the index in the de-identified data table;
[0131] The first associated item acquisition module 23 is used to acquire all first associated items corresponding to the first main associated item based on the first main associated item associated with the first main data item;
[0132] From the data acquisition module 24, it is used to acquire all the slave data associated with all the first slave association items;
[0133] The de-identified data table includes a master data sub-table and N slave data sub-tables. In the master data sub-table, master data items are associated with master related items one-to-one, and in the slave data sub-tables, slave data items are associated with slave related items one-to-one. N is a positive integer.
[0134] Optionally, the data sub-table further includes: a dataset number corresponding to the data item, wherein all data items of the original data have the same dataset number.
[0135] Optionally, confirming the first master data item in the de-identified data table that is identical to the index includes:
[0136] The index is used to calculate the dataset number to be queried from the original data;
[0137] Retrieve each group of second related items belonging to the number of the dataset to be queried;
[0138] Decrypt all the second secondary related items in each group to obtain each second primary related item;
[0139] The index is compared with the master data item associated with each of the second master association items. When the comparison results are the same, the first master data item that is the same as the index is obtained.
[0140] Optionally, the step of decrypting all the second secondary related items in each group to obtain each second primary related item includes:
[0141] By using the inverse operation of the Shamir secret sharing algorithm, all the associated items in each group are processed to recover each intermediate data;
[0142] Each of the intermediate data is decrypted to obtain each second main related item.
[0143] Optionally, calculating the query dataset number of the original data using the index includes:
[0144] Calculate the summary value of the index;
[0145] Using the summary value of the index, a modulo operation is performed on the preset dataset size to obtain the dataset number to be queried.
[0146] It is worth noting that the working process of each module in the data query device 20 described in the embodiments of the present invention can refer to the working process of the data query method described in the above embodiments, and will not be repeated here.
[0147] This invention also provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the data desensitization method or the data query method described in any of the above embodiments.
[0148] See Figure 7 , Figure 7This is a structural block diagram of an electronic device 30 provided in an embodiment of the present invention. The electronic device 30 includes: a processor 31, a memory 32, and a computer program stored in the memory 32 and executable on the processor 31. When the processor 31 executes the computer program, it implements the steps in the above-described data anonymization method embodiments or the steps in the above-described data query method embodiments. Alternatively, when the processor 31 executes the computer program, it implements the functions of each module / unit in the above-described data anonymization device embodiments or the functions of each module / unit in the above-described data query device embodiments.
[0149] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 32 and executed by the processor 31 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device 30.
[0150] The electronic device 30 may include, but is not limited to, a processor 31 and a memory 32. Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 30 and does not constitute a limitation on the electronic device 30. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the electronic device 30 may also include input / output devices, network access devices, buses, etc.
[0151] The processor 31 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. The processor 31 is the control center of the electronic device 30, connecting various parts of the electronic device 30 via various interfaces and lines.
[0152] The memory 32 can be used to store the computer programs and / or modules. The processor 31 implements various functions of the electronic device 30 by running or executing the computer programs and / or modules stored in the memory 32 and calling the data stored in the memory 32. The memory 32 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 32 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0153] If the modules / units integrated in the electronic device 30 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by the processor 31, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.
[0154] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0155] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A data anonymization method, characterized in that, include: Obtain the original data to be anonymized; wherein, the original data includes a master data item and N slave data items, the master data item serves as an index for querying the original data, and N is a positive integer; Randomly generate a primary associated item, and encrypt the primary associated item to generate N secondary associated items; Associate the main related item with the main data item to form a main data sub-table, and associate the subordinate related item with the subordinate data item one by one to form N subordinate data sub-tables; The random generation of the primary associated item, and the encryption of the primary associated item to generate N secondary associated items, includes: Randomly generate primary related items; The main associated item is encrypted to obtain intermediate data; The intermediate data is processed using the Shamir secret sharing algorithm to generate N related items.
2. The data anonymization method as described in claim 1, characterized in that, The data sub-table also includes: the dataset number corresponding to the data item, wherein all data items of the original data have the same dataset number.
3. The data anonymization method as described in claim 2, characterized in that, The dataset number is determined by the following steps: Calculate the summary value of the master data item; Using the summary value of the master data item, a modulo operation is performed on the preset dataset size to obtain the dataset number of the original data, and the dataset number of the original data is used as the dataset number of the slave data item.
4. A data query method, characterized in that, include: Receive and parse data query requests to obtain the index of the original data to be queried, wherein the original data includes a master data item and N slave data items, where N is a positive integer; In the de-identified data table, confirm the first master data item that is identical to the index; Based on the first master association item associated with the first master data item, obtain all first slave association items corresponding to the first master association item; wherein, all first slave association items corresponding to the first master association item are generated in advance by the first master data item using the Shamir secret sharing algorithm; Retrieve all slave data associated with the first slave item; The de-identified data table includes a master data sub-table and N slave data sub-tables. In the master data sub-table, master data items are associated with master related items one-to-one, and in the slave data sub-tables, slave data items are associated with slave related items one-to-one. N is a positive integer.
5. The data query method as described in claim 4, characterized in that, The data sub-table also includes: the dataset number corresponding to the data item, wherein all data items of the original data have the same dataset number.
6. The data query method as described in claim 5, characterized in that, In the de-identified data table, confirming the first master data item that is identical to the index includes: The index is used to calculate the dataset number to be queried from the original data; Retrieve each group of second related items belonging to the number of the dataset to be queried; Decrypt all the second secondary related items in each group to obtain each second primary related item; The index is compared with the master data item associated with each of the second master association items. When the comparison results are the same, the first master data item that is the same as the index is obtained.
7. The data query method as described in claim 6, characterized in that, The process of decrypting all second secondary related items in each group to obtain each second primary related item includes: By using the inverse operation of the Shamir secret sharing algorithm, all the associated items in each group are processed to recover each intermediate data; Each of the intermediate data is decrypted to obtain each second main related item.
8. The data query method as described in claim 6, characterized in that, The step of calculating the query dataset number of the original data using the index includes: Calculate the summary value of the index; Using the summary value of the index, a modulo operation is performed on the preset dataset size to obtain the dataset number to be queried.
9. A data anonymization device, characterized in that, include: The raw data acquisition module is used to acquire the raw data to be de-identified; wherein, the raw data includes a master data item and N slave data items, the master data item serves as an index for querying the raw data, and N is a positive integer; The association item generation module is used to randomly generate a main association item and encrypt the main association item to generate N secondary association items; The data desensitization module is used to associate the main related item with the main data item to form a main data sub-table, and to associate the subordinate related item with the subordinate data item one by one to form N subordinate data sub-tables; The random generation of the primary associated item, and the encryption of the primary associated item to generate N secondary associated items, includes: Randomly generate primary related items; The main associated item is encrypted to obtain intermediate data; The intermediate data is processed using the Shamir secret sharing algorithm to generate N related items.
10. A data query device, characterized in that, include: The index acquisition module is used to receive and parse data query requests and obtain the index of the original data to be queried, wherein the original data includes a main data item and N secondary data items, where N is a positive integer; The first master data item confirmation module is used to confirm the first master data item that is the same as the index in the de-identified data table; The first associated item acquisition module is used to acquire all first associated items corresponding to the first master associated item based on the first master associated item; wherein, all first associated items corresponding to the first master associated item are generated in advance by the first master data item using the Shamir secret sharing algorithm. The data acquisition module is used to acquire all data associated with all the first associated items; The de-identified data table includes a master data sub-table and N slave data sub-tables. In the master data sub-table, master data items are associated with master related items one-to-one, and in the slave data sub-tables, slave data items are associated with slave related items one-to-one. N is a positive integer.
11. An electronic device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the method as described in any one of claims 1 to 8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program; wherein, when the computer program is executed, it controls the device on which the computer-readable storage medium is located to perform the method as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Database multi-index method, apparatus and system
CN105488050A
Data desensitization method and device
CN107798253A