A method and system for embedding watermark into compressed data
Embedding watermarks in compressed data of semi-structured data through deep learning models and hashing algorithms solves the challenge of watermark embedding in BSON data, and achieves efficient and secure watermark embedding and verification.
Patent Information
- Application Number
- CN202411805520.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-04
AI Technical Summary
Effectively embed watermarks in compressed data of semi-structured data to achieve copyright protection and tamper protection, especially in BSON data due to the challenges of compressed data integrity and parsing capabilities.
Deep learning models, especially convolutional neural networks and Variational Autoencoder (VAE) modules, are used to perform feature extraction to determine the location where watermarks can be embedded, and ensure the security and concealment of watermarks through hashing algorithms and blockchain verification.
It realizes efficient embedding of watermarks in compressed data of semi-structured data, ensuring the robustness and security of watermarks, while maintaining efficient data transmission and parsing capabilities.
Smart Images

Figure CN119760675A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital watermarking, and in particular to a method and system for embedding watermarks into compressed data. Background Art
[0002] In the digital information age, data security faces more and more challenges. Watermark technology has been widely used as an important means of protection. It is usually used to add watermarks to multimedia data such as digital images, audio and video to achieve copyright protection, tamper-proof and legal use identification of such data. With the rapid development of the Internet and big data technology, the application of structured and semi-structured data (such as JSON, XML, BSON, etc.) in geographic information systems, e-commerce, financial services and big data analysis has become increasingly important. However, due to the characteristics of semi-structured data, how to effectively embed watermarks in the compressed data of semi-structured data is still a challenge.
[0003] BSON, or Binary JSON, is a binary semi-structured data format. It is a data serialization format used by MongoDB for storing and transmitting data over the network. In order to further reduce the size of the data, BSON data is compressed during storage and transmission. Related technologies such as Gzip are widely used for BSON data compression. "MongoDB: The Definitive Guide, 2nd Edition" (O'Reilly Media, 2013) provides a detailed technical explanation of efficient storage and transmission of BSON data, but does not cover watermark embedding and copyright protection. Since BSON data usually needs to be compressed, it becomes more challenging to embed watermarks in BSON data without affecting its integrity and parsing capabilities.
[0004] The existing technologies for embedding watermarks in compressed data of semi-structured data mainly include: 1. Add content-based watermarks to compressed data in XML and JSON formats. For details, see the paper "A Robust Watermarking Scheme for Copyright Protection of XML Docs". However, due to its limitations on binary data, it is not easy to directly transition to BSON data. 2. By modifying the data compression algorithm, watermarks can be embedded in the compression process of semi-structured data, but this approach will increase the complexity and cost of compression.
[0005] In view of this, the present invention is proposed. Summary of the invention
[0006] The present invention proposes a method and system for embedding watermarks in compressed data, which can realize the embedding and verification of watermarks in compressed data of semi-structured data, and can ensure the security and concealment of watermark information while maintaining efficient transmission and parsing during the compression process of semi-structured data.
[0007] First, as Figure 1 As shown, the present invention proposes a method for embedding a watermark into compressed data, comprising: S11. Preset compressed data D of semi-structured data, input the compressed data D of the semi-structured data into the trained deep learning model M for feature extraction, and obtain the position S where the watermark can be embedded in the compressed data D of the semi-structured data i And the watermark position S can be embedded in the compressed data D of the semi-structured data i The priority order of the position S where the watermark can be embedded in the compressed data D of the semi-structured data is i The priority order is S i >S i-1 , i=1,2,…,I; S12. preset watermark information W, convert the watermark information W into binary format, generate a unique and irreversible hash value H for the watermark information W through a hash algorithm, and record the hash value H on the blockchain; S13. According to the field length, data type, nested structure depth and other information of the compressed data D of the semi-structured data, set an appropriate watermark information block size parameter, and divide the watermark information W into J fixed-size binary watermark information blocks B j , j = 1, 2, ..., J; S14. The watermark information block B j The position S where the watermark can be embedded in the compressed data D of the semi-structured data is allocated according to a certain principle. i middle; S15. The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The data is decoded, and the position S where the watermark can be embedded in the compressed data D of the semi-structured data is evaluated. i Whether the data is decoded normally; S16. If the compressed data D of the semi-structured data can embed the watermark at a position S i If the data at the position is decoded normally, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is maintained. i If the compressed data D of the semi-structured data can embed the watermark at the position S iIf the data decoding at the position is abnormal, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is abandoned. i Watermark embedding is performed at S17. Repeat the above steps S14-S16 to evaluate the positions S in the compressed data D of the semi-structured data where watermarks can be embedded. i , thereby completing the watermark embedding of the compressed data D of the semi-structured data.
[0008] Furthermore, if Figure 2 As shown, the trained deep learning model M in S11 includes: an Encoder network composed of a convolutional neural network, a Decoder network composed of a convolutional neural network, a variational autoencoder (VAE) module and a probability distribution generation module, wherein the variational autoencoder (VAE) module and the probability distribution generation module are located between the Encoder convolutional neural network layer and the Decoder convolutional neural network layer.
[0009] Furthermore, in S11, the compressed data D of the semi-structured data is input into a trained deep learning model M for feature extraction, and a position S where a watermark can be embedded in the compressed data D of the semi-structured data is obtained. i And the watermark position S can be embedded in the compressed data D of the semi-structured data i Prioritization includes: S111. Inputting the compressed data D of the semi-structured data into an Encoder network composed of a convolutional neural network to obtain an initial feature representation Z1 of the compressed data D of the semi-structured data; S112. Inputting the initial feature representation Z1 of the compressed data D of the semi-structured data into a variational autoencoder (VAE) module to obtain a latent variable distribution parameter Z2 of the compressed data D of the semi-structured data; S113. Input the latent variable distribution parameter Z2 of the compressed data D of the semi-structured data into the probability distribution generation module to obtain the position S where the watermark can be embedded in the compressed data D of the semi-structured data. i The probability distribution of S114. The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The probability distribution of is input into the Decoder network composed of the convolutional neural network to obtain the watermark position S that can be embedded in the compressed data D of the semi-structured data. i Priority sorting.
[0010] Furthermore, the semi-structured data in the compressed data D of the semi-structured data in S11 is any one of json, BSON, xml, yaml, avro, and orc.
[0011] Furthermore, the probability generation module in S11 is any attention model.
[0012] Furthermore, in S14, the watermark information block B j The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The allocation principle is: The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The number of watermark information blocks embedded in the compressed data D of the semi-structured data is greater than the number of watermark positions S that can be embedded in the compressed data D of the semi-structured data. i-1 The number of watermark information blocks embedded in the watermark information block B is large, and the watermark information block B j The positions S where the watermark can be embedded are evenly distributed in the compressed data D of the semi-structured data. i In different levels.
[0013] Furthermore, in S15, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is evaluated. i The parameter indicators for whether the data is decoded normally are that the integrity of the data ≥ 90%, the decoding accuracy of the embedded data ≥ 100%, and the decompression efficiency ≥ 50% meet the three indicators at the same time.
[0014] Second, as Figure 3 As shown, the present invention proposes a method for verifying compressed data containing watermark information, using the method for embedding watermark into compressed data as described in the first aspect, comprising: S21. Preset compressed data D of semi-structured data containing watermark information W, wherein the watermark information W is formed by concatenating the creation date, modification date and creator of the compressed data D of the semi-structured data, calculate the hash value H of the watermark information W and record the hash value H of the watermark information W on the blockchain; S22. Extracting the watermark information W from the compressed data D of the semi-structured data, and calculating the hash value H1 of the watermark information W; S23. Compare the hash value H1 of the watermark information W with the hash value H of the watermark information W stored on the blockchain to evaluate whether the compressed data D of the semi-structured data has been tampered with, specifically including: When the hash value H1 of the watermark information W is equal to the hash value H of the watermark information W stored on the blockchain, it indicates that the creation date, modification date and creator of the compressed data D of the semi-structured data have not been modified, and it is evaluated that the compressed data D of the semi-structured data has not been tampered with; When the hash value H1 of the watermark information W is not equal to the hash value H of the watermark information W stored on the blockchain, it means that one of the three data information of the creation date, modification date and producer of the compressed data D of the semi-structured data has been modified, and it is assessed that the compressed data D of the semi-structured data has been tampered with.
[0015] Thirdly, Figure 4 As shown, the present invention proposes a system for embedding watermarks into compressed data, which adopts the method for embedding watermarks into compressed data as described in the first aspect, including: Watermark embedding position priority sorting module D31: preset compressed data D of semi-structured data, input the compressed data D of the semi-structured data into the trained deep learning model M for feature extraction, and obtain the position S where the watermark can be embedded in the compressed data D of the semi-structured data i And the watermark position S can be embedded in the compressed data D of the semi-structured data i The priority order of the position S where the watermark can be embedded in the compressed data D of the semi-structured data is i The priority order is S i >S i-1 , i=1,2,…,I; Watermark information calculation module D32: preset watermark information W, convert the watermark information W into binary format, and generate a unique and irreversible hash value H for the watermark information W through a hash algorithm, and record the hash value H on the blockchain; Watermark information block segmentation module D33: according to the field length, data type, nested structure depth and other information of the compressed data D of the semi-structured data, set appropriate watermark information block size parameters, and segment the watermark information W into J fixed-size binary watermark information blocks B j , j = 1, 2, ..., J; The watermark information block embedding module D34 embeds the watermark information block B j The position S where the watermark can be embedded in the compressed data D of the semi-structured data is allocated according to a certain principle. i middle; The watermark embedding position data decoding evaluation module D35: the position S where the watermark can be embedded in the compressed data D of the semi-structured data i The data is decoded, and the position S where the watermark can be embedded in the compressed data D of the semi-structured data is evaluated. iWhether the data is decoded normally, if the compressed data D of the semi-structured data can embed the watermark position S i If the data at the position is decoded normally, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is maintained. i If the compressed data D of the semi-structured data can embed the watermark at the position S i If the data decoding at the position is abnormal, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is abandoned. i Watermark embedding is performed at Embedding watermark module D36: Evaluate the locations S of I watermark embeddable positions in the compressed data D of the semi-structured data i , thereby completing the watermark embedding of the compressed data D of the semi-structured data.
[0016] Fourthly, Figure 5 As shown, the present invention proposes a system for verifying compressed data containing watermark information, which adopts the method for verifying compressed data containing watermark information as described in the second aspect, including: Watermark information recording module D41: presetting compressed data D of semi-structured data containing watermark information W, wherein the watermark information W is formed by concatenating the creation date, modification date and creator of the compressed data D of the semi-structured data, calculating the hash value H of the watermark information W and recording the hash value H of the watermark information W on the blockchain; A watermark information calculation module D42: extracting the watermark information W from the compressed data D of the semi-structured data, and calculating a hash value H1 of the watermark information W; Watermark information verification module D43: compares the hash value H1 of the watermark information W with the hash value H of the watermark information W stored on the blockchain to evaluate whether the compressed data D of the semi-structured data has been tampered with.
[0017] In a fifth aspect, the present invention proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for embedding watermarks in compressed data as described above when executing the program.
[0018] In a sixth aspect, the present invention proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for embedding a watermark into compressed data as described above.
[0019] Compared with the prior art, the beneficial effects of the present invention are: By combining deep learning models such as convolutional neural networks, the present invention can achieve in-depth understanding and feature extraction of compressed data of semi-structured data, thereby determining the optimal watermark embedding position.
[0020] The present invention can improve the robustness of the watermark through a multi-level watermark embedding strategy and information redundancy coding. Even if the watermark information is incomplete, the watermark information can be restored through the redundant information.
[0021] The dynamic optimization mechanism proposed in the present invention embeds watermarks, and can monitor the embedding effect of each position in real time, ensuring that the compressed data of the semi-structured data after the watermark is embedded is not damaged in terms of compression efficiency, decoding accuracy and structural integrity.
[0022] The blockchain verification technology proposed in the present invention enhances the security and traceability of the watermark and ensures the tamper-proof nature of the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification are used to explain the principles of the present invention. Obviously, the accompanying drawings described below are only some embodiments of the present invention, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0024] Figure 1 It is a schematic diagram of the method for embedding watermark into compressed data proposed by the present invention.
[0025] Figure 2 It is a structural diagram of the trained deep learning model M proposed in the present invention.
[0026] Figure 3 It is a schematic diagram of a method for verifying compressed data containing watermark information proposed by the present invention.
[0027] Figure 4 It is a schematic diagram of the structure of the system for embedding watermarks into compressed data proposed by the present invention.
[0028] Figure 5 It is a schematic diagram of the structure of the system for verifying compressed data containing watermark information proposed by the present invention.
[0029] Explanation of reference numerals: D31 watermark embedding position priority sorting module; D32 watermark information calculation module; D33 watermark information block segmentation module; D34 watermark information block embedding module; D35 watermark embedding position data decoding evaluation module; D36 watermark embedding module.
[0030] D41 watermark information recording module; D42 watermark information calculation module; D43 watermark information verification module. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all 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.
[0032] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings, and "multiple" generally includes at least two.
[0033] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0034] As used herein, the words "if" and "if" may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0035] It should also be noted that the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprising a ..." do not exclude the existence of other identical elements in the commodity or device including the elements.
[0036] The optional embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0037] First, as Figure 1 As shown, the present invention proposes a method for embedding a watermark into compressed data, comprising: S11. Preset compressed data D of semi-structured data, input the compressed data D of the semi-structured data into the trained deep learning model M for feature extraction, and obtain the position S where the watermark can be embedded in the compressed data D of the semi-structured datai And the watermark position S can be embedded in the compressed data D of the semi-structured data i The priority order of the position S where the watermark can be embedded in the compressed data D of the semi-structured data is i The priority order is S i >S i-1 , i=1,2,…,I; S12. preset watermark information W, convert the watermark information W into binary format, generate a unique and irreversible hash value H for the watermark information W through a hash algorithm, and record the hash value H on the blockchain; S13. According to the field length, data type, nested structure depth and other information of the compressed data D of the semi-structured data, set an appropriate watermark information block size parameter, and divide the watermark information W into J fixed-size binary watermark information blocks B j , j = 1, 2, ..., J; S14. The watermark information block B j The position S where the watermark can be embedded in the compressed data D of the semi-structured data is allocated according to a certain principle. i middle; S15. The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The data is decoded, and the position S where the watermark can be embedded in the compressed data D of the semi-structured data is evaluated. i Whether the data is decoded normally; S16. If the compressed data D of the semi-structured data can embed the watermark at a position S i If the data at the position is decoded normally, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is maintained. i If the compressed data D of the semi-structured data can embed the watermark at the position S i If the data decoding at the position is abnormal, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is abandoned. i Watermark embedding is performed at S17. Repeat the above steps S14-S16 to evaluate the positions S in the compressed data D of the semi-structured data where watermarks can be embedded. i , thereby completing the watermark embedding of the compressed data D of the semi-structured data.
[0038] Furthermore, if Figure 2As shown, the trained deep learning model M in S11 includes: an Encoder network composed of a convolutional neural network, a Decoder network composed of a convolutional neural network, a variational autoencoder (VAE) module and a probability distribution generation module, wherein the variational autoencoder (VAE) module and the probability distribution generation module are located between the Encoder convolutional neural network layer and the Decoder convolutional neural network layer.
[0039] Furthermore, in S11, the compressed data D of the semi-structured data is input into the trained deep learning model M for feature extraction, and the position S where the watermark can be embedded in the compressed data D of the semi-structured data is obtained. i And the watermark position S can be embedded in the compressed data D of the semi-structured data i Prioritization includes: S111. Inputting the compressed data D of the semi-structured data into an Encoder network composed of a convolutional neural network to obtain an initial feature representation Z1 of the compressed data D of the semi-structured data; S112. Inputting the initial feature representation Z1 of the compressed data D of the semi-structured data into a variational autoencoder (VAE) module to obtain a latent variable distribution parameter Z2 of the compressed data D of the semi-structured data; S113. Input the latent variable distribution parameter Z2 of the compressed data D of the semi-structured data into the probability distribution generation module to obtain the position S where the watermark can be embedded in the compressed data D of the semi-structured data. i The probability distribution of S114. The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The probability distribution of is input into the Decoder network composed of the convolutional neural network to obtain the watermark position S that can be embedded in the compressed data D of the semi-structured data. i Priority sorting.
[0040] Furthermore, the semi-structured data in the compressed data D of the semi-structured data in S11 is any one of json, BSON, xml, yaml, avro, and orc.
[0041] Furthermore, the probability generation module in S11 is any attention model.
[0042] In S11, the variational autoencoder (VAE) module and the probability distribution generation module are integrated into the structure of the trained deep learning model M, which can enhance the ability of the trained deep learning model M to process compressed data of semi-structured data, and can make full use of the generation and feature learning capabilities of the variational autoencoder (VAE) module and the selection ability of the probability distribution generation module.
[0043] The variational autoencoder (VAE) is different from the traditional autoencoder. The variational autoencoder (VAE) can not only learn the compressed representation of the data, but also learn the latent variable distribution of the data. The compressed data of semi-structured data often contains complex hierarchical structures and nested information. The variational autoencoder (VAE) captures this complexity during the encoding process and converts it into the distribution parameters of the corresponding latent space. Since the latent space of the variational autoencoder (VAE) can represent the data in a probabilistic manner, the trained deep learning model M can use the probability representation of the data as the basis to evaluate the stability and robustness of the watermark embedding position when selecting the watermark embedding position. The probability distribution generation module uses the probability representation learned from the latent space of the variational autoencoder (VAE) module to generate the probability distribution of each potential embedding position in the data. By focusing on the key area represented by the variational autoencoder (VAE) module, different probability weights can be assigned to the candidate watermark embedding position in a manner similar to the attention mechanism. When the probability distribution generation module processes such different probability weights, it combines the structural characteristics of the data and the long-term dependencies captured by the model, and each candidate watermark embedding position will obtain an associated embedding priority.
[0044] In S13, an appropriate watermark information block size parameter is set and the watermark information W is divided into J fixed-size binary watermark information blocks B. j The information redundancy coding method is used in this step to make the watermark information block B j The additional redundant information of the watermark information W is introduced, so that even if some watermark information blocks are lost or interfered during the watermark extraction process, the watermark can still be restored through the redundant information.
[0045] Furthermore, in S14, the watermark information block B j The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The allocation principle is: The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The number of watermark information blocks embedded in the compressed data D of the semi-structured data is greater than the number of watermark positions S that can be embedded in the compressed data D of the semi-structured data. i-1 The number of watermark information blocks embedded in the watermark information block B is large, and the watermark information block Bj The positions S where the watermark can be embedded are evenly distributed in the compressed data D of the semi-structured data. i In different levels.
[0046] Wherein, the watermark information block B j The positions S where the watermark can be embedded are evenly distributed in the compressed data D of the semi-structured data. i Different levels in the image can improve the robustness and security of the embedded watermark. In this process, a variational autoencoder (VAE) module and a probability distribution generation module are used to ensure that the position to which each watermark information block is assigned is unpredictable, so that even if the watermark information of some levels is destroyed, the watermark information of other levels can still be used to verify the validity of the overall watermark.
[0047] Furthermore, in S15, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is evaluated. i The normal parameter indicators for data decoding are that the integrity of the data is ≥ 90%, the decoding accuracy of the embedded data is ≥ 100%, and the decompression efficiency is ≥ 50%.
[0048] Second, as Figure 3 As shown, the present invention proposes a method for verifying compressed data containing watermark information, using the method for embedding watermark into compressed data as described in the first aspect, comprising: S21. Preset compressed data D of semi-structured data containing watermark information W, wherein the watermark information W is formed by concatenating the creation date, modification date and creator of the compressed data D of the semi-structured data, calculate the hash value H of the watermark information W and record the hash value H of the watermark information W on the blockchain; S22. Extracting the watermark information W from the compressed data D of the semi-structured data, and calculating the hash value H1 of the watermark information W; S23. Compare the hash value H1 of the watermark information W with the hash value H of the watermark information W stored on the blockchain to evaluate whether the compressed data D of the semi-structured data has been tampered with, specifically including: When the hash value H1 of the watermark information W is equal to the hash value H of the watermark information W stored on the blockchain, it indicates that the creation date, modification date and creator of the compressed data D of the semi-structured data have not been modified, and it is evaluated that the compressed data D of the semi-structured data has not been tampered with; When the hash value H1 of the watermark information W is not equal to the hash value H of the watermark information W stored on the blockchain, it means that one of the three data information of the creation date, modification date and producer of the compressed data D of the semi-structured data has been modified, and it is assessed that the compressed data D of the semi-structured data has been tampered with.
[0049] The watermark information W in the compressed data D of the semi-structured data is extracted in S22 by adopting the reversible step of the method for embedding watermarks in compressed data described in the first aspect.
[0050] Thirdly, Figure 4 As shown, the present invention proposes a system for embedding watermarks into compressed data, which adopts the method for embedding watermarks into compressed data as described in the first aspect, including: Watermark embedding position priority sorting module D31: preset compressed data D of semi-structured data, input the compressed data D of the semi-structured data into the trained deep learning model M for feature extraction, and obtain the position S where the watermark can be embedded in the compressed data D of the semi-structured data i And the watermark position S can be embedded in the compressed data D of the semi-structured data i The priority order of the position S where the watermark can be embedded in the compressed data D of the semi-structured data is i The priority order is S i >S i-1 , i=1,2,…,I; Watermark information calculation module D32: preset watermark information W, convert the watermark information W into binary format, and generate a unique and irreversible hash value H for the watermark information W through a hash algorithm, and record the hash value H on the blockchain; Watermark information block segmentation module D33: according to the field length, data type, nested structure depth and other information of the compressed data D of the semi-structured data, set appropriate watermark information block size parameters, and segment the watermark information W into J fixed-size binary watermark information blocks B j , j = 1, 2, ..., J; The watermark information block embedding module D34 embeds the watermark information block B j The position S where the watermark can be embedded in the compressed data D of the semi-structured data is allocated according to a certain principle. i middle; The watermark embedding position data decoding evaluation module D35: the position S where the watermark can be embedded in the compressed data D of the semi-structured data i The data is decoded, and the position S where the watermark can be embedded in the compressed data D of the semi-structured data is evaluated. i Whether the data is decoded normally, if the compressed data D of the semi-structured data can embed the watermark position S i If the data at the position is decoded normally, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is maintained. i If the compressed data D of the semi-structured data can embed the watermark at the position Si If the data decoding at the position is abnormal, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is abandoned. i Watermark embedding is performed at Embedding watermark module D36: Evaluate the locations S of I watermark embeddable positions in the compressed data D of the semi-structured data i , thereby completing the watermark embedding of the compressed data D of the semi-structured data.
[0051] Fourthly, Figure 5 As shown, the present invention proposes a system for verifying compressed data containing watermark information, which adopts the method for verifying compressed data containing watermark information as described in the second aspect, including: Watermark information recording module D41: presetting compressed data D of semi-structured data containing watermark information W, wherein the watermark information W is formed by concatenating the creation date, modification date and creator of the compressed data D of the semi-structured data, calculating the hash value H of the watermark information W and recording the hash value H of the watermark information W on the blockchain; A watermark information calculation module D42: extracting the watermark information W from the compressed data D of the semi-structured data, and calculating a hash value H1 of the watermark information W; Watermark information verification module D43: compares the hash value H1 of the watermark information W with the hash value H of the watermark information W stored on the blockchain to evaluate whether the compressed data D of the semi-structured data has been tampered with.
[0052] In a fifth aspect, the present invention proposes an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for embedding watermarks in compressed data as described above when executing the program.
[0053] In a sixth aspect, the present invention proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for embedding a watermark into compressed data as described above.
[0054] Specifically, a system or device equipped with a storage medium can be provided, on which software program code that implements the functions of any of the above-mentioned embodiments is stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program code stored in the storage medium.
[0055] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0056] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RYM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer via a communication network.
[0057] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.
[0058] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0059] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for embedding a watermark into compressed data, characterized in that: include: S11. Preset compressed data D of semi-structured data, input the compressed data D of the semi-structured data into the trained deep learning model M for feature extraction, and obtain the position S where the watermark can be embedded in the compressed data D of the semi-structured data i And the watermark position S can be embedded in the compressed data D of the semi-structured data i The priority order of the position S where the watermark can be embedded in the compressed data D of the semi-structured data is i The priority order is S i >S i-1 , i=1,2,…,I; S12. preset watermark information W, convert the watermark information W into binary format, generate a unique and irreversible hash value H for the watermark information W through a hash algorithm, and record the hash value H on the blockchain; S13. According to the field length, data type, nested structure depth and other information of the compressed data D of the semi-structured data, set an appropriate watermark information block size parameter, and divide the watermark information W into J fixed-size binary watermark information blocks B j , j = 1, 2, ..., J; S14. The watermark information block B j The position S where the watermark can be embedded in the compressed data D of the semi-structured data is allocated according to a certain principle. i middle; S15. The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The data is decoded, and the position S where the watermark can be embedded in the compressed data D of the semi-structured data is evaluated. i Whether the data is decoded normally; S16. If the compressed data D of the semi-structured data can embed the watermark at a position S i If the data at the position is decoded normally, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is maintained. i If the compressed data D of the semi-structured data can embed the watermark at the position S i If the data decoding at the position is abnormal, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is abandoned. i Watermark embedding is performed at S17. Repeat the above steps S14-S16 to evaluate the positions S in the compressed data D of the semi-structured data where watermarks can be embedded. i , thereby completing the watermark embedding of the compressed data D of the semi-structured data.
2. A method for embedding watermark into compressed data according to claim 1, characterized in that: The trained deep learning model M in S11 includes: an encoder network composed of a convolutional neural network, a decoder network composed of a convolutional neural network, a variational autoencoder (VAE) module and a probability distribution generation module, wherein the variational autoencoder (VAE) module and the probability distribution generation module are located between the encoder convolutional neural network layer and the decoder convolutional neural network layer; In S11, the compressed data D of the semi-structured data is input into the trained deep learning model M for feature extraction, and the position S where the watermark can be embedded in the compressed data D of the semi-structured data is obtained. i And the watermark position S can be embedded in the compressed data D of the semi-structured data i Prioritization includes: S111. Inputting the compressed data D of the semi-structured data into an Encoder network composed of a convolutional neural network to obtain an initial feature representation Z1 of the compressed data D of the semi-structured data; S112. Inputting the initial feature representation Z1 of the compressed data D of the semi-structured data into a variational autoencoder (VAE) module to obtain a latent variable distribution parameter Z2 of the compressed data D of the semi-structured data; S113. Input the latent variable distribution parameter Z2 of the compressed data D of the semi-structured data into the probability distribution generation module to obtain the position S where the watermark can be embedded in the compressed data D of the semi-structured data. i The probability distribution of S114. The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The probability distribution of is input into the Decoder network composed of the convolutional neural network to obtain the watermark position S that can be embedded in the compressed data D of the semi-structured data. i Priority sorting.
3. A method for embedding watermark into compressed data according to claim 1, characterized in that: The semi-structured data in the compressed data D of the semi-structured data in S11 is any one of json, BSON, xml, yaml, avro, and orc.
4. A method for embedding watermark into compressed data according to claim 1, characterized in that: The probability generation module described in S11 is any attention model.
5. A method for embedding watermark into compressed data according to claim 1, characterized in that: In S14, the watermark information block B j The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The allocation principle is: The position S where the watermark can be embedded in the compressed data D of the semi-structured data i The number of watermark information blocks embedded in the compressed data D of the semi-structured data is greater than the number of watermark positions S that can be embedded in the compressed data D of the semi-structured data. i-1 The number of watermark information blocks embedded in the watermark information block B is large, and the watermark information block B j The positions S where the watermark can be embedded are evenly distributed in the compressed data D of the semi-structured data. i In different levels.
6. A method for embedding watermark into compressed data according to claim 1, characterized in that: In S15, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is evaluated. i The normal parameter indicators for data decoding are that the integrity of the data is ≥ 90%, the decoding accuracy of the embedded data is ≥ 100%, and the decompression efficiency is ≥ 50%.
7. A method for verifying compressed data containing watermark information, using the method for embedding watermark into compressed data as claimed in any one of claims 1 to 6, characterized in that: include: S21. Preset compressed data D of semi-structured data containing watermark information W, wherein the watermark information W is formed by concatenating the creation date, modification date and creator of the compressed data D of the semi-structured data, calculate the hash value H of the watermark information W and record the hash value H of the watermark information W on the blockchain; S22. Extracting the watermark information W from the compressed data D of the semi-structured data, and calculating the hash value H1 of the watermark information W; S23. Compare the hash value H1 of the watermark information W with the hash value H of the watermark information W stored on the blockchain to evaluate whether the compressed data D of the semi-structured data has been tampered with, specifically including: When the hash value H1 of the watermark information W is equal to the hash value H of the watermark information W stored on the blockchain, it indicates that the creation date, modification date and creator of the compressed data D of the semi-structured data have not been modified, and it is evaluated that the compressed data D of the semi-structured data has not been tampered with; When the hash value H1 of the watermark information W is not equal to the hash value H of the watermark information W stored on the blockchain, it means that one of the three data information of the creation date, modification date and producer of the compressed data D of the semi-structured data has been modified, and it is assessed that the compressed data D of the semi-structured data has been tampered with.
8. A system for embedding watermarks into compressed data, using the method for embedding watermarks into compressed data as claimed in any one of claims 1 to 6, characterized in that ,include: Watermark embedding position priority sorting module D31: preset compressed data D of semi-structured data, input the compressed data D of the semi-structured data into the trained deep learning model M for feature extraction, and obtain the position S where the watermark can be embedded in the compressed data D of the semi-structured data i And the watermark position S can be embedded in the compressed data D of the semi-structured data i The priority order of the position S where the watermark can be embedded in the compressed data D of the semi-structured data is i The priority order is S i >S i-1 , i=1,2,…,I; Watermark information calculation module D32: preset watermark information W, convert the watermark information W into binary format, and generate a unique and irreversible hash value H for the watermark information W through a hash algorithm, and record the hash value H on the blockchain; Watermark information block segmentation module D33: according to the field length, data type, nested structure depth and other information of the compressed data D of the semi-structured data, set appropriate watermark information block size parameters, and segment the watermark information W into J fixed-size binary watermark information blocks B j , j = 1, 2, ..., J; The watermark information block embedding module D34 embeds the watermark information block B j The position S where the watermark can be embedded in the compressed data D of the semi-structured data is allocated according to a certain principle. i middle; The watermark embedding position data decoding evaluation module D35: the position S where the watermark can be embedded in the compressed data D of the semi-structured data i The data is decoded, and the position S where the watermark can be embedded in the compressed data D of the semi-structured data is evaluated. i Whether the data is decoded normally, if the compressed data D of the semi-structured data can embed the watermark position S i If the data at the position is decoded normally, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is maintained. i If the compressed data D of the semi-structured data can embed the watermark at the position S i If the data decoding at the position is abnormal, the position S where the watermark can be embedded in the compressed data D of the semi-structured data is abandoned. i Watermark embedding is performed at Embedding watermark module D36: Evaluate the locations S of I watermark embeddable positions in the compressed data D of the semi-structured data i , thereby completing the watermark embedding of the compressed data D of the semi-structured data.
9. A system for verifying compressed data containing watermark information, using the method for verifying compressed data containing watermark information as claimed in claim 7, characterized in that ,include: Watermark information recording module D41: presetting compressed data D of semi-structured data containing watermark information W, wherein the watermark information W is formed by concatenating the creation date, modification date and creator of the compressed data D of the semi-structured data, calculating the hash value H of the watermark information W and recording the hash value H of the watermark information W on the blockchain; A watermark information calculation module D42: extracting the watermark information W from the compressed data D of the semi-structured data, and calculating a hash value H1 of the watermark information W; Watermark information verification module D43: compares the hash value H1 of the watermark information W with the hash value H of the watermark information W stored on the blockchain to evaluate whether the compressed data D of the semi-structured data has been tampered with.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for embedding watermarks into compressed data as described in any one of claims 1 to 6 is implemented.