Watermark tracing method, electronic equipment, storage medium and program product
By using the comparison mechanism between index sets and storage tables in watermark traceability technology, the first encrypted watermark information is solved, and the problems of low processing efficiency and low traceability accuracy in the existing technology are solved, and efficient and accurate watermark traceability are achieved.
Patent Information
- Application Number
- CN202510263952.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-06
- Publication Date
- 2025-06-24
AI Technical Summary
The existing watermark traceability technology has problems such as degradation in performance, low retrieval efficiency, insufficient security and low traceability accuracy when processing massive large data.
By determining the index set of the first encrypted watermark information in the data to be traced, and comparing it with the second encrypted watermark information in the preset storage table, the matching second watermark information is found to decrypt the first encrypted watermark information, and data traceability is realized.
It improves the efficiency and accuracy of watermark traceability, reduces the misjudgment rate, and enhances the security and traceability of watermark information.
Smart Images

Figure CN120197158A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data security technology. Specifically, it relates to a watermark tracing method, an electronic device, a storage medium, and a program product. Background Art
[0002] In the digital age, data security faces severe challenges, with frequent data leakage and tampering. Database watermark technology, as an important means of data tracing, embeds watermark information in data to track the data source and authenticity. However, in the face of massive big data, related watermark technologies have problems such as performance degradation, low retrieval efficiency, insufficient security, and low tracing accuracy. Therefore, how to ensure the tracing efficiency while minimizing the false positive rate has become an urgent problem to be solved. Summary of the Invention
[0003] The purpose of the embodiments of this application is to provide a watermark tracing method, an electronic device, a storage medium, and a program product to achieve the technical effect of improving the watermark tracing efficiency.
[0004] The first aspect of the embodiments of this application provides a watermark tracing method, and the method includes:
[0005] When obtaining the data to be traced carrying the first encrypted watermark information, determining the first index set corresponding to the first encrypted watermark information; the first index set includes the first index corresponding to each first watermark unit in the first encrypted watermark information;
[0006] Obtaining a preset storage table; the storage table stores a watermark data set of multiple second encrypted watermark information; the second encrypted watermark information is carried in the original data; the second encrypted watermark information is composed of at least one second watermark unit; the watermark data set includes the second index, byte unit, and embedding position of each second watermark unit; the embedding position is used to indicate the position of the second watermark unit in the original data;
[0007] If the first index set is related to at least one target second index in the storage table, determining the target byte unit and target embedding position corresponding to the target second index from the storage table, and sorting the target byte units according to the target embedding position to obtain a target byte sequence;
[0008] Decrypting the first encrypted watermark information according to the target byte sequence.
[0009] In the above implementation process, by determining the first index set of the first encrypted watermark information in the data to be traced and comparing it with the second encrypted watermark information in the preset storage table to find the matching second watermark information, and then decrypting the first encrypted watermark information to complete data tracing.
[0010] Further, the first index includes a first watermark identifier; the second index includes a second watermark identifier; before obtaining the preset storage table, it further includes:
[0011] For each of the second watermark units, select a target conversion strategy from multiple binary conversion strategies according to the data type of the second watermark unit, use the target conversion strategy to perform binary conversion on the second watermark unit to obtain the binary stream of the second watermark unit, and determine the second watermark identifier of the second watermark unit from the binary stream;
[0012] The step of, if the first index set is related to at least one target second index in the storage table, determining the target byte unit and the target embedding position corresponding to the target second index from the storage table includes:
[0013] If the first watermark identifier is the same as at least one target second watermark identifier in the storage table, determine the target byte unit and the target embedding position corresponding to the target second watermark identifier from the storage table.
[0014] In the above implementation process, by performing binary conversion on the second watermark unit and determining its watermark identifier, the uniqueness and traceability of the watermark information are enhanced, and the accuracy of watermark tracing is improved.
[0015] Further, the step of determining the second watermark identifier of the second watermark unit from the binary stream includes:
[0016] Perform arithmetic encryption processing on the binary stream to obtain a target binary code, convert the target binary code into an integer value, and determine the integer value as the second watermark identifier.
[0017] In the above implementation process, through the arithmetic encryption processing of the binary stream, the binary code and the integer value watermark identifier of the second watermark unit are generated, further strengthening the security and traceability of the watermark information.
[0018] Further, the first index includes a first watermark hash value; the second index includes a second watermark hash value; the step of, if the first index set is related to at least one target second index in the storage table, determining the target byte unit and the target embedding position corresponding to the target second index from the storage table includes:
[0019] If the first watermark hash value is the same as at least one target second watermark hash value in the storage table, determine the target byte unit and the target embedding position corresponding to the target second watermark hash value from the storage table.
[0020] In the above implementation process, hash processing is introduced to generate a watermark hash value, which simplifies the comparison process of watermark information and improves the efficiency and accuracy of traceability.
[0021] Furthermore, the watermark data set further includes a second watermark task identifier of each of the second watermark units, and a third hash value; wherein, the second watermark task identifier is used to indicate the watermark task to which the second watermark unit belongs; the third hash value is the hash value corresponding to the combination of the second watermark hash value and the second watermark task identifier;
[0022] Before determining that the first watermark hash value is the same as at least one target second watermark hash value in the storage table, it further includes:
[0023] Determine the first watermark task identifier corresponding to the watermark task to which each of the first watermark units belongs, and determine the fourth hash value corresponding to each of the first watermark units; wherein, the fourth hash value is the hash value corresponding to the combination of the first watermark hash value and the first watermark task identifier;
[0024] The step of, if the first watermark hash value is the same as at least one target second watermark hash value in the storage table, then determining the target byte unit and the target embedding position corresponding to the target second watermark hash value from the storage table, includes:
[0025] If the first watermark hash value is the same as at least one target second watermark hash value in the storage table, and the fourth hash value is the same as the third hash value associated with the target second watermark hash value, then determine the target byte unit and the target embedding position corresponding to the target second watermark hash value from the storage table.
[0026] In the above implementation process, by adding a watermark task identifier and a combined hash value, the security and identifiability of the watermark information are enhanced, and the reliability of watermark traceability is further improved.
[0027] Furthermore, the method further includes:
[0028] Determine the first target shard hash value corresponding to the first watermark hash value;
[0029] Determine the target storage node based on the first target shard hash value; each storage node stores at least one of the second watermark hash values, and the second index, the byte unit, and the embedding position associated with the second watermark hash value;
[0030] If the first watermark hash value is the same as at least one target second watermark hash value in the storage table, determining the target byte unit corresponding to the target second watermark hash value and the target embedding position from the storage table includes:
[0031] If the first watermark hash value is the same as any one of the target second watermark hash values in the target storage node, determine the target byte unit associated with the target second watermark hash value and the target embedding position from the target storage node.
[0032] In the above implementation process, through the shard hash value and the storage node, the distributed storage and fast retrieval of watermark information are realized, effectively reducing the memory consumption of a single node, fundamentally avoiding the memory overflow problem caused by excessive data volume, and ensuring the stability and reliability of the system when processing a large amount of watermark information.
[0033] Further, decrypting the first encrypted watermark information according to the target byte sequence includes:
[0034] If it is determined that the similarity between the target byte sequence and the pre-stored compliant byte sequence exceeds the similarity threshold, decrypt the first encrypted watermark information according to the target byte sequence.
[0035] In the above implementation process, through the similarity comparison of the compliant byte sequence, the accuracy and credibility of the target byte sequence are ensured, thereby improving the accuracy and security of decrypting the first encrypted watermark information.
[0036] A second aspect of the embodiments of the present application provides an electronic device, and the electronic device includes:
[0037] A processor;
[0038] A memory for storing executable instructions of the processor;
[0039] Wherein, when the processor calls the executable instructions, the method described in any one of the first aspects is implemented.
[0040] A third aspect of the embodiments of the present application provides a computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0041] A fourth aspect of the embodiments of the present application provides a computer program product, and the computer program product includes a computer program, and when the computer program is executed by a processor, the method described in any one of the first aspects is implemented. Description of the Drawings
[0042] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0043] Figure 1 A schematic flowchart of a watermark traceability method provided by an embodiment of the present application;
[0044] Figure 2 A structural block diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0045] The following will describe the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings in the embodiments of the present application.
[0046] It should be noted that: similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of the present application, terms such as "first" and "second" are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0047] The application of databases has shown explosive growth, and data has become the core asset. However, the data security situation is extremely severe, and security incidents such as data leakage and illegal tampering occur frequently. In this situation, accurately tracing the source and authenticity of data in the database has become an important link in ensuring data security and strengthening data traceability capabilities. Database watermark technology has emerged as the times require. It builds a reliable basis for data traceability by embedding specific watermark information in database data units. However, in related technologies, it is often necessary to load a large amount of watermark information into memory for searching and matching operations, which not only easily leads to memory overload and burdens the system, but may also have a serious negative impact on the overall performance and stability of the system.
[0048] In view of any of the above problems, the embodiments of the present application provide a watermark traceability method, referring to Figure 1 , Figure 1 A schematic flowchart of a watermark traceability method provided by an embodiment of the present application.
[0049] In this embodiment, the method includes:
[0050] Step S10: When the data to be traced with the first encrypted watermark information is obtained, determine the first index set corresponding to the first encrypted watermark information; the first index set includes the first index corresponding to each first watermark unit in the first encrypted watermark information;
[0051] It should be noted that the first encrypted watermark information refers to the watermark information embedded in the data to be traced. It contains multiple watermark units, namely the first watermark units. Each first watermark unit corresponds to an index, namely the first index. After decrypting the first encrypted watermark information, the source of the data can be determined.
[0052] Step S20: Obtain a preset storage table; the storage table stores a watermark data set of multiple second encrypted watermark information; the second encrypted watermark information is carried in the original data; the second encrypted watermark information is composed of at least one second watermark unit; the watermark data set includes the second index, byte unit and embedding position of each second watermark unit; the embedding position is used to indicate the position of the second watermark unit in the original data;
[0053] It should be noted that by storing the watermark data set of multiple second encrypted watermark information through a preset storage table, it can effectively avoid loading a large amount of watermark information into the memory for searching and matching operations, thus avoiding the problem of memory overload.
[0054] The second encrypted watermark information refers to the watermark information embedded in the original data. It contains multiple watermark units, namely the second watermark units. Each second watermark unit corresponds to a second index. The storage table is preset and used to store the watermark data set of multiple second encrypted watermark information. The second encrypted watermark information is extracted from the original data and is associated with the original data.
[0055] The first encrypted watermark information may be the same as or different from the second encrypted watermark information. Only when the two are the same can the first encrypted watermark information be traced from the storage table.
[0056] The first index and the second index can specifically be hash values or int values (i.e., integer values). During the watermark tracing process, the index is used to compare the watermark information in the data to be traced with the watermark information in the storage table. By comparing the indexes, the matching watermark information can be efficiently screened out, thus simplifying the tracing process. When choosing a hash value as the index, a hash function needs to be used to calculate the watermark information. Optionally, when calculating the hash value, some additional information, such as a watermark task identifier, can also be considered to enhance the identification and security of the watermark information. When choosing an integer value as the index, binary conversion and operation encryption processing need to be performed on the watermark unit to ensure that the generated integer value is unique and unpredictable.
[0057] The byte unit can be binary data or other forms of encoding.
[0058] In a specific implementation, if there is no existing storage table, a new storage table will be created based on the unique identifier of the watermark task to which the second encrypted watermark information belongs (i.e., the task ID). The name of this table will directly use this task ID to ensure that the information of each watermark task can be stored and managed orderly and independently, so as to achieve classified storage and efficient retrieval of data. In the created storage table, the hash value of the watermark information will be used as the primary key. At the same time, the storage table will comprehensively record multiple key fields related to this watermark information, including but not limited to: the embedding position of the watermark unit, the data value of the watermark unit in the byte stream (i.e., the byte unit), the task ID, the combined hash value of the hash value of the watermark information and the task ID, and the integer value of the watermark information (i.e., the int value). When tracing the first encrypted watermark information, it will be matched according to the hash value in the storage table. If the hash values are the same and the matched is a watermark unit, the exact position of this watermark unit in the watermark byte stream (the position in the watermark byte stream can be determined by the embedding position) and the corresponding data value in the byte stream will be recorded until the complete watermark byte stream is successfully restored. In addition, during the tracing process, special attention will be paid to the starting position in the byte stream. Once the starting position is encountered, the recording of new watermark byte stream information will start again. This design aims to avoid the loss or incorrect recording of watermark information caused by data segmentation or interruption, so as to ensure the accuracy and reliability of the tracing result. Finally, after the watermark byte stream is successfully restored, it will be comprehensively compared with the compliant watermark byte stream pre-stored in the watermark system. This comparison process will be carried out according to the similarity calculation method to obtain the similarity calculation result.
[0059] Step S30: If the first index set is related to at least one target second index in the storage table, determine the target byte unit corresponding to the target second index and the target embedding position from the storage table, and sort the target byte units according to the target embedding position to obtain a target byte sequence;
[0060] It can be understood that the first index needs to be compared with the second index in the storage table. The purpose of the comparison is to find the second watermark information that matches the watermark information in the data to be traced.
[0061] After finding the matching second watermark information, the target byte unit and the target embedding position corresponding to these second watermark information need to be extracted from the storage table. These information are the basis for subsequent watermark decryption and tracing. The target byte unit contains the actual content of the watermark information, while the target embedding position indicates the specific position of these byte units in the original data, which is equivalent to indicating the arrangement order of multiple byte units.
[0062] It should be understood that since the watermark information may be embedded in the original data in a scattered manner, after the target byte units are extracted, they need to be sorted according to their target embedding positions. The purpose of sorting is to recombine the scattered watermark information into a complete watermark sequence for subsequent decryption.
[0063] Step S40: Decrypt the first encrypted watermark information according to the target byte sequence.
[0064] It should be noted that decrypting the first encrypted watermark information according to the sorted target byte sequence usually requires using a decryption algorithm or key corresponding to the encryption process. After successful decryption, the original watermark information can be obtained, thus completing the traceability process.
[0065] In this embodiment, by determining the encrypted watermark information index in the data to be traced, comparing it with the encrypted watermark information in the preset storage table, finding the matching watermark information, and then decrypting the encrypted watermark information in the data to be traced according to the byte units and embedding positions of the matching watermark information, efficient traceability of the data is achieved.
[0066] Based on any of the above embodiments, the first index includes a first watermark identifier; the second index includes a second watermark identifier; before step S20, it further includes:
[0067] For each of the second watermark units, select a target conversion strategy from multiple binary conversion strategies according to the data type of the second watermark unit, use the target conversion strategy to perform binary conversion on the second watermark unit to obtain the binary stream of the second watermark unit, and determine the second watermark identifier of the second watermark unit from the binary stream;
[0068] It should be noted that the watermark unit may contain various types of data, such as numerical, text, date, etc. Different strategies need to be adopted for these data types during binary conversion to ensure the accuracy and effectiveness of the conversion. As an example, for numerical data, the numerical value is converted into a binary string with a fixed length (such as 64-bit double-precision floating-point representation), and four or eight bits are intercepted from it. For text data, UTF-8 encoding is used to generate a binary stream, and key fragments are dynamically intercepted according to the text length, such as intercepting a certain four or eight bits. For date data, the date is converted into a timestamp (Unix timestamp), then converted into a binary string and four or eight bits are intercepted from it. According to the intercepted results of the binary strings of different data types, the binary stream of the second watermark unit is obtained. Optionally, the watermark identifier is an integer (i.e., an int value), which is used to uniquely identify a watermark unit for subsequent search and matching operations. Some operations are performed on the binary stream, such as hash, summation, exclusive OR, etc. Then, the operation result is converted into an integer form, and this integer form value is the second watermark identifier.
[0069] If the first index set is related to at least one target second index in the storage table, determining the target byte unit and the target embedding position corresponding to the target second index from the storage table includes:
[0070] If the first watermark identifier is the same as at least one target second watermark identifier in the storage table, determine the target byte unit and the target embedding position corresponding to the target second watermark identifier from the storage table.
[0071] It can be understood that the second watermark identifier, byte unit, and embedding position are stored in the storage table in an associated manner. Once the second watermark identifier is determined, the associated byte unit and embedding position can be quickly found.
[0072] In this embodiment, by introducing the matching mechanism of the first watermark identifier and the second watermark identifier, the problem of accurate matching of watermark information during the traceability process is solved. By selecting an appropriate binary conversion strategy for the data type of each second watermark unit and converting it into a binary stream, the efficient processing of watermark information and the accurate extraction of identifiers are ensured.
[0073] Based on any of the above embodiments, determining the second watermark identifier of the second watermark unit from the binary stream includes:
[0074] Performing operation encryption processing on the binary stream to obtain a target binary code, converting the target binary code into an integer value, and determining the integer value as the second watermark identifier.
[0075] It should be noted that by encrypting the binary stream to obtain the target binary code, then converting the target binary code into an integer value, and determining this integer value as the second watermark identifier, the purpose of this series of steps is to convert the original binary stream into a unique identifier to obfuscate and protect the original binary stream, prevent it from being illegally tampered with during transmission or storage, and thus achieve the unique identification and tracking of the watermark unit.
[0076] Exemplarily, any encryption algorithm can be used to perform arithmetic encryption processing on the binary stream. For example, symmetric encryption algorithms, asymmetric encryption algorithms. Specifically, symmetric encryption algorithms such as AES, DES, etc., or asymmetric encryption algorithms such as RSA can be selected for encryption processing. Next, converting the encrypted target binary code into an integer value can also be achieved in various ways. For example, the target binary code can be regarded as a large integer and then directly converted; or through a specific hash function, the target binary code can be mapped to an integer value range. In this way, it can be ensured that the converted integer value has uniqueness and consistency.
[0077] In a specific implementation, before performing arithmetic encryption processing on the binary stream, first perform denoising processing on the binary stream, that is, the binary string, to remove redundant information (such as consecutive repeated "0" or "1"). Then, ensure the integrity of the binary string (i.e., the denoised binary stream) through a verification algorithm (such as parity check). If the length of the intercepted binary stream is less than 32 bits, use a cyclic padding strategy to supplement the bits. Then, repeat the following operations until a stable 32-bit code is generated: perform bit operations (such as exclusive OR, shift operations) on the processed binary stream, and mix the operation result with a preset key to enhance security. Finally, the generated 32-bit binary code is successfully converted into an int value (range: 0 to 2^32 - 1), and this int value is used as the unique identifier of the watermark, that is, the second watermark identifier.
[0078] In this embodiment, first perform arithmetic encryption processing on the binary stream to obtain the target binary code, then convert the target binary code into an integer value, and finally determine this integer value as the second watermark identifier. Through this series of steps, the identifier of the second watermark unit can be effectively extracted from the binary stream, which can achieve the rapid determination and unique identification of the watermark identifier while ensuring data security. This not only improves the accuracy and efficiency of watermark tracing, but also can maintain high system performance and stability when processing large-scale data.
[0079] Based on any of the above embodiments, the first index includes a first watermark hash value; the second index includes a second watermark hash value; and the step of, if the first index set is related to at least one target second index in the storage table, determining the target byte unit and the target embedding position corresponding to the target second index from the storage table includes:
[0080] If the first watermark hash value is the same as at least one target second watermark hash value in the storage table, determine the target byte unit and the target embedding position corresponding to the target second watermark hash value from the storage table.
[0081] It should be noted that by performing a hash process on the encrypted watermark information, corresponding hash values are generated, and these hash values are used to efficiently locate and match the corresponding watermark information in the storage table. The use of hash values simplifies the matching process of watermark information and improves the efficiency of watermark traceability.
[0082] Specifically, the generation of hash values is achieved by performing hash processes on the first encrypted watermark information and the second encrypted watermark information respectively. Optionally, any hash algorithm can be used to perform the hash process on the encrypted watermark information, such as MD5, SHA-1, or SHA-256, etc. Among them, the watermark hash value of the second encrypted watermark information is pre-calculated and stored in the storage table. After calculating the first watermark hash value, it is necessary to traverse the storage table to query the second watermark hash value that is the same as the first watermark hash value. Since the second watermark hash value is associated with the byte unit and the embedding position and stored in the storage table, once the target second watermark hash value is determined, the target byte unit and the target embedding position can be quickly determined.
[0083] In this embodiment, by performing hash processing, storing hash values, comparing hash values, and determining the target byte unit and the embedding position, efficient and accurate traceability of watermark information is achieved.
[0084] Based on any of the above embodiments, the watermark data set further includes a second watermark task identifier for each second watermark unit and a third hash value; wherein, the second watermark task identifier is used to indicate the watermark task to which the second watermark unit belongs; the third hash value is the hash value corresponding to the combination of the second watermark hash value and the second watermark task identifier;
[0085] Before determining that the first watermark hash value is the same as at least one target second watermark hash value in the storage table, it further includes:
[0086] Determine the first watermark task identifier corresponding to the watermark task to which each of the first watermark units belongs, and determine the fourth hash value corresponding to each of the first watermark units; wherein, the fourth hash value is the hash value corresponding to the combination of the first watermark hash value and the first watermark task identifier;
[0087] It should be noted that the watermark task identifier is used to uniquely identify a watermark task. In some cases, there may be multiple watermark tasks, and the watermark information in these watermark tasks may be the same in content. For example, two different users may request to add the same watermark information to the same data, but these two watermark tasks are independent in business logic. To prevent confusion or misidentification during subsequent data traceability, it is necessary to use the watermark task to identify different watermark information. That is, by introducing the watermark task identifier, it can be ensured that even if the watermark information itself is the same, they can be distinguished according to the watermark task identifier.
[0088] It should be understood that by combining the second watermark hash value with the second watermark task identifier and calculating the hash value, the third hash value can be obtained. The third hash value not only contains the characteristics of the watermark information itself (reflected by the second watermark hash value), but also includes the characteristics of the watermark task (reflected by the second watermark task identifier). Therefore, during subsequent traceability, the correctness of the watermark information and the watermark task can be verified simultaneously by comparing the third hash value.
[0089] Specifically, before determining whether the first watermark hash value is the same as the target second watermark hash value in the storage table, it is necessary to first determine the first watermark task identifier corresponding to the watermark task to which each first watermark unit belongs, and calculate the fourth hash value corresponding to each first watermark unit.
[0090] The step of, if the first watermark hash value is the same as at least one target second watermark hash value in the storage table, then determining the target byte unit and the target embedding position corresponding to the target second watermark hash value from the storage table, includes:
[0091] If the first watermark hash value is the same as at least one target second watermark hash value in the storage table, and the fourth hash value is the same as the third hash value associated with the target second watermark hash value, then determine the target byte unit and the target embedding position corresponding to the target second watermark hash value from the storage table.
[0092] It should be noted that by comparing the first watermark hash value with the second watermark hash value, the watermark information that matches the data to be traced can be preliminarily screened out. However, since there may be multiple watermark tasks with the same watermark information content (i.e., the same second watermark hash value), it is necessary to further verify whether the watermark tasks they belong to are the same by comparing the fourth hash value and the third hash value. Only when the first watermark hash value, the second watermark hash value, the fourth hash value, and the third hash value all match can it be determined that the correct watermark information has been found.
[0093] It is understandable that introducing the watermark task identifier and the hash value corresponding to the combination of the watermark hash value and the watermark task identifier is to ensure that each watermark information and its corresponding watermark task can be accurately and error-free identified during the data tracing process, prevent confusion or identification errors caused by the same watermark information, and improve the accuracy and reliability of tracing.
[0094] In this embodiment, by introducing the second watermark task identifier and the third hash value, different watermark tasks can be effectively distinguished during the watermark tracing process, ensuring the accuracy of the data, improving the retrieval efficiency of the watermark information, and avoiding the problem of memory overload that may occur when processing a large amount of data.
[0095] Based on any of the above embodiments, the method further includes:
[0096] Determine the first target shard hash value corresponding to the first watermark hash value;
[0097] It should be noted that sharding means extracting the first few bits from the watermark hash value as the shard hash value of the watermark hash value.
[0098] Determine the target storage node based on the first target shard hash value; each storage node stores at least one of the second watermark hash values, and the second index, the byte unit, and the embedding position associated with the second watermark hash value;
[0099] It should be noted that sharding is used to quickly locate storage nodes. This is because, through the shard hash value, data can be dispersed to different storage nodes, thereby improving the storage and retrieval efficiency of data. As an example, assume there are 3 storage nodes A, B, and C. Then data can be sharded according to the first two digits of the watermark hash value: 00 - 33 are assigned to node A, 34 - 66 are assigned to node B, and 67 - 99 are assigned to node C. The shard hash value corresponding to the watermark hash value "45abcd..." is 45, and this watermark hash value, along with its associated second index, byte unit, and embedding position, are all stored in node B. When querying for traceability, based on the shard hash value 45 of the watermark hash value "45abcd...", the target storage node B can be directly located for query. Based on the first target shard hash value and the allocation rule of the storage node, the range of data retrieval can be narrowed down to a specific storage node, avoiding traversing all storage nodes for searching, and improving the retrieval efficiency.
[0100] If the first watermark hash value is the same as at least one target second watermark hash value in the storage table, then determining the target byte unit and the target embedding position corresponding to the target second watermark hash value from the storage table includes:
[0101] If the first watermark hash value is the same as any one of the target second watermark hash values in the target storage node, then determine the target byte unit and the target embedding position associated with the target second watermark hash value from the target storage node.
[0102] It can be understood that after determining the target storage node, the first watermark hash value is compared with all the second watermark hash values stored in this storage node. By comparing the first watermark hash value with all the second watermark hash values in the storage node, it can be determined whether there is watermark information in this storage node that matches the data to be traced. If the first watermark hash value is the same as any one of the target second watermark hash values in the storage node, then the target byte unit and the target embedding position associated with the target second watermark hash value will be determined from this storage node. By determining the target byte unit and the target embedding position, the watermark information can be accurately extracted, providing strong support for subsequent traceability.
[0103] In this embodiment, the method of determining the storage node through the shard hash value makes the storage and query of watermark information more efficient. Each storage node only stores part of the watermark data, avoiding problems such as memory overload caused by loading all watermark information into memory. It not only reduces the memory burden but also improves the overall performance and stability of the system. At the same time, it can quickly and accurately query the target watermark information.
[0104] Based on any of the above embodiments, decrypting the first encrypted watermark information according to the target byte sequence includes:
[0105] If it is determined that the similarity between the target byte sequence and a pre-stored compliant byte sequence exceeds a similarity threshold, decrypt the first encrypted watermark information according to the target byte sequence.
[0106] It should be noted that a compliant byte sequence refers to a predefined or standardized byte sequence that conforms to specific rules or standards. In the process of decrypting encrypted watermark information, the compliant byte sequence serves as a reference for comparison with the target byte sequence. This comparison helps to verify the legality or compliance of the target byte sequence, ensuring that only byte sequences meeting specific conditions can be used to decrypt the encrypted watermark information. This embodiment places no restrictions on the compliant byte sequence and the similarity threshold.
[0107] The acquisition of the target byte sequence is achieved by sorting at least one target byte unit. The sorted target byte sequence is compared with the pre-stored compliant byte sequence, and various algorithms can be used for the comparison, such as cosine similarity, Euclidean distance, etc. When the similarity exceeds the preset threshold, the target byte sequence is considered valid and used to decrypt the first encrypted watermark information. The decryption process can use symmetric encryption algorithms or asymmetric encryption algorithms, and the specific choice depends on actual application requirements, which are not restricted in this embodiment.
[0108] It should be understood that since the target byte sequence (i.e., the watermark byte stream) is the original encoding form of the watermark information, and the watermark information is the result obtained after the watermark byte stream is decoded and subjected to corresponding processing, therefore, after the target byte sequence is determined, it can be converted (or decoded) into watermark information, and then based on this watermark information, further decryption and traceability operations can be completed. Exemplarily, according to the correspondence between the second encrypted watermark information and the second decrypted watermark information, or based on the specific decryption rules of the second encrypted watermark information, the second encrypted watermark information in the original data can be decrypted. Thus, once the target byte sequence is determined, this information can be used to decrypt the first encrypted watermark information.
[0109] It is understandable that in the process of decrypting the first encrypted watermark information, the decision of whether to adopt the target byte sequence is based on the similarity between the target byte sequence and the pre-stored compliant byte sequence, rather than only adopting the target byte sequence for decryption when the target byte sequence is exactly matched with the pre-stored compliant byte sequence. The reasons are as follows: First, the strategy of being able to decrypt when the similarity reaches a certain level can enhance the flexibility of traceability. Specifically, in practical applications, the watermark information may be in an incomplete state due to various reasons, such as data loss during transmission or information truncation during processing. By judging the similarity between the target byte sequence and the compliant byte sequence, the system can flexibly handle various situations of complete watermarks and partial watermarks, thus improving the adaptability to different watermark states. Second, this strategy can effectively improve the robustness of the system. Specifically, in the case where the data is partially damaged or maliciously tampered with, it is often difficult to directly match the complete watermark information successfully. However, through similarity judgment, the system can identify the watermark fragments that have been modified or damaged but still retain key information, so as to conduct effective traceability. This ability ensures that the traceability operation can be carried out smoothly under adverse conditions, enhancing the stability and reliability of the system. Moreover, through similarity calculation and the best matching strategy, the system can more accurately identify the candidate watermark that is closest to the target watermark, thus reducing the false alarms and missed alarms that may be caused by direct matching. Finally, this strategy can support fuzzy matching. Specifically, for watermark information that is not exactly the same as the compliant byte sequence but has a high degree of similarity, the system can also effectively identify it.
[0110] In this embodiment, by judging whether the similarity between the target byte sequence and the pre-stored compliant byte sequence exceeds a threshold, it is decided whether to decrypt the first encrypted watermark information according to the target byte sequence, which improves the flexibility and accuracy of watermark decryption.
[0111] Based on the method described in any of the above embodiments, the present application also provides a Figure 2 structural schematic diagram of an electronic device as shown in Figure 2 . At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the method described in any of the above embodiments.
[0112] Based on the method described in any of the above embodiments, the present application also provides a computer storage medium. The storage medium stores a computer program, and when the computer program is executed by a processor, it can be used to execute the method described in any of the above embodiments.
[0113] Based on the method described in any of the above embodiments, the present application further provides a computer program product, which includes one or more computer programs or instructions. The computer programs or instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. When the computer program is executed by a processor, the method described in any of the above embodiments is implemented.
[0114] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present application. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0115] In addition, in each embodiment of the present application, the functional modules can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part.
[0116] If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0117] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. For those skilled in the art, various modifications and changes can be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the protection scope of the present application. It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.
[0118] As described above, the above are only specific implementation manners of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, and all of them should be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
[0119] It should be noted that in this text, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising a..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.
Claims
1. A watermark tracing method, characterized in that: The method comprises: When the to-be-traced data carrying the first encrypted watermark information is obtained, a first index set corresponding to the first encrypted watermark information is determined; the first index set includes a first index corresponding to each first watermark unit in the first encrypted watermark information; Obtain a preset storage table; the storage table stores a watermark data set of multiple second encrypted watermark information; the second encrypted watermark information is carried in the original data; the second encrypted watermark information is composed of at least one second watermark unit; the watermark data set includes a second index, a byte unit and an embedded position of each second watermark unit; the embedded position is used to indicate the position of the second watermark unit in the original data; If the first index set is related to at least one target second index in the storage table, determining a target byte unit and a target embedding position corresponding to the target second index from the storage table, and sorting the target byte units according to the target embedding position to obtain a target byte sequence; The first encrypted watermark information is decrypted according to the target byte sequence.
2. The method according to claim 1, characterized in that The first index includes a first watermark identifier; the second index includes a second watermark identifier; and before obtaining the preset storage table, the method further includes: for each second watermark unit, selecting a target conversion strategy from a plurality of binary conversion strategies according to a data type of the second watermark unit, performing binary conversion on the second watermark unit using the target conversion strategy to obtain a binary stream of the second watermark unit, and determining the second watermark identifier of the second watermark unit from the binary stream; If the first index set is related to at least one target second index in the storage table, determining a target byte unit corresponding to the target second index and a target embedding position from the storage table includes: If the first watermark identifier is identical to at least one target second watermark identifier in the storage table, a target byte unit and a target embedding position corresponding to the target second watermark identifier are determined from the storage table.
3. The method according to claim 2, characterized in that The determining the second watermark identifier of the second watermark unit from the binary stream comprises: The binary stream is subjected to arithmetic encryption processing to obtain a target binary code, the target binary code is converted into an integer value, and the integer value is determined as the second watermark identifier.
4. The method according to claim 1, characterized in that The first index includes a first watermark hash value; the second index includes a second watermark hash value; if the first index set is related to at least one target second index in the storage table, determining a target byte unit corresponding to the target second index and a target embedding position from the storage table, comprising: If the first watermark hash value is the same as at least one target second watermark hash value in the storage table, a target byte unit and a target embedding position corresponding to the target second watermark hash value are determined from the storage table.
5. The method according to claim 4, characterized in that The watermark data set further includes a second watermark task identifier of each second watermark unit and a third Hash value; wherein the second watermark task identifier is used to indicate the watermark task to which the second watermark unit belongs; and the third Hash value is a Hash value corresponding to a combination of the second watermark hash value and the second watermark task identifier; Before determining that the first watermark hash value is the same as at least one target second watermark hash value in the storage table, the method further includes: Determine a first watermark task identifier corresponding to the watermark task to which each of the first watermark units belongs, and determine a fourth hash value corresponding to each of the first watermark units; wherein the fourth hash value is a hash value corresponding to a combination of the first watermark hash value and the first watermark task identifier; If the first watermark hash value is the same as at least one target second watermark hash value in the storage table, determining a target byte unit and a target embedding position corresponding to the target second watermark hash value from the storage table, comprising: If the first watermark hash value is the same as at least one target second watermark hash value in the storage table, and the fourth hash value is the same as the third hash value associated with the target second watermark hash value, then the target byte unit corresponding to the target second watermark hash value and the target embedding position are determined from the storage table.
6. The method according to claim 4, characterized in that The method further comprises: Determine a first target shard hash value corresponding to the first watermark hash value; Determine a target storage node based on the first target shard hash value; each storage node stores at least one second watermark hash value, and the second index, the byte unit, and the embedding position associated with the second watermark hash value; If the first watermark hash value is the same as at least one target second watermark hash value in the storage table, determining a target byte unit and a target embedding position corresponding to the target second watermark hash value from the storage table, comprising: If the first watermark hash value is the same as any target second watermark hash value in the target storage node, the target byte unit associated with the target second watermark hash value and the target embedding position are determined from the target storage node.
7. The method according to claim 1, characterized in that The decrypting the first encrypted watermark information according to the target byte sequence comprises: If it is determined that the similarity between the target byte sequence and the pre-stored compliant byte sequence exceeds a similarity threshold, the first encrypted watermark information is decrypted according to the target byte sequence.
8. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing processor-executable instructions; Wherein, when the processor calls the executable instruction, the method described in any one of claims 1-7 is implemented.
9. A computer-readable storage medium, characterized in that: Computer instructions are stored thereon, and when the computer instructions are executed by a processor, the steps of any method described in claims 1-7 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.