A digital watermark generation method, device, equipment, medium and program product

By generating dynamic digital watermarks through hash operations and modulo 10n, the problem of low watermark concealment in single short data information scenarios is solved, achieving high concealment and verification of data asset ownership.

CN118821083BActive Publication Date: 2026-04-21CHINA MOBILE SHANGHAI ICT CO LTD +2
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE SHANGHAI ICT CO LTD
Filing Date
2024-05-06
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In scenarios involving single, short data messages, existing technologies have low concealment of digital watermarks, making them easy to detect and leading to data tampering, and making it impossible to confirm the ownership of data assets.

Method used

A hash array is generated using hash operations, and digital watermarks of different lengths are generated by taking the remainder of 10n. Combined with query information, dynamic watermark generation is performed to ensure that the watermark is tamper-proof and improve its concealment.

Benefits of technology

It improves the embedding concealment of digital watermarks, ensuring that the watermarks are not easily detected or tampered with, while having less interference with the original query data, and supports the verification and traceability of data asset ownership.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118821083B_ABST
    Figure CN118821083B_ABST
Patent Text Reader

Abstract

The application discloses a digital watermark generation method, device, equipment, medium and program product. The method comprises the following steps: when it is detected that the query data of the current request needs to be added with a watermark, performing a hash operation on the query information corresponding to the current query data to obtain a hash array; obtaining a first array with a length of a preset bit value from the hash array; converting the first array into an unsigned number to obtain a second array; performing 10 n mod operation on the second array to generate the digital watermark of the query data; wherein n is a preset digital watermark length, and n>0. The application considers that the original information carrier of the query data such as pure digital data and short bit number is small, and can perform 10 n mod operation according to the watermark demand of different lengths to obtain different length integers as the digital watermark, so that the embedded concealment is improved, and the interference on the original query data is small.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data security technology, and in particular to a digital watermark generation method, apparatus, terminal device, computer-readable storage medium, and computer program product. Background Technology

[0002] Currently, to facilitate the confirmation of data asset ownership, hidden data watermarks are typically added using data obfuscation techniques without altering the data's usability. This includes adding unnecessary lines to data files or embedding feature blocks in image files without changing their display. This ensures that data ownership can be confirmed in the event of a data breach. Existing technologies are generally only capable of adding digital watermarks to large information scenarios such as images, audio / video, large text, and databases. However, in the case of single, short data sets, the small size of the original information carrier makes concealment weak, and watermark anti-counterfeiting is difficult. Once detected, the data is easily tampered with, making it impossible to confirm data ownership. Summary of the Invention

[0003] This invention provides a digital watermark generation method, apparatus, device, medium, and program product. Considering the small size of the original information carrier for query data such as purely numerical data and short-length data, it can adapt to watermark requirements of different lengths, according to 10... n The remainder is used to obtain integers of different lengths as digital watermarks, which improves the embedding concealment while ensuring minimal interference with the original query data.

[0004] To address the aforementioned technical problems, a first aspect of this invention provides a digital watermark generation method, comprising:

[0005] When it is detected that the query data of the current request needs to be watermarked, a hash operation is performed based on the query information corresponding to the current query data to obtain a hash array;

[0006] Obtain a first array of a preset bit value from the hash array;

[0007] Convert the first array to an unsigned number to obtain the second array;

[0008] Divide the second array into 10 n The remainder is taken to generate a digital watermark for the queried data; where n is the preset digital watermark length, and n > 0.

[0009] As a preferred embodiment, the query information includes at least the queryer message, the query interface name, the query data, and the time series; the step of performing a hash operation on the query information corresponding to the current query data to obtain a hash array specifically includes:

[0010] The query information is filled to obtain filling information with a length that is a multiple of the preset group length;

[0011] The filling information is grouped according to the preset group length to obtain several bit groups;

[0012] The hash array is obtained by iteratively compressing several of the bit groups in sequence.

[0013] As a preferred embodiment, obtaining a first array of a preset bit value from the hash array specifically includes:

[0014] Based on the preset bit value, obtain the last few bytes of the hash array;

[0015] The bytes are converted into unsigned numbers and concatenated according to the bit order of each byte to obtain the first array.

[0016] As a preferred embodiment, the second array is divided into 10 n The process of taking the remainder to generate a digital watermark for the queried data specifically includes:

[0017] Divide the second array into 10 n Take the remainder to obtain the target remainder;

[0018] When the length of the target remainder is equal to n, the target remainder is determined to be the digital watermark of the queried data;

[0019] When the length of the target remainder is less than n, the target remainder is padded with zeros at the higher bits so that the length of the target remainder after the high-bit padding is equal to n, and the target remainder after the high-bit padding is used as the digital watermark of the query data.

[0020] As a preferred embodiment, the method specifically determines whether the currently requested query data needs to be watermarked through the following steps:

[0021] In response to a data query request sent by a client, obtain the query data currently requested by the client;

[0022] When the watermark configuration information of the client's query interface is determined to be enabled based on the preset watermark configuration list, it is determined that the currently requested query data needs to be watermarked; wherein, the watermark configuration list stores several query interface names and the watermark configuration information corresponding to each query interface name.

[0023] When, based on the watermark configuration list, it is determined that the watermark configuration information of the client's query interface is disabled, it is determined that the query data currently requested does not need to be watermarked.

[0024] As a preferred embodiment, the method further includes:

[0025] The digital watermark is concatenated with the query data to obtain query data with an embedded watermark.

[0026] The query data with the embedded watermark is fed back to the client that sent the current request.

[0027] As a preferred embodiment, concatenating the digital watermark with the query data to obtain query data with an embedded watermark specifically includes:

[0028] When the query data is a decimal, the digital watermark is directly appended to the end of the query data to obtain the query data with the embedded watermark.

[0029] When the query data is an integer, the digital watermark is used as the decimal part of the query data and concatenated with the query data to obtain the query data with the embedded watermark.

[0030] As a preferred embodiment, the method further includes:

[0031] The digital watermark, the current data interaction time of the request, the client's query message, the query interface name, and the query data with the embedded watermark are stored in a preset database.

[0032] As a preferred embodiment, the method further includes:

[0033] When it is detected that the query data in the current request does not require watermarking, the query data is directly fed back to the client.

[0034] A second aspect of the present invention provides a digital watermark generation apparatus, comprising:

[0035] The hash operation module is used to perform a hash operation based on the query information corresponding to the current query data when it is detected that the query data of the current request needs to be watermarked, and obtain a hash array.

[0036] The first array acquisition module is used to acquire a first array with a preset bit value from the hash array;

[0037] The second array acquisition module is used to convert the first array into an unsigned number to obtain the second array;

[0038] The digital watermark generation module is used to divide the second array into 10... n The remainder is taken to generate a digital watermark for the queried data; where n is the preset digital watermark length, and n > 0.

[0039] A third aspect of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the digital watermark generation method described in any of the first aspects.

[0040] A fourth aspect of the present invention provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the digital watermark generation method according to any one of the first aspects.

[0041] A fifth aspect of the present invention provides a computer program product, including a computer program / instructions, wherein when the computer program / instructions are executed by a processor, they implement the steps of the digital watermark generation method described in any of the first aspects.

[0042] Compared to existing technologies, the beneficial effect of this invention is that, considering the small size of the original information carrier of query data such as purely numerical data and short-length data, it can adapt to watermark requirements of different lengths according to 10... n The remainder is used to obtain integers of different lengths as digital watermarks, which improves the embedding concealment while ensuring minimal interference with the original query data. Attached Figure Description

[0043] Figure 1 This is a flowchart illustrating the digital watermark generation method in an embodiment of the present invention;

[0044] Figure 2 This is a schematic diagram of the structure of the digital watermark generation device in an embodiment of the present invention;

[0045] Figure 3 This is a schematic diagram of the structure of the terminal device in an embodiment of the present invention. Detailed Implementation

[0046] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0047] See Figure 1 The first aspect of this invention provides a digital watermark generation method, comprising the following steps S1 to S4:

[0048] Step S1: When it is detected that the currently requested query data needs to be watermarked, a hash operation is performed based on the query information corresponding to the currently requested query data to obtain a hash array;

[0049] Step S2: Obtain a first array with a preset bit value from the hash array;

[0050] Step S3: Convert the first array into an unsigned number to obtain the second array;

[0051] Step S4, divide the second array into 10 n The remainder is taken to generate a digital watermark for the queried data; where n is the preset digital watermark length, and n > 0.

[0052] Specifically, in this embodiment, when it detects that the currently requested query data needs to be watermarked, considering the unidirectional nature of hash algorithms—that is, there is no pattern between the original information and the hash array, and the original information cannot be derived from the hash array—ensuring that the hash algorithm process is irreversible, thus guaranteeing that the final generated digital watermark is tamper-proof, this embodiment performs a hash operation based on the current query information to obtain a hash array. It is worth noting that, considering that each data query request process has different query information, to further ensure that the final generated digital watermark is not easily detected or tampered with, the hash array in this embodiment is obtained by performing a hash operation based on the current query information, thereby ensuring that the digital watermark for each requested query data is dynamic and non-unique.

[0053] In this embodiment, the query data is short data such as purely numeric data or short-digit data.

[0054] Furthermore, since the original information carrier of query data, such as purely numerical data or short-digit data, is small, to ensure that the final generated digital watermark has high embedding concealment and minimal interference with the original query data, this embodiment first obtains a first array of a preset bit value from the hash array. For example, the preset bit value is 64 bits, but it can be set to other values ​​according to actual needs; this embodiment does not specifically limit this. Then, the first array is converted into an unsigned number, for example, an unsigned integer, to obtain a second array. For watermark requirements of different lengths, this embodiment divides the second array into 10... n By taking the remainder, a digital watermark of length n can be generated. For example, the second array can be divided into 10... 6 The remainder is used to select the integer consisting of the last 6 digits of the second array as the digital watermark of the query data.

[0055] In this embodiment, in order to convert the first array into an unsigned number, the conversion rule is as follows: the highest bit of each byte in the first array is defined as the value bit rather than the sign bit. For example, the two's complement of -1 is 11111111, so the unsigned number is 255.

[0056] The digital watermark generation method provided in this invention takes into account the small size of the original information carrier of query data such as purely numerical data and short-length data, and can adapt to watermark requirements of different lengths according to 10... n The remainder is used to obtain integers of different lengths as digital watermarks, which improves the embedding concealment and ensures that the digital watermark is not easily detected or tampered with, while minimizing interference with the original query data.

[0057] As a preferred embodiment, the query information includes at least the queryer message, the query interface name, the query data, and the time series; the step of performing a hash operation on the query information corresponding to the current query data to obtain a hash array specifically includes:

[0058] The query information is filled to obtain filling information with a length that is a multiple of the preset group length;

[0059] The filling information is grouped according to the preset group length bits to obtain several bit groups;

[0060] The hash array is obtained by iteratively compressing several of the bit groups in sequence.

[0061] In this embodiment, the query message, query interface name, query data, and time series are used as influencing factors. The SM3 algorithm is used for hashing to obtain a hash array of 32 bytes, totaling 256 bits. Specifically, the SM3 algorithm is suitable for digital signatures and verification in commercial cryptographic applications. Its security is comparable to SHA256. The message block length is preset to 512 bits, but it can be set to other block lengths according to actual needs. This embodiment does not make a specific limitation. The digest value length is 256 bits (64 hexadecimal numbers). This embodiment first fills the query information to obtain filling information with a length that is a multiple of the preset block length. For example, assuming the preset block length is 512 bits and the length of query information a is b, "1" is filled at the end of a, followed by k "0"s, and finally a 64-bit bit string is filled. The content of the bit string is the binary representation of the length b of a, where (b+1+k+64)mod512=0, and k is the smallest integer that satisfies the condition that "the length of the filling information is a multiple of 512". Furthermore, since the length of the filling information is a multiple of the preset group length, it can be grouped according to the preset group length to obtain several bit groups. For example, if the preset group length is 512 bits, then the number of bit groups is (b+1+k+64) / 512. Then, for several bit groups, the compression function is used to perform several rounds of iterative compression. The number of rounds of iterative compression is equal to the number of bit groups, and finally the hash array mentioned above is obtained.

[0062] The digital watermark generation method provided in this invention uses the query message, query interface name, query data and time series as influencing factors, and uses the SM3 algorithm to perform hash operation to obtain a hash array with high security, thereby ensuring that the final generated digital watermark is not easily detected or tampered with.

[0063] As a preferred embodiment, obtaining a first array of a preset bit value from the hash array specifically includes:

[0064] Based on the preset bit value, obtain the last few bytes of the hash array;

[0065] The bytes are converted into unsigned numbers and concatenated according to the bit order of each byte to obtain the first array.

[0066] Specifically, in this embodiment, the last few bytes of the hash array are obtained according to the preset bit values ​​required for the first array. For example, if the required length of the first array is 64 bits, the last 8 bytes of the hash array are obtained. This embodiment does not specifically limit the preset bit values; in actual implementation, different preset bit values ​​can be set according to actual application requirements to obtain the last few bytes of the hash array accordingly. Further, the bytes selected from the hash array are converted into unsigned numbers, that is, the highest bit of each byte is defined as the value bit rather than the sign bit, and then concatenated according to the bit order of each byte to obtain the aforementioned first array.

[0067] As a preferred embodiment, the second array is divided into 10 n The process of taking the remainder to generate a digital watermark for the queried data specifically includes:

[0068] Divide the second array into 10 n Take the remainder to obtain the target remainder;

[0069] When the length of the target remainder is equal to n, the target remainder is determined to be the digital watermark of the queried data;

[0070] When the length of the target remainder is less than n, the target remainder is padded with zeros at the higher bits so that the length of the target remainder after the high-bit padding is equal to n, and the target remainder after the high-bit padding is used as the digital watermark of the query data.

[0071] In this embodiment, in order to obtain a digital watermark of a preset length, the second array is divided into 10... n The remainder is taken to obtain a target remainder of a certain length. It's understood that the length of the target remainder may be equal to n or less than n. For example, when the second array is 255111 and the preset digital watermark length n is 2, the second array is divided into 10... 2 Taking the remainder, the target remainder is 11, and its length is equal to n; when the second array is 255, and the preset digital watermark length is 4, the second array is divided into 10... 4 Taking the remainder, the target remainder is 255, and its length is less than n. Furthermore, if the length of the target remainder equals n, it indicates that the current target remainder meets the preset digital watermark length, therefore, this target remainder is directly used as the digital watermark for the queried data, for example, as mentioned above using 10... 2The second array obtained by taking the remainder has a target remainder of 11. Therefore, the digital watermark of the currently queried data is 11. If the length of the target remainder is less than n, it indicates that the current target remainder does not meet the preset digital watermark length. Therefore, it is necessary to pad the target remainder with zeros at the higher digits so that the length of the padded target remainder is equal to n, meeting the preset digital watermark length. Thus, the padded target remainder is used as the digital watermark of the queried data. For example, as mentioned above, using 10... 4 The second array obtained by taking the remainder has a target remainder of 255. Therefore, the high-order bits of the target remainder need to be padded with zeros to 4 bits, i.e., 0255. Then, 0255 is used as the digital watermark of the current queried data.

[0072] As a preferred embodiment, the method specifically determines whether the currently requested query data needs to be watermarked through the following steps:

[0073] In response to a data query request sent by a client, obtain the query data currently requested by the client;

[0074] When the watermark configuration information of the client's query interface is determined to be enabled based on the preset watermark configuration list, it is determined that the currently requested query data needs to be watermarked; wherein, the watermark configuration list stores several query interface names and the watermark configuration information corresponding to each query interface name.

[0075] When, based on the watermark configuration list, it is determined that the watermark configuration information of the client's query interface is disabled, it is determined that the query data currently requested does not need to be watermarked.

[0076] Specifically, when a data query request is received from a client, the requested query data is obtained based on the request content. Furthermore, this embodiment pre-stores watermark configuration information, including several query interface names and their corresponding watermark configuration information. This indicates whether the query interface has watermark configuration enabled. If, based on the preset watermark configuration list, the client's query interface is determined to have watermark configuration enabled, the requested query data needs to be watermarked. If, based on the watermark configuration list, the client's query interface is determined to have watermark configuration disabled, the requested query data does not need to be watermarked.

[0077] In one embodiment, when it is detected that the currently requested query data does not require watermarking, the query data is directly fed back to the client.

[0078] As a preferred embodiment, the method further includes:

[0079] The digital watermark is concatenated with the query data to obtain query data with an embedded watermark.

[0080] The query data with the embedded watermark is fed back to the client that sent the current request.

[0081] Specifically, after generating the digital watermark of the query data for the current request, it is necessary to further embed the digital watermark into the query data, that is, to concatenate the digital watermark with the query data to obtain the query data with the embedded watermark, and then feed back the query data with the embedded watermark to the client that sent the current request.

[0082] As a preferred embodiment, concatenating the digital watermark with the query data to obtain query data with an embedded watermark specifically includes:

[0083] When the query data is a decimal, the digital watermark is directly appended to the end of the query data to obtain the query data with the embedded watermark.

[0084] When the query data is an integer, the digital watermark is used as the decimal part of the query data and concatenated with the query data to obtain the query data with the embedded watermark.

[0085] Specifically, in this embodiment, when the currently requested query data is a decimal, the generated digital watermark is directly appended to the end of the query data, that is, the digital watermark is embedded into the decimal part of the query data. This ensures the concealment of the embedding while minimizing interference with the original query data. When the query data is an integer, the digital watermark is appended to the decimal part of the query data. Specifically, a decimal point is first added to the end of the query data, and then the generated digital watermark is appended after the decimal point. This embeds the digital watermark into the decimal part of the query data, ensuring the concealment of the embedding while minimizing interference with the original query data.

[0086] As a preferred embodiment, the method further includes:

[0087] The digital watermark, the current data interaction time of the request, the client's query message, the query interface name, and the query data with the embedded watermark are stored in a preset database.

[0088] Specifically, this embodiment stores query interaction information such as digital watermarks, the current data interaction time, client query messages, query interface names, and query data with embedded watermarks in a preset database. This information can be used for subsequent verification of data asset ownership. Specifically, by matching and retrieving the data's digital watermark information with the query interaction information stored in the database, data traceability and verification can be achieved, thus verifying the ownership of data assets to a certain extent. Furthermore, this embodiment also supports positive verification of data asset ownership through parameters.

[0089] See Figure 2 A second aspect of the present invention provides a digital watermark generation apparatus 100, comprising:

[0090] Hash operation module 11 is used to perform hash operation based on the query information corresponding to the current query data when it is detected that the query data of the current request needs to be watermarked, and obtain a hash array;

[0091] The first array acquisition module 12 is used to acquire a first array with a preset bit value from the hash array;

[0092] The second array acquisition module 13 is used to convert the first array into an unsigned number to obtain the second array;

[0093] Digital watermark generation module 14 is used to divide the second array into 10 n The remainder is taken to generate a digital watermark for the queried data; where n is the preset digital watermark length, and n > 0.

[0094] As a preferred embodiment, the query information includes at least the queryer message, the query interface name, the query data, and the time series; the hash operation module 11 is used to perform a hash operation based on the query information corresponding to the current query data to obtain a hash array, specifically including:

[0095] The query information is filled to obtain filling information with a length that is a multiple of the preset group length;

[0096] The filling information is grouped according to the preset group length to obtain several bit groups;

[0097] The hash array is obtained by iteratively compressing several of the bit groups in sequence.

[0098] As a preferred embodiment, the first array acquisition module 12 is used to acquire a first array of a preset bit value from the hash array, specifically including:

[0099] Based on the preset bit value, obtain the last few bytes of the hash array;

[0100] The bytes are converted into unsigned numbers and concatenated according to the bit order of each byte to obtain the first array.

[0101] As a preferred embodiment, the digital watermark generation module 14 is used to divide the second array into 10... n The process of taking the remainder to generate a digital watermark for the queried data specifically includes:

[0102] Divide the second array into 10 n Take the remainder to obtain the target remainder;

[0103] When the length of the target remainder is equal to n, the target remainder is determined to be the digital watermark of the queried data;

[0104] When the length of the target remainder is less than n, the target remainder is padded with zeros at the higher bits so that the length of the target remainder after the high-bit padding is equal to n, and the target remainder after the high-bit padding is used as the digital watermark of the query data.

[0105] As a preferred embodiment, the device further includes a data query request response module, used for:

[0106] In response to a data query request sent by a client, obtain the query data currently requested by the client;

[0107] When the watermark configuration information of the client's query interface is determined to be enabled based on the preset watermark configuration list, it is determined that the currently requested query data needs to be watermarked; wherein, the watermark configuration list stores several query interface names and the watermark configuration information corresponding to each query interface name.

[0108] When, based on the watermark configuration list, it is determined that the watermark configuration information of the client's query interface is disabled, it is determined that the query data currently requested does not need to be watermarked.

[0109] As a preferred embodiment, the device further includes a query data feedback module, used for:

[0110] The digital watermark is concatenated with the query data to obtain query data with an embedded watermark.

[0111] The query data with the embedded watermark is fed back to the client that sent the current request.

[0112] As a preferred embodiment, the query data feedback module is used to concatenate the digital watermark with the query data to obtain query data with embedded watermark, specifically including:

[0113] When the query data is a decimal, the digital watermark is directly appended to the end of the query data to obtain the query data with the embedded watermark.

[0114] When the query data is an integer, the digital watermark is used as the decimal part of the query data and concatenated with the query data to obtain the query data with the embedded watermark.

[0115] As a preferred embodiment, the device further includes an information storage module for:

[0116] The digital watermark, the current data interaction time of the request, the client's query message, the query interface name, and the query data with the embedded watermark are stored in a preset database.

[0117] As a preferred embodiment, the query data feedback module is also used for:

[0118] When it is detected that the query data in the current request does not require watermarking, the query data is directly fed back to the client.

[0119] It should be noted that the digital watermark generation device 100 provided in the embodiments of the present invention can realize all the processes of the digital watermark generation method described in any of the above embodiments. The functions and technical effects of each module in the device are the same as the functions and technical effects of the digital watermark generation method described in the above embodiments, and will not be repeated here.

[0120] See Figure 3 , Figure 3 This is a schematic diagram of the structure of a terminal device 200 provided in an embodiment of the present invention. A third aspect of the present invention provides a terminal device 200, including a memory 22, a processor 21, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, it implements the digital watermark generation method described in any embodiment of the first aspect.

[0121] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the terminal device 200.

[0122] The terminal device 200 may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will understand that the schematic diagram is merely an example of the terminal device 200 and does not constitute a limitation on the terminal device 200. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the terminal device 200 may also include input / output devices, network access devices, buses, etc.

[0123] The processor 21 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 21 is the control center of the terminal device 200, connecting all parts of the terminal device 200 via various interfaces and lines.

[0124] The memory 22 can be used to store the computer programs and / or modules. The processor 21 implements various functions of the terminal device 200 by running or executing the computer programs and / or modules stored in the memory 22 and calling the data stored in the memory 22. The memory 22 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0125] A fourth aspect of the present invention provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the digital watermark generation method described in any embodiment of the first aspect.

[0126] A fifth aspect of the present invention provides a computer program product, including a computer program / instructions, wherein when the computer program / instructions are executed by a processor, they implement the steps of the digital watermark generation method described in any embodiment of the first aspect.

[0127] Wherein, if the modules / units integrated in the terminal device 200 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor 21, it can implement the steps of the various method embodiments described above. Wherein, the computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

[0128] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method of digital watermark generation, characterized by, include: When it is detected that the query data of the current request needs to be watermarked, a hash operation is performed based on the query information corresponding to the current query data to obtain a hash array; Obtain a first array of a preset bit value from the hash array; Convert the first array to an unsigned number to obtain the second array; The second array is arranged according to 10 n The remainder is generated to generate a digital watermark of the query data; wherein n is a preset digital watermark length, and n>0; the digital watermark is used to be directly spliced at the tail of the query data or as a decimal part of the query data to be spliced with the query data.

2. The digital watermark generation method of claim 1, wherein, The query information includes at least the queryer message, the query interface name, the query data, and the time series; the step of performing a hash operation based on the query information corresponding to the current query data to obtain a hash array specifically includes: The query information is filled to obtain filling information with a length that is a multiple of the preset group length; The filling information is grouped according to the preset group length to obtain several bit groups; The hash array is obtained by iteratively compressing several of the bit groups in sequence.

3. The digital watermark generation method of claim 1 wherein, The step of obtaining a first array of a preset bit value from the hash array specifically includes: Based on the preset bit value, obtain the last few bytes of the hash array; The bytes are converted into unsigned numbers and concatenated according to the bit order of each byte to obtain the first array.

4. The digital watermark generation method of claim 1 wherein, The second array is sorted according to 10 n The remainder generates the digital watermark of the query data, specifically comprising: The second array is sorted according to 10 n Obtaining a target remainder by taking remainder When the length of the target remainder is equal to n, the target remainder is determined to be the digital watermark of the queried data; When the length of the target remainder is less than n, the target remainder is padded with zeros at the higher bits so that the length of the target remainder after the high-bit padding is equal to n, and the target remainder after the high-bit padding is used as the digital watermark of the query data.

5. The digital watermark generation method of claim 1 wherein, The method specifically determines whether the query data in the current request needs to be watermarked through the following steps: In response to a data query request sent by a client, obtain the query data currently requested by the client; When the watermark configuration information of the client's query interface is determined to be enabled based on the preset watermark configuration list, it is determined that the currently requested query data needs to be watermarked; wherein, the watermark configuration list stores several query interface names and the watermark configuration information corresponding to each query interface name. When, based on the watermark configuration list, it is determined that the watermark configuration information of the client's query interface is disabled, it is determined that the query data currently requested does not need to be watermarked.

6. The digital watermark generation method of claim 1 wherein, The method further includes: The digital watermark is concatenated with the query data to obtain query data with an embedded watermark. The query data with the embedded watermark is fed back to the client that sent the current request.

7. The digital watermark generation method of claim 6 wherein, The step of concatenating the digital watermark with the query data to obtain query data with an embedded watermark specifically includes: When the query data is a decimal, the digital watermark is directly appended to the end of the query data to obtain the query data with the embedded watermark. When the query data is an integer, the digital watermark is used as the decimal part of the query data and concatenated with the query data to obtain the query data with the embedded watermark.

8. The digital watermark generation method of claim 6 wherein, The method further includes: The digital watermark, the current data interaction time of the request, the client's query message, the query interface name, and the query data with the embedded watermark are stored in a preset database.

9. The digital watermark generation method of claim 5 wherein, The method further includes: When it is detected that the query data in the current request does not require watermarking, the query data is directly fed back to the client.

10. A digital watermark generation apparatus characterized by comprising: include: The hash operation module is used to perform a hash operation based on the query information corresponding to the current query data when it is detected that the current requested query data needs to be watermarked, and obtain a hash array. The first array acquisition module is used to acquire a first array with a preset bit value from the hash array; The second array acquisition module is used to convert the first array into an unsigned number to obtain the second array; A digital watermark generation module is configured to generate a digital watermark for the second array according to 10 n mod, to generate the digital watermark of the query data; wherein n is a preset length of the digital watermark, and n>0; the digital watermark is used to be directly spliced at the tail of the query data or as a decimal part of the query data to be spliced with the query data.

11. A terminal device, comprising: The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the digital watermark generation method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform the digital watermark generation method according to any one of claims 1 to 9.

13. A computer program product, characterised in that, It includes a computer program / instructions that, when executed by a processor, implement the steps of the digital watermark generation method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Watermark embedding and query data providing method and device and data processing method

    CN110866858A

  • Digital watermark adding method and device, electronic equipment and storage medium

    CN112948776A

  • Processing method, system and device for storing image-text data into block chain and storage medium

    CN113535997A