Data watermark generation method and device, data tracing method and device
By encrypting and encoding the structured data, the watermark information is integrated into the decimal data, the problem of poor watermark information hiding in the prior art is solved, and the watermark hiding and traceability accuracy of the data content is achieved.
Patent Information
- Application Number
- CN202111480224.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-06
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2041-12-06
AI Technical Summary
It is difficult for existing data watermark technology to hide the watermark information in the data itself without changing the original data, and the added watermark is easily deleted and affects the business functions.
By encrypting the original structured data and converting it into decimal data, encoding it using MD5 algorithm and set calculation rules, watermark information is generated and incorporated into binary data, ensuring that the watermark information is invisible and does not affect the data content.
It realizes hiding watermark information without changing the data content, improves the robustness and traceability accuracy of the data, and avoids the risk of watermark information being deleted.
Smart Images

Figure CN114186252B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data security technology, and in particular to a data watermark generation method and device, and a data source tracing method and device. Background Art
[0002] With the introduction of the Data Security Protection Law, major companies are paying more and more attention to data security, and are also paying more and more attention to data security watermark traceability technology. Traditional data watermarking technology includes character replacement and adding invisible characters. Character replacement will change the original data and affect the business function of the watermarked data. For adding invisible characters, many editors can still see spaces or even symbols similar to boxes, which are easy to delete.
[0003] In the related art, the invention patent application with patent application number 201711230809.3 discloses a watermark image generation method, device and storage device. The watermark image generation method includes encrypting the original coded data, converting the encrypted data into binary data, iteratively processing the binary data to obtain the watermark image. The data generated by the existing coding technology is converted into irregular random sequence points through a unique algorithm, which has the characteristics of high security, anti-copying, and embeddability.
[0004] However, the watermark image generation method is to iteratively process the encoded data to generate a coding schematic diagram, namely the watermark image, and embed the watermark image into the original image. In essence, it is an image watermark technology, not a data dark watermark technology. Summary of the invention
[0005] The technical problem to be solved by the present invention is how to hide watermark information in the data itself without changing the original data.
[0006] The present invention solves the above technical problems through the following technical means:
[0007] In a first aspect, an embodiment of the present invention provides a data watermark generation method, the method comprising:
[0008] Each row of the original structured data is encrypted and converted into decimal data to obtain m decimal data, where m is the number of rows of the original structured data;
[0009] Encode the m decimal data to obtain m encoding results, each of which is 0 or 1;
[0010] According to the pre-generated watermark information, the m encoding results are arranged to integrate the watermark information into the encoded binary data to obtain watermark data, where each bit of the watermark information is 0 or 1.
[0011] The present invention can hide watermark information in the data itself without changing the original data content. The data after adding the watermark will not affect the business function, and there is no need to add additional characters. The added characters will not be discovered and deleted, and the robustness is strong.
[0012] Furthermore, the step of encrypting each row of the original structured data and converting it into decimal data includes:
[0013] Each row of the original structured data is encrypted using the MD5 algorithm to obtain m character strings, each of which is 32 bits long and each character is in hexadecimal.
[0014] Convert the m character strings into m decimal data.
[0015] Furthermore, the m pieces of decimal data are encoded to obtain m encoding results, including:
[0016] Calculate the m decimal data using a set calculation rule to obtain m calculation results, wherein the set calculation rule is to add odd-digit data and multiply even-digit data;
[0017] The m calculation results are divided by 2 and the remainder is taken to obtain m encoding results.
[0018] Furthermore, the watermark information is n-bit watermark information, which is generated by a random algorithm.
[0019] Furthermore, according to the pre-generated watermark information, the m encoding results are arranged to integrate the watermark information into the encoded binary data to obtain watermark data, including:
[0020] Traversing m encoding results;
[0021] The encoding results are arranged according to the state of each bit of the watermark information, and every n encoding results constitute a watermark information, until all the m encoding results are arranged to obtain the watermark data.
[0022] In a second aspect, an embodiment of the present invention provides a data watermark generation device, the device comprising:
[0023] A conversion module, used for encrypting each row of the original structured data and converting it into decimal data to obtain m decimal data, where m is the number of rows of the original structured data;
[0024] A first encoding module, used for encoding the m pieces of decimal data to obtain m encoding results, each of which is 0 or 1;
[0025] The watermark generation module is used to arrange the m encoding results according to the pre-generated watermark information so as to integrate the watermark information into the encoded binary data, and each bit of the watermark information is 0 or 1.
[0026] Furthermore, the first encoding module includes:
[0027] A calculation unit, used to calculate the m decimal data using a set calculation rule to obtain m calculation results, wherein the set calculation rule is to add odd-digit data and multiply even-digit data;
[0028] The first encoding unit is used for dividing the m calculation results by 2 and taking modulos respectively to obtain m encoding results.
[0029] In a third aspect, an embodiment of the present invention provides a data tracing method for tracing the watermark data generated by the data watermark generation method as described above, the method comprising:
[0030] Get the leaked watermark data;
[0031] Encoding the watermark data to obtain a traceability encoding result;
[0032] Arranging the traceability encoding results according to the order of the watermark data to obtain a data information chain;
[0033] comparing the data information chain with the watermark information;
[0034] When the same fragment as that in the watermark information exists in the data information chain, it is determined that the tracing is successful.
[0035] Since the watermark information added to the watermark data does not change the original data structure and is invisible, it greatly improves the accuracy of traceability.
[0036] Furthermore, encoding the watermark data to obtain a traceability encoding result includes:
[0037] Each line of the watermark data is encrypted and converted into decimal data;
[0038] The decimal data is calculated using the set calculation rule and then divided by 2 to obtain the remainder, thereby obtaining the traceability coding result.
[0039] In a fourth aspect, an embodiment of the present invention provides a data tracing device, the device comprising:
[0040] An acquisition module, used to obtain leaked watermark data;
[0041] A second encoding module is used to encode the watermark data to obtain a traceability encoding result;
[0042] An arrangement module, used for arranging the traceability encoding results according to the order of the watermark data to obtain a data information chain;
[0043] A comparison module, used for comparing the data information chain with the watermark information;
[0044] The determination module is used to determine that the tracing is successful when there is a fragment in the data information chain that is the same as the fragment in the watermark information.
[0045] The advantages of the present invention are:
[0046] (1) Each row of structured data is encrypted and converted into decimal data, the decimal data is encoded, and the encoding result corresponding to each row of data is obtained, and watermark information is generated in advance. The watermark information and the encoding result are both 0 or 1. According to each bit state of the watermark information, the encoding result is arranged to integrate the watermark information into the binary data to obtain the watermark data. The present invention can hide the watermark information in the data itself without changing the original data content. The data after adding the watermark will not affect the business function, and there is no need to add additional characters. The added characters will not be discovered and deleted, and the robustness is strong.
[0047] (2) Encoding is performed on the leaked watermark data, and the encoding results are arranged in the order of the data to form a data information chain. The data information chain is compared with the watermark information. If the same watermark information fragment exists, the traceability is determined to be successful. Since the watermark information added to the watermark data does not change the original data structure and is invisible, the accuracy of traceability is greatly improved.
[0048] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 is a flow chart of a data watermark generation method in a first embodiment of the present invention;
[0050] Figure 2 This is an information coding effect diagram in the first embodiment of the present invention;
[0051] Figure 3 is a structural diagram of a data watermark generating device in a second embodiment of the present invention;
[0052] Figure 4 is a flow chart of a data tracing method in a third embodiment of the present invention;
[0053] Figure 5 It is a structural diagram of the data tracing device in the fourth embodiment of the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] Example 1
[0056] like Figure 1 As shown, the embodiment of the present invention discloses a data watermark generation method, comprising the following steps:
[0057] S1. Each row of original structured data is encrypted and converted into decimal data to obtain m decimal data, where m is the number of rows of the original structured data.
[0058] It should be noted that this embodiment is for adding watermark information to structured data. The structured data is in two-dimensional form. The data is in lines. A line of data represents the information of an entity. The attributes of each line of data are the same.
[0059] S2. Encode the m decimal data to obtain m encoding results, each of which is 0 or 1.
[0060] It should be noted that in programming languages, all information will eventually be classified as binary code, so the result of encoding decimal data is to convert the data into two states: 0 or 1. The encoding result is as follows: Figure 2 As shown, str is the data to be watermarked, and value is the value of 0 or 1 generated by the watermark algorithm. Figure 2 An example of 20 rows of data is shown in Figure 1.
[0061] S3. Arrange the m encoding results according to the pre-generated watermark information to integrate the watermark information into the encoded binary data to obtain watermark data, where each bit of the watermark information is 0 or 1.
[0062] It should be noted that each bit of the watermark information consists of binary 0 or 1. The structured data is converted into two states, 0 or 1, through information encoding. The data encoding results can be arranged and processed according to the state of each bit of the watermark information until all the data encoding results are processed. Finally, the watermark information will be completely integrated into the data, but the data content has not been changed. The data after adding the watermark will not affect the business function.
[0063] In some embodiments, step S1 includes the following steps:
[0064] S11. Use the MD5 algorithm to encrypt each line of the original structured data to obtain m character strings, each of which is 32 bits long and each character is in hexadecimal.
[0065] S12, converting the m character strings into m decimal data.
[0066] In some embodiments, step S2 comprises the following steps:
[0067] S21. Calculate the m decimal data using a set calculation rule to obtain m calculation results, wherein the set calculation rule is to add odd-digit data and multiply even-digit data.
[0068] S22. Divide the m calculation results by 2 and take the remainder respectively to obtain m encoding results.
[0069] In some embodiments, the watermark information is n-bit watermark information, which is generated using a random algorithm.
[0070] It should be noted that the watermark information in this embodiment is 20 bits, and those skilled in the art may use a random algorithm to generate watermark information of different bits according to actual conditions, which is not limited in this embodiment.
[0071] In some embodiments, step S3 includes:
[0072] S31, traverse m encoding results.
[0073] S32. Arrange the encoding results according to the state of each bit of the watermark information, and every n encoding results constitute a watermark information, until all the m encoding results are arranged to obtain the watermark data.
[0074] It should be noted that the encoding results of the data are arranged according to the status of each bit of the watermark information. One watermark information can be arranged for every 20 data pieces until all the encoding results are processed. The watermark information will be completely integrated into the data, but the data content will not be changed.
[0075] Example 2
[0076] like Figure 3 As shown, the second embodiment of the present invention discloses a data watermark generating device, the device comprising:
[0077] Conversion module 1, used for encrypting each row of original structured data and converting it into decimal data to obtain m decimal data, where m is the number of rows of the original structured data;
[0078] A first encoding module 2, used for encoding the m decimal data to obtain m encoding results, each of which is 0 or 1;
[0079] The watermark generation module 3 is used to arrange the m encoding results according to the pre-generated watermark information so as to integrate the watermark information into the encoded binary data, and each bit of the watermark information is 0 or 1.
[0080] In some embodiments, the first encoding module 20 includes:
[0081] A calculation unit, used to calculate the m decimal data using a set calculation rule to obtain m calculation results, wherein the set calculation rule is to add odd-digit data and multiply even-digit data;
[0082] The first encoding unit is used for dividing the m calculation results by 2 and taking modulos respectively to obtain m encoding results.
[0083] In some embodiments, the watermark generation module 30 includes:
[0084] A traversal unit, used for traversing the m encoding results;
[0085] An arranging unit is used to arrange the encoding results according to the state of each bit of the watermark information, and every n encoding results constitute a watermark information until all the m encoding results are arranged to obtain the watermark data.
[0086] Example 3
[0087] like Figure 4 As shown, the third embodiment of the present invention discloses a data tracing method for tracing the watermark data generated by the data watermark generation method of the above embodiment, and the method comprises the following steps:
[0088] S10. Obtain leaked watermark data.
[0089] S20: Encode the watermark data to obtain a traceability encoding result.
[0090] S30: Arrange the traceability coding results according to the order of the watermark data to obtain a data information chain.
[0091] S40: Compare the data information chain with the watermark information.
[0092] S50: When there is a fragment in the data information chain that is identical to the fragment in the watermark information, it is determined that the tracing is successful.
[0093] In some embodiments, step S20 includes the following steps:
[0094] S201, encrypting each line of the watermark data and converting it into decimal data;
[0095] S202, using the set calculation rule to calculate the decimal data and then dividing by 2 to obtain the remainder, to obtain the traceability coding result.
[0096] It should be noted that the data encoding method used in this embodiment is the same as the data encoding method in the above-mentioned embodiment 1, and will not be described in detail here.
[0097] Example 4
[0098] like Figure 5 As shown, the fourth embodiment of the present invention discloses a data tracing device, the device comprising:
[0099] An acquisition module 10, used to acquire leaked watermark data;
[0100] The second encoding module 20 is used to encode the watermark data to obtain a traceability encoding result;
[0101] An arrangement module 30, used to arrange the traceability encoding results according to the order of the watermark data to obtain a data information chain;
[0102] A comparison module 40, used to compare the data information chain with the watermark information;
[0103] The determination module 50 is used to determine that the tracing is successful when there is a segment in the data information chain that is the same as the segment in the watermark information.
[0104] Since the watermark information added to the watermark data does not change the original data structure and is invisible, it greatly improves the accuracy of traceability.
[0105] In some embodiments, the second encoding module 20 includes:
[0106] A conversion unit, used for encrypting each line of the watermark data and converting it into decimal data;
[0107] The second encoding unit calculates the decimal data using the set calculation rule and then divides the calculated data by 2 to obtain the traceability encoding result.
[0108] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0109] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0110] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0111] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0112] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A data watermark generation method, characterized in that: The method comprises: Each row of the original structured data is encrypted and converted into decimal data to obtain m Decimal data, m is the number of rows of the original structured data; right m The decimal data is encoded as follows: m encoding results, each encoding result is 0 or 1, including using a set calculation rule to m The decimal data is calculated to obtain m The calculation result is that the odd-numbered bits are added and the even-numbered bits are multiplied. m The above calculation results are divided by 2 and the remainder is obtained. m The encoding result; According to the pre-generated watermark information, m The encoding results are arranged to integrate the watermark information into the encoded binary data to obtain watermark data, where each bit of the watermark information is 0 or 1, including traversing m The encoding results are arranged according to the state of each bit of the watermark information. n The encoding results form a watermark information until the m The encoding results are all arranged to obtain the watermark data.
2. The data watermark generation method according to claim 1, characterized in that: The step of encrypting each row of the original structured data and converting it into decimal data includes: Each row of the original structured data is encrypted using the MD5 algorithm to obtain m A string of 32 bits, each character of which is in hexadecimal; Will m The string is converted to m The decimal data described in the article.
3. The data watermark generation method according to claim 1, characterized in that: The watermark information is n The watermark information is generated by a random algorithm.
4. A data watermark generating device, characterized in that: The device comprises: The conversion module is used to encrypt each row of the original structured data and convert it into decimal data to obtain m Decimal data, m is the number of rows of the original structured data; The first encoding module is used to m The decimal data is encoded as follows: m encoding results, each of which is 0 or 1, and the first encoding module includes: A calculation unit is used to calculate m The decimal data is calculated to obtain m The calculation result is that the odd-numbered bits are added and the even-numbered bits are multiplied; The first encoding unit is used to m The above calculation results are divided by 2 and the remainder is obtained. m The encoding result; The watermark generation module is used to generate watermark information in advance. m The encoding results are arranged to integrate the watermark information into the encoded binary data to obtain watermark data, wherein each bit of the watermark information is 0 or 1; The watermark generation module comprises: Traversal unit, used for traversal m The encoding result; An arranging unit is used to arrange the encoding results according to the state of each bit of the watermark information. n The encoding results form a watermark information until the m The encoding results are all arranged to obtain the watermark data.
5. A data tracing method, characterized in that: The method is used to trace the source of watermark data generated by the data watermark generation method according to any one of claims 1 to 3, and the method comprises: Get the leaked watermark data; Encoding the watermark data to obtain a traceability encoding result; Arranging the traceability encoding results according to the order of the watermark data to obtain a data information chain; comparing the data information chain with the watermark information; When the same fragment as that in the watermark information exists in the data information chain, it is determined that the tracing is successful.
6. The data tracing method according to claim 5, characterized in that: The step of encoding the watermark data to obtain a traceability encoding result includes: Each line of the watermark data is encrypted and converted into decimal data; The decimal data is calculated using the set calculation rule and then divided by 2 to obtain the remainder, thereby obtaining the traceability coding result.
7. A data tracing device, characterized in that: For implementing the data tracing method according to claim 5 or 6, the device comprises: An acquisition module, used to obtain leaked watermark data; A second encoding module is used to encode the watermark data to obtain a traceability encoding result; An arrangement module, used for arranging the traceability encoding results according to the order of the watermark data to obtain a data information chain; A comparison module, used for comparing the data information chain with the watermark information; The determination module is used to determine that the tracing is successful when there is a fragment in the data information chain that is the same as the fragment in the watermark information.
Citation Information
Patent Citations
Watermarking generation method and device, and storage equipment
CN108053358A
Low-density high-coding-capcity lattice two-dimensional code integrated with chaos encryption technology
CN105095935A
Text content digital watermark encryption and protection method and device
CN108090329A
Digital watermark embedding method, extraction method, device and digital watermark system
CN108665403A
Watermark adding method and device, electronic equipment and computer readable storage medium
CN111010490A
