A data processing method, device, apparatus, storage medium, and product
By calculating the first string and watermark information of each row of data, a desensitization strategy is determined and the watermark information is embedded, which solves the problems of high implementation difficulty and easy failure of structured data watermarking algorithms, and realizes stable and privacy-preserving watermark information embedding.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2026-04-07
AI Technical Summary
Existing structured data watermarking algorithms are difficult to implement and are prone to failure due to primary key deletion, making them ineffective in tracking data leaks.
By calculating the first string of each row of data, a de-identification strategy is determined based on the string and watermark information. The watermark information is embedded without additional parameters. The key information is used to encrypt and sort the data to generate the watermark encoded bit value, thus generating a de-identification strategy watermark information table to resist primary key deletion attacks.
It achieves watermark information embedding without additional parameters, ensuring the stability of watermark information and reliable protection of privacy data, and avoiding watermark failure due to primary key deletion.
Smart Images

Figure CN119357928B_ABST
Abstract
Description
Technical Field
[0001] This application relates to, but is not limited to, the field of communications, and particularly to a data processing method, a data processing apparatus, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] Data has become the fifth major factor of production, following land, labor, capital, and technology. Currently, internet companies possess vast amounts of valuable data and need to circulate this data to generate greater value. However, once data leaves the internet, issues such as data leaks and resale may arise, making data traceability a challenge. Digital watermarking technology offers one solution.
[0003] Digital watermarking is an information security technology that embeds watermark information into digital carriers (such as digital images, digital videos, and structured data) using certain rules and algorithms to achieve purposes such as identifying digital copyright owners and tracking data breach perpetrators. Structured data watermarking is one type, primarily targeting structured datasets used by various systems or platforms that require external distribution. Structured datasets can be hosted in relational databases, Excel files, comma-separated values (CSV) files, and text (TXT) files, generally offering limited redundancy for watermark embedding.
[0004] Structured data watermarking primarily employs methods such as attribute modification, adding pseudo-rows, adding pseudo-columns, and modifying tuple order to embed watermark information. During embedding, parameters including grouping fields, embedding fields, and the number of groups need to be recorded; these are the anchor field and the field where the watermark is inserted. The same parameters must be used during extraction to retrieve the correct watermark information. Clearly, watermarking algorithms for structured data in related technologies suffer from significant implementation difficulties. Summary of the Invention
[0005] This application provides a data processing method, a data processing device, an electronic device, a computer-readable storage medium, and a computer program product, and provides a method for embedding and extracting structured data watermarks based on a desensitization strategy.
[0006] The technical solution of this application is implemented as follows:
[0007] In a first aspect, an embodiment of this application provides a data processing method, the method comprising:
[0008] Obtain the first dataset and watermark information;
[0009] Calculate the first string corresponding to each row of data in the first dataset;
[0010] Based on the first string and the watermark information, determine the desensitization strategy for the first field to be desensitized in each row of data;
[0011] Based on the aforementioned desensitization strategy, the data in the first field is desensitized to obtain the desensitized second dataset.
[0012] Secondly, an embodiment of this application provides a data processing apparatus, the information processing apparatus comprising:
[0013] The acquisition module is used to acquire the first dataset and watermark information;
[0014] The processing module is used to calculate the first string corresponding to each row of data in the first dataset;
[0015] The processing module is further configured to determine the desensitization strategy for the first field to be desensitized in each row of data based on the first string and the watermark information;
[0016] The processing module is further configured to de-identify the data in the first field based on the de-identification strategy, thereby obtaining a de-identified second dataset.
[0017] Thirdly, an electronic device provided in this application includes: a processor, a memory, and a communication bus;
[0018] Memory, used to store executable instructions;
[0019] A processor is configured to execute executable instructions stored in the memory to implement the steps of the data processing method described above.
[0020] Fourthly, embodiments of this application provide a computer-readable storage medium storing one or more programs, which can be executed by one or more processors to implement the steps of the data processing method described above.
[0021] Fifthly, an embodiment of this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the data processing method described above.
[0022] The above technical solution embeds the watermark information into the data carrier, i.e., the first dataset, without requiring any parameters other than the watermark information to be input. Therefore, it does not require recording parameters, thus solving the problem that the algorithms in related technologies are difficult to implement. Attached Figure Description
[0023] Figure 1 Flowchart of the data processing method provided in the embodiments of this application Figure 1;
[0024] Figure 2 Flowchart of the data processing method provided in the embodiments of this application Figure 2 ;
[0025] Figure 3 Flowchart of the data processing method provided in the embodiments of this application Figure 3 ;
[0026] Figure 4 Flowchart of the data processing method provided in the embodiments of this application Figure 4 ;
[0027] Figure 5 A schematic block diagram of a data processing apparatus provided in an embodiment of this application;
[0028] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of this application;
[0029] Figure 7 This is a schematic structural diagram of the chip provided in an embodiment of this application. Detailed Implementation
[0030] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0031] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0032] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0033] Embodiments of this application provide a data processing method applied to an electronic device, with reference to... Figure 1 As shown, the method includes the following steps:
[0034] Step 101: Obtain the first dataset and watermark information.
[0035] In this embodiment, the first dataset can be a collection of any number of data points, and this application does not impose any specific limitations on it. It should be noted that the first dataset can be the entire dataset or a portion of the entire dataset.
[0036] In this embodiment of the application, the watermark information can be any type of identification information that can identify the owner of the dataset, or any type of identification information selected by the owner of the dataset. This application does not impose any specific limitations on this.
[0037] Step 102: Calculate the first string corresponding to each row of data in the first dataset.
[0038] In this embodiment of the application, each row of data corresponds to a first string; the first string is a string obtained by performing a certain transformation on the data in one of the fields of each row of data.
[0039] It should be noted that when calculating the first string corresponding to different rows of data, the selected fields for each row of data can be completely different or partially different. That is, the selected fields are not fixed, but determined by calculation.
[0040] It should be noted that the field corresponding to the first string of each row of data is used as the anchor field. That is, the primary key is not used as the anchor field in this application. The anchor field is different for each row of data. Therefore, the solution proposed in this application can resist primary key deletion attacks and cannot make the watermark invalid by deleting the primary key.
[0041] Step 103: Based on the first string and watermark information, determine the desensitization strategy for the first field to be desensitized in each row of data.
[0042] It should be noted that the current need for watermarking technology stems from a business platform's requirement to share various types of data with third parties. The first field, such as the user identifier, being a sensitive field, requires anonymization. Therefore, a watermark is embedded into the first field during the business platform's data export process to achieve anonymization of sensitive data. Here, data anonymization refers to transforming certain sensitive information to reliably protect sensitive and private data.
[0043] In this embodiment of the application, the de-identification strategy represents the processing method of the data in the first field, such as replacement, masking, encryption, generalization, data segmentation, etc. For example, the masking method retains the first and last few digits and replaces the middle part with asterisks; the replacement method fills some digits with random characters; the generalization method rounds the value, etc.
[0044] In this embodiment of the application, the de-identification strategy corresponding to each row of data may be the same, partially the same, or completely different.
[0045] Step 104: Based on the desensitization strategy, desensitize the data in the first field to obtain the desensitized second dataset.
[0046] This application discloses a data processing method, which includes: acquiring a first dataset and watermark information; calculating a first string corresponding to each row of data in the first dataset; determining a desensitization strategy for a first field to be desensitized in each row of data based on the first string and the watermark information; and desensitizing the data in the first field based on the desensitization strategy to obtain a desensitized second dataset. In other words, the watermark information is embedded in the data carrier, i.e., the first dataset, without requiring any parameters other than the watermark information. Therefore, it eliminates the need to record parameters, solving the problem of high implementation difficulty inherent in related algorithms. Furthermore, this application does not use a primary key as an anchor field; the anchor field is different for each row of data, thus preventing the watermark from becoming invalid by deleting the primary key.
[0047] Embodiments of this application provide a data processing method applied to an electronic device, with reference to... Figure 2 As shown, the method includes the following steps:
[0048] Step 201: Obtain the first dataset and watermark information.
[0049] Step 202: Encrypt the data in the second field of each row of data in the first dataset to obtain the encrypted data.
[0050] In this embodiment of the application, the second field is all fields other than the first field.
[0051] In this embodiment, the electronic device uses key information to calculate the data in the second field to obtain a numerical value. The calculation method is not limited to key-related hash-based Message Authentication Code (HMAC) or stream cipher encryption.
[0052] It should be noted that this application introduces key information, which makes it impossible to calculate the sequence value without the key even if the calculation rules are known, and thus impossible to restore the watermark information.
[0053] Step 203: Sort each encrypted data to obtain sorted data.
[0054] Here, sorting each encrypted data item refers to sorting the encrypted values of each second field.
[0055] Step 204: Determine the first string from the sorted data that satisfies the first condition.
[0056] Among them, the data that meets the first condition includes the data corresponding to the maximum value in the sorted data, or the data corresponding to the minimum value in the sorted data.
[0057] Step 205: Based on the first string and the watermark information, determine the watermark encoding bit value corresponding to each line of data.
[0058] In some embodiments, step 205, determining the watermark encoding bit value corresponding to each row of data based on the first string and the watermark information, can be achieved through the following steps:
[0059] Step A1: Obtain the preset remainder value; it should be noted that the preset remainder value is determined by the watermark encoding method and can be set to a fixed value (e.g., 60, 100, 1000, etc.).
[0060] Step A2: Encode the watermark information to obtain the first encoding result; here, the watermark information is encoded based on the watermark encoding method to obtain the first encoding result. The watermark encoding method includes, but is not limited to, using hexadecimal encoding to form a byte stream, or using the Chinese Remainder Theorem to form fragmented values.
[0061] Step A3: Take the remainder of the first string and the remainder value to obtain the sequence value corresponding to each row of data.
[0062] Step A4: Fill in the first encoding result to obtain the second encoding result; wherein the number of bits in the second encoding result is the same as the number of bits in the remainder value.
[0063] Step A5: Determine the watermark encoding bit value based on the sequence value and the second encoding result;
[0064] Here, the bit value corresponding to the i-th bit in the second encoding result is determined to be the watermark encoding bit value; where i is equal to the sequence value and i is a positive integer.
[0065] Step 206: Determine the desensitization strategy for the first field based on the watermark encoding bit value.
[0066] In some embodiments, the electronic device first obtains first information; wherein the first information includes at least two de-identification strategies corresponding to a first field in a first dataset; and the de-identification strategy of the first field is matched from the first information based on the watermark encoding bit value.
[0067] It should be noted that the first piece of information can be represented as a de-identification strategy watermark information table. This de-identification strategy watermark information table will include the de-identification strategy and the watermark encoding bit value corresponding to each de-identification strategy; that is, there is a mapping relationship between the watermark encoding bit value and the de-identification strategy.
[0068] Step 207: Based on the desensitization strategy, desensitize the data in the first field to obtain the desensitized second dataset.
[0069] This application generates a desensitization strategy watermark information table based on the desensitized fields, then performs a specific transformation on each field of each row of data and sorts them, taking the remainder of the largest / smallest field to obtain the sequence value of each row of data; based on the sequence value of each row of data, the corresponding watermark encoding sequence value is determined; finally, based on the watermark information encoding sequence value, the desensitization strategy is obtained, and the data is desensitized.
[0070] It should be noted that the descriptions of the same steps and contents as in other embodiments in this embodiment can be found in the descriptions in other embodiments, and will not be repeated here.
[0071] Embodiments of this application provide a data processing method applied to an electronic device, with reference to... Figure 3 As shown, the method includes the following steps:
[0072] Step 301: Determine the sequence pairs for each row of data in the second dataset; wherein, the sequence pair includes the sequence value corresponding to each row of data and the watermark encoding bit value corresponding to each row of data.
[0073] In some embodiments, step 301, determining the sequence pairs of each row of data in the second dataset, can be achieved through the following steps:
[0074] Step B1: Based on the content of the first field of each row of data in the second dataset and the desensitization strategy of the first field of each row of data, determine the watermark encoding bit value in the sequence pair;
[0075] Step B2: Calculate the second string corresponding to each row of data in the second dataset;
[0076] Here, the data in the second field of each row of data in the second dataset is encrypted to obtain encrypted data; each encrypted data is sorted to obtain sorted data; the data in the sorted data that meets the first condition is determined to be the second string; wherein, the data that meets the first condition includes the data corresponding to the maximum value in the sorted data, or the data corresponding to the minimum value in the sorted data.
[0077] Step B3: Based on the second string, determine the sequence value in the sequence pair.
[0078] Here, based on the second string, the sequence value in the sequence pair can be determined by the following steps: obtain the preset modulo value; take the modulo of the second string and the modulo value to obtain the sequence value in the sequence pair.
[0079] Step 302: Restore the watermark information based on the sequence pairs of each row of data.
[0080] In this embodiment, the extraction process corresponding to steps 301 to 302 is the reverse of the embedding process in steps 201 to 207, only the order of the steps is slightly different; that is, for each row of data, according to the desensitization rules of the desensitized fields, combined with the desensitization strategy watermark information table, the watermark encoding sequence value of that row is obtained. Then, each field is transformed in a specific way and sorted, and the sequence value of each row of data is obtained by taking the remainder of the largest / smallest field, and the sequence value and watermark encoding sequence value pair are recorded. The watermark encoding information is statistically obtained, and the watermark information is restored by combining the watermark encoding method.
[0081] It should be noted that for the same sequence value, the final watermark encoding bit value (i.e., the watermark encoding bit value with the highest count) is obtained through a counting method. All watermark encoding bit values are then combined with the watermark encoding method to reconstruct the watermark information.
[0082] under, Figure 4 This will illustrate an exemplary application of the watermark embedding technology of this application in a practical application scenario; such as... Figure 4 As shown:
[0083] Step 401: Generate a watermark information table for the desensitization strategy based on the desensitized fields.
[0084] It should be noted that the de-identified fields refer to the fields in the dataset that need to be de-identified. Different de-identification methods can be used depending on the field type. Different methods can generate corresponding de-identification strategy watermark information tables. Each specific de-identification rule in the information table corresponds to a watermark code, and at least two de-identification rules are required. Each watermark code consists of 0s and 1s, and the number of bits is determined by the total number of de-identification rules (take a power of 2 less than the total number; for example, if the total number is 3, take 1 bit; if the total number is 4, take 2 bits).
[0085] For example, the original dataset is shown in Table 1, where the "phone" field is an anonymized field:
[0086] time phone msg_id …… rtt_id 20220227165941 8618215111380 178689490 …… 96001057 20220227165943 8618737231650 177105056 …… 92001002 20220227165942 8613750410005 177105088 …… 92005310 …… …… …… …… …… 20220227170142 8613663918995 177105028 …… 92001002
[0087] Table 1
[0088] For example, using the masking method, four desensitization rules can be generated, corresponding to watermark codes of 00, 01, 10, and 11. The generated desensitization strategy watermark information table 2 is as follows.
[0089] Desensitization rules Watermark Encoding Information Replace the 5th to 8th digits from the bottom with asterisks. 00 Replace the 6th to 9th digits from the bottom with asterisks. 01 Replace the 5th to 7th digits from the bottom with asterisks. 10 Replace the 6th to 8th digits from the bottom with asterisks. 11
[0090] Table 2
[0091] For example, for the number 8618215111380, the following desensitization rules are applied: replacing the 5th to 8th digits from the bottom with asterisks, resulting in 86182****1380; replacing the 6th to 9th digits from the bottom with asterisks, resulting in 8618****11380; replacing the 5th to 7th digits from the bottom with asterisks, resulting in 861821***1380; and replacing the 6th to 8th digits from the bottom with asterisks, resulting in 86182***11380.
[0092] For example, by using the replacement method to replace the middle 4 digits of a mobile phone number with random numbers, two desensitization rules can be generated, corresponding to watermark codes of 0 and 1. The generated desensitization strategy watermark information is shown in Table 3 below.
[0093] Desensitization rules Watermark Encoding Information Take a random number that is larger than the last four digits. 1 Take a random number smaller than the last four digits. 0
[0094] Table 3
[0095] For example, for 8618215111380, the desensitization rule is to take a random number larger than the last four digits, resulting in 8618252891380; the desensitization rule is to take a random number smaller than the last four digits, resulting in 8618203751380.
[0096] Step 402: Perform a specific transformation on each field of each row of data except for the desensitized field, then sort the data and calculate the sequence value of each row of data and the corresponding watermark encoding sequence value.
[0097] a) A specific transformation refers to using key information to calculate a numerical value from the field content. The calculation method is not limited to HMAC, stream cipher encryption, etc. The use of key information ensures that even if the calculation rules are known, the sequence value cannot be calculated without the key, and therefore the watermark information cannot be recovered.
[0098] b) After sorting the values, select the minimum value (which can also be the maximum value), and take the remainder to obtain the sequence value. The remainder value is determined by the watermark encoding method and is set to a fixed value (e.g., 60, 100, 1000, etc.). The encoding method includes, but is not limited to, using hexadecimal encoding to form a byte stream, or using the Chinese Remainder Theorem to form fragmented values.
[0099] c) Based on the sequence value, extract the watermark encoding sequence value corresponding to the watermark encoding information.
[0100] A specific implementation method could be as follows: For example, perform calculations on the first row of data in the original dataset, assuming the calculation method uses HMAC and the key is "cmcc"; perform HMAC calculations on "20220227165941", "178689490", and "96001057" to obtain "2c23eeadb7757e68ca5aadca69edf17d", "b9fa024c4eab005ed6054971442456b5", and "a979e8482d4657ed6d0f1ac6b77c0537", sort the results and take the minimum value as "2c23eeadb7757e68ca5aadca69edf17d".
[0101] Assuming the watermark information is "cmri0702", the watermark encoding method is to convert it into a binary byte stream "1100011011011010111001001101001001100000011011100110000000000000. Using the random data substitution method, the remainder is set to 100, and the byte stream is filled with "00000000000000000000000000000000000011000110110110110101110010011010011000001101110011000000000000". Taking the remainder yields a sequence value of "86". Combining this with the random data substitution method in step 401, the corresponding watermark encoding sequence value is "1".
[0102] Step 403: Based on the watermark information encoding sequence value corresponding to the data in that row, obtain the desensitization strategy and desensitize the data.
[0103] The specific implementation method, for example, is based on the watermark encoding sequence value calculated in step 402 being "1", corresponding to the desensitization strategy in step 401, watermark information table 3, which is "take a random number larger than the last four digits"; that is, the first line of the original information:
[0104] 20220227165941 8618215111380 178689490……96001057
[0105] After desensitization, the updated information is: 20220227165941 8618252891380 178689490……96001057
[0106] The main steps of the watermark extraction scheme are:
[0107] Step C1: For each row of data, based on the desensitization rules of the desensitized field and in conjunction with the desensitization strategy watermark information table, obtain the watermark encoding sequence value for that row.
[0108] Specific implementation methods, for example, for row data after embedding watermark information: 202202271659418618252891380 178689490……96001057
[0109] The desensitization rule used for the desensitized field content "8618252891380" is "take a random number that is larger than the last four digits", so the watermark encoding sequence value is "1".
[0110] Step C2: After performing a specific transformation on each field, sort the data, calculate the sequence value of each row of data, and record the sequence value and watermark encoded sequence value pair.
[0111] a) A specific transformation refers to using key information to calculate the field content to obtain a numerical value. The calculation method is not limited, as long as it is consistent with the embedding method.
[0112] b) After sorting the values, select the minimum value (or the maximum value, consistent with the embedding process), and take the remainder to obtain the sequence value. The remainder value is determined by the watermark encoding method. Since the watermark encoding method is not the focus of this solution, it will not be detailed further; it should remain consistent with the embedding process.
[0113] c) Combine the sequence value with the watermark-encoded sequence value obtained in B1 to form a sequence value pair and record it.
[0114] The specific implementation method maintains the same calculation method as during embedding, using HMAC with the key "cmcc", corresponding to the random data replacement method, and a remainder value of 100. For the row data in B1 after embedding the watermark information, perform HMAC calculation on "20220227165941", "178689490", "96001057", etc., to obtain "2c23eeadb7757e68ca5aadca69edf17d", "b9fa024c4eab005ed6054971442456b5", "a979e8482d4657ed6d0f1ac6b77c0537", sort them, and take the minimum value "2c23eeadb7757e68ca5aadca69edf17d". The remainder gives a sequence value of "86", resulting in a sequence value and watermark encoded sequence value pair of {86, 1}.
[0115] Step C3: Obtain the watermark encoding information statistically, and restore the watermark information by combining the watermark encoding method.
[0116] For the same sequence value, the final watermark encoded sequence value (i.e., the watermark encoded sequence value with the highest count) is obtained through a counting method. All watermark encoded sequence values are then combined with the watermark encoding method to reconstruct the watermark information.
[0117] Embodiments of this application provide a data processing apparatus that can be used to implement... Figures 1 to 3 A corresponding embodiment provides a data processing method, referring to... Figure 5 As shown, the data processing device 500 includes:
[0118] Module 501 is used to acquire the first dataset and watermark information;
[0119] Processing module 502 is used to calculate the first string corresponding to each row of data in the first dataset;
[0120] The processing module 502 is also used to determine the desensitization strategy of the first field to be desensitized in each row of data based on the first string and watermark information;
[0121] The processing module 502 is also used to de-identify the data in the first field based on the de-identification strategy to obtain the de-identified second dataset.
[0122] In other embodiments of this application, the processing module 502 is used to determine the sequence pairs of each row of data in the second dataset; wherein, the sequence pair includes the sequence value corresponding to each row of data and the watermark encoding bit value corresponding to each row of data;
[0123] Processing module 502 is used to restore watermark information based on sequence pairs of each row of data.
[0124] In other embodiments of this application, the processing module 502 is used to determine the watermark encoding bit value corresponding to each line of data based on the first string and the watermark information;
[0125] The processing module 502 is also used to determine the desensitization strategy of the first field based on the watermark encoding bit value.
[0126] In other embodiments of this application, the acquisition module 501 is used to acquire first information; wherein, the first information includes at least two de-identification strategies corresponding to the first field in the first dataset;
[0127] The processing module 502 is used to determine the desensitization strategy of the first field by matching the desensitization strategy of the first field from the first information based on the watermark encoding bit value.
[0128] In other embodiments of this application, the processing module 502 is used to encrypt the data in the second field of each row of data in the first dataset to obtain encrypted data;
[0129] Processing module 502 is used to sort each encrypted data to obtain sorted data;
[0130] The processing module 502 is used to determine the data in the sorted data that satisfies a first condition as the first string; wherein, the data that satisfies the first condition includes the data corresponding to the maximum value in the sorted data, or the data corresponding to the minimum value in the sorted data.
[0131] In other embodiments of this application, the acquisition module 501 is used to acquire a preset remainder value;
[0132] Processing module 502 is used to encode watermark information to obtain the first encoding result;
[0133] Processing module 502 is used to take the remainder of the first string and the remainder value to obtain the sequence value corresponding to each row of data;
[0134] Processing module 502 is used to fill the first encoding result to obtain the second encoding result; wherein the number of bits in the second encoding result is the same as the number of bits in the remainder value;
[0135] Processing module 502 is used to determine the watermark encoding bit value based on the sequence value and the second encoding result.
[0136] In other embodiments of this application, the processing module 502 is used to determine the watermark encoding bit value in the sequence pair based on the content of the first field of each row of data in the second dataset and the desensitization strategy of the first field of each row of data.
[0137] Processing module 502 is used to calculate the second string corresponding to each row of data in the second dataset;
[0138] Processing module 502 is used to determine the sequence value in the sequence pair based on the second string.
[0139] In other embodiments of this application, the processing module 502 is used to encrypt the data in the second field of each row of data in the second dataset to obtain encrypted data;
[0140] Processing module 502 is used to sort each encrypted data to obtain sorted data;
[0141] The processing module 502 is used to determine that the data in the sorted data that meets the first condition is the second string; wherein, the data that meets the first condition includes the data corresponding to the maximum value in the sorted data, or the data corresponding to the minimum value in the sorted data.
[0142] In other embodiments of this application, the acquisition module 501 is used to acquire a preset remainder value;
[0143] Processing module 502 is used to take the remainder of the second string and the remainder value to obtain the sequence value in the sequence pair.
[0144] In other embodiments of this application, the processing module 502 is used to determine that the bit value corresponding to the i-th bit in the second encoding result is the watermark encoding bit value; where i is equal to the sequence value and i is a positive integer.
[0145] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0146] It should be noted that, in the embodiments of this application, if the above-described data processing method is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a terminal device to execute all or part of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0147] Figure 6 This is a schematic structural diagram of an electronic device 600 provided in an embodiment of this application. The communication device can be a data processing apparatus. Figure 6 The illustrated electronic device 600 includes a first processor 610, which can call and run computer programs from memory to implement the methods in the embodiments of this application.
[0148] Optionally, such as Figure 6 As shown, the electronic device 600 may further include a first memory 620. The first processor 610 can call and run computer programs from the first memory 620 to implement the methods in the embodiments of this application.
[0149] The first memory 620 can be a separate device independent of the first processor 610, or it can be integrated into the first processor 610.
[0150] Optionally, such as Figure 6 As shown, the electronic device 600 may also include a transceiver 630, which the first processor 610 can control to communicate with other devices. Specifically, it can send information or data to other devices or receive information or data sent by other devices.
[0151] The transceiver 630 may include a transmitter and a receiver. The transceiver 630 may further include antennas, and the number of antennas may be one or more.
[0152] Optionally, the electronic device 600 may specifically be a data processing device in the embodiments of this application, and the electronic device 600 may implement the corresponding processes implemented by the data processing device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.
[0153] Figure 7 This is a schematic structural diagram of the chip according to an embodiment of this application. Figure 7 The chip 700 shown includes a second processor 710, which can call and run computer programs from memory to implement the methods in the embodiments of this application.
[0154] Optionally, such as Figure 7 As shown, chip 700 may further include a second memory 720. The second processor 710 can retrieve and run computer programs from the second memory 720 to implement the methods described in this embodiment.
[0155] The second memory 720 can be a separate device independent of the second processor 710, or it can be integrated into the second processor 710.
[0156] Optionally, the chip 700 may also include an input interface 730. The second processor 710 can control the input interface 730 to communicate with other devices or chips; specifically, it can acquire information or data sent by other devices or chips.
[0157] Optionally, the chip 700 may also include an output interface 740. The second processor 710 can control the output interface 740 to communicate with other devices or chips, specifically, to output information or data to other devices or chips.
[0158] Optionally, the chip can be applied to the data processing device / electronic device in the embodiments of this application, and the chip can implement the corresponding processes implemented by the data processing device / electronic device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.
[0159] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0160] It should be understood that the processor in the embodiments of this application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor described above can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0161] As one embodiment, the processor may include one or more general-purpose central processing units (CPUs). Each of these processors may be a single-core processor or a multi-core processor. Here, "processor" may refer to one or more devices, circuits, and / or processing cores used for processing data (e.g., executing instructions).
[0162] It is understood that the memory in the embodiments of this application can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be ROM, Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), or flash memory. The volatile memory can be Random Access Memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DR RAM). It should be noted that the memory used in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0163] It should be understood that the above-described memory is exemplary and not a limiting description. For example, the memory in the embodiments of this application may also be static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DR RAM), etc. That is to say, the memory in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0164] This application also provides a computer-readable storage medium for storing computer programs.
[0165] The computer-readable storage medium can be applied to the data processing apparatus / electronic device in the embodiments of this application, and the computer program causes the computer to execute the corresponding processes implemented by the data processing apparatus / electronic device in the various methods of the embodiments of this application. For the sake of brevity, it will not be described in detail here.
[0166] This application also provides a computer program product, including a computer program that can be executed by the processor of an electronic device 600 to perform the steps described in any of the foregoing methods.
[0167] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0168] A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0169] The data processing method, data processing apparatus, electronic device, computer-readable storage medium, and computer program product provided in the embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
[0170] It should be understood that the phrases "an embodiment," "an embodiment," "an embodiment of this application," "the foregoing embodiment," "some implementations," or "some embodiments" mentioned throughout the specification mean that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, the phrases "an embodiment," "an embodiment," "an embodiment of this application," "the foregoing embodiment," "some implementations," or "some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.
[0171] Unless otherwise specified, any step performed by the data processing device / electronic device in the embodiments of this application may be performed by the processor of the data processing device / electronic device. Unless otherwise specified, the embodiments of this application do not limit the order in which the data processing device / electronic device performs the following steps. Furthermore, the methods used to process data in different embodiments may be the same or different methods.
[0172] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0173] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0174] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0175] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0176] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0177] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0178] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0179] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0180] The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0181] It should be noted that in the various embodiments involved in this application, all steps or some steps may be performed, as long as a complete technical solution can be formed.
[0182] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data processing method, characterized in that, The method includes: Obtain the first dataset and watermark information; Encrypt the data in the second field of each row of data in the first dataset to obtain the encrypted data; Each encrypted data is sorted to obtain sorted data, and the data in the sorted data that satisfies a first condition is determined to be the first string; wherein, the data that satisfies the first condition includes the data corresponding to the maximum value in the sorted data, or the data corresponding to the minimum value in the sorted data; Obtain a preset remainder value, encode the watermark information, and obtain a first encoding result; The sequence value corresponding to each row of data is obtained by taking the remainder of the first string and the remainder value; The first encoding result is filled to obtain the second encoding result; wherein the number of bits in the second encoding result is the same as the number of bits in the remainder value; Based on the sequence value and the second encoding result, the watermark encoding bit value is determined; Based on the watermark encoded bit value, determine the desensitization strategy for the first field; Based on the aforementioned desensitization strategy, the data in the first field is desensitized to obtain the desensitized second dataset. Determine the sequence pair for each row of data in the second dataset; wherein, the sequence pair includes the sequence value corresponding to each row of data and the watermark encoding bit value corresponding to each row of data; The watermark information is restored based on the sequence pairs of each row of data.
2. The method according to claim 1, characterized in that, The step of determining the desensitization strategy for the first field based on the watermark encoded bit value includes: Obtain first information; wherein, the first information includes at least two de-identification strategies corresponding to the first field in the first dataset; Based on the watermark encoded bit value, the desensitization strategy of the first field is matched from the first information.
3. The method according to claim 1, characterized in that, Determining the sequence pairs of each row of data in the second dataset includes: Based on the content of the first field of each row of data in the second dataset and the desensitization strategy of the first field of each row of data, the watermark encoding bit value in the sequence pair is determined; Calculate the second string corresponding to each row of data in the second dataset; Based on the second string, determine the sequence value in the sequence pair.
4. The method according to claim 3, characterized in that, The calculation of the second string corresponding to each row of data in the second dataset includes: Encrypt the data in the second field of each row in the second dataset to obtain the encrypted data; Sort each encrypted data item to obtain the sorted data. The data in the sorted data that satisfies the first condition is determined to be the second string; wherein, the data that satisfies the first condition includes the data corresponding to the maximum value in the sorted data, or the data corresponding to the minimum value in the sorted data.
5. The method according to claim 4, characterized in that, Determining the sequence value in the sequence pair based on the second string includes: Get the preset remainder value; The sequence value in the sequence pair is obtained by taking the remainder of the second string and the remainder value.
6. The method according to claim 1, characterized in that, Determining the watermark encoded bit value based on the sequence value and the second encoding result includes: The bit value corresponding to the i-th bit in the second encoding result is determined to be the watermark encoded bit value; wherein, i is equal to the sequence value, and i is a positive integer.
7. A data processing apparatus, characterized in that, The data processing device includes: The acquisition module is used to acquire the first dataset and watermark information; The processing module is configured to: encrypt the data in the second field of each row of data in the first dataset to obtain encrypted data; sort each encrypted data to obtain sorted data; determine the data in the sorted data that satisfies a first condition as a first string; wherein the data satisfying the first condition includes the data corresponding to the maximum value or the data corresponding to the minimum value in the sorted data; obtain a preset remainder value, encode the watermark information to obtain a first encoding result; take the remainder of the first string and the remainder value to obtain the sequence value corresponding to each row of data; and fill the first encoding result. The second encoding result is obtained; wherein the number of bits in the second encoding result is the same as the number of bits in the remainder value; based on the sequence value and the second encoding result, the watermark encoding bit value is determined; based on the watermark encoding bit value, the desensitization strategy for the first field is determined; the processing module is further configured to desensitize the data in the first field based on the desensitization strategy to obtain a desensitized second dataset; determine the sequence pair of each row of data in the second dataset; wherein the sequence pair includes the sequence value corresponding to each row of data and the watermark encoding bit value corresponding to each row of data; and restore the watermark information based on the sequence pair of each row of data.
8. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the data processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the data processing method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the data processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Sensitive data desensitization method and device based on cloud service and medium
CN116318991A
Watermark processing method and device and storage medium
CN117911227A