Digital watermark generation method, device and equipment, medium and program product

The digital watermark is generated through hash operation and 10n remainder, which solves the problem of low watermark concealment in a single short data information scenario and achieves effective confirmation and protection of data assets.

CN118821083AActive Publication Date: 2024-10-22CHINA MOBILE SHANGHAI ICT CO LTD +2
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410549530.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-06
Publication Date
2024-10-22
Estimated Expiration
2044-05-06

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively add digital watermarks in a single short data information scenario, resulting in low concealment, easy to be seen and tampered with, and unable to confirm the asset ownership of the data.

Method used

Hash operation is used to generate digital watermarks. By converting the hash array into an unsigned number and taking the remainder according to 10n, integer watermarks of different lengths are generated to improve concealment and embed the watermark into the query data.

Benefits of technology

The concealment and anti-tampering properties of digital watermarks are improved, ensuring less interference with the original query data and effectively confirming the asset ownership of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118821083A_ABST
    Figure CN118821083A_ABST
Patent Text Reader

Abstract

The invention discloses a digital watermark generation method and device, equipment, a medium and a program product, and the method comprises the steps: carrying out the Hash operation according to the query information corresponding to the current query data when detecting that the current requested query data needs to be added with a watermark, and obtaining a Hash array; acquiring a first array of which the length is a preset bit value from the Hash array; converting the first array into an unsigned number to obtain a second array; the remainder of the second array is obtained according to 10n, and a digital watermark of the query data is generated; wherein n is a preset digital watermark length, and n is greater than 0. According to the method, original information carriers of query data such as pure digital data and short-digit data are small, the remainder can be obtained according to 10n according to watermark requirements of different lengths, integers of different lengths are obtained to serve as digital watermarks, the embedding concealment is improved, and meanwhile it is ensured that interference to the original query data is small.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] At present, in order to facilitate the confirmation of data asset ownership, hidden data watermarks are usually added through data obfuscation technology without changing the use value of the data, such as adding useless lines to data files and embedding feature blocks in image files without changing the display effect of the image, to ensure that the data asset ownership can be confirmed in the event of data leakage. Existing technologies are usually only able to add digital watermarks to large information scenarios such as images, audio and video, large texts, and databases. In the information scenario of a single short data, the original information carrier is small, so the concealment is low and the watermark is difficult to prevent counterfeiting. Once it is discovered, it is easy to cause data tampering. After the digital watermark is tampered with, it will be impossible to confirm the asset ownership of the data. Summary of the invention

[0003] The present invention provides a digital watermark generation method, device, equipment, medium and program product. Considering that the original information carrier of query data such as pure digital data and short bit number is small, it can generate watermarks of different lengths according to 10 n By taking the remainder, we get integers of different lengths as digital watermarks, which improves the embedding concealment while ensuring less interference with the original query data.

[0004] In order to solve the above technical problem, a first aspect of an embodiment of the present 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 according to the query information corresponding to the current query data to obtain a hash array;

[0006] Obtaining a first array having a length of a preset bit value from the hash array;

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

[0008] The second array is divided into 10 n The remainder is taken to generate a digital watermark of the query data; wherein n is a preset digital watermark length, and n>0.

[0009] As a preferred solution, the query information at least includes a query party message, a query interface name, the query data and a time series; performing a hash operation according to the query information corresponding to the current query data to obtain a hash array specifically includes:

[0010] Filling the query information to obtain filling information whose length is a multiple of a preset packet length;

[0011] Grouping the padding information according to the preset grouping length to obtain a plurality of bit groups;

[0012] The plurality of bit groups are iteratively compressed in sequence to obtain the hash array.

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

[0014] According to the preset bit value, obtaining the last several bytes of the hash array;

[0015] Convert a number of the bytes into unsigned numbers, and concatenate them according to the bit order of each byte to obtain the first array.

[0016] As a preferred solution, the second array is divided into 10 n Taking the remainder to generate a digital watermark of the query data specifically includes:

[0017] The second array is divided into 10 n Take the remainder and get the target remainder;

[0018] When the length of the target remainder is equal to n, determining that the target remainder is the digital watermark of the query data;

[0019] When the length of the target remainder is less than n, the target remainder is padded with high-order zeros to make the length of the target remainder after the high-order zero-padded processing equal to n, and the target remainder after the high-order zero-padded processing is used as the digital watermark of the query data.

[0020] As a preferred solution, the method specifically determines whether the query data of the current request needs to be watermarked by the following steps:

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

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

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

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

[0025] splicing the digital watermark with the query data to obtain the query data embedded with the watermark;

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

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

[0028] When the query data is a decimal, the digital watermark is directly concatenated to the end of the query data to obtain the query data embedded with the 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 embedded with the watermark.

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

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

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

[0033] When it is detected that the query data of the current request does not need to be watermarked, the query data is directly fed back to the client.

[0034] A second aspect of an embodiment of the present invention provides a digital watermark generation device, including:

[0035] A hash operation module, for performing a hash operation according to the query information corresponding to the current query data to obtain a hash array when it is detected that the query data currently requested needs to be watermarked;

[0036] A first array acquisition module, used to acquire a first array having a length of a preset bit value from the hash array;

[0037] A second array acquisition module, used for converting the first array into an unsigned number to obtain a second array;

[0038] The digital watermark generation module is used to convert the second array into n The remainder is taken to generate a digital watermark of the query data; wherein n is a preset digital watermark length, and n>0.

[0039] A third aspect of an embodiment of the present invention provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the digital watermark generation method described in any one of the first aspects when executing the computer program.

[0040] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the digital watermark generation method described in any one of the first aspects.

[0041] A fifth aspect of an embodiment of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the digital watermark generation method described in any one of the first aspects.

[0042] Compared with the prior art, the beneficial effect of the embodiment of the present invention is that, considering that the original information carrier of the query data such as pure digital data and short bit number is small, it can be used according to 10 n By taking the remainder, we get integers of different lengths as digital watermarks, which improves the embedding concealment while ensuring less interference with the original query data. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 It is a schematic diagram of the flow of a digital watermark generation method in an embodiment of the present invention;

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

[0045] Figure 3 It is a schematic diagram of the structure of a terminal device in an embodiment of the present invention. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

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

[0048] Step S1, when it is detected that the query data of the current request needs to be watermarked, a hash operation is performed according to the query information corresponding to the current query data to obtain a hash array;

[0049] Step S2, obtaining a first array having a length of a preset bit value from the hash array;

[0050] Step S3, converting the first array into an unsigned number to obtain a second array;

[0051] Step S4, the second array is divided into 10 n The remainder is taken to generate a digital watermark of the query data; wherein n is a preset digital watermark length, and n>0.

[0052] Specifically, when the present embodiment detects that the query data of the current request needs to be watermarked, the hash algorithm has the unidirectional characteristic that there is no regularity between the original information and the hash array, and the original information cannot be obtained from the hash array. This ensures that the hash algorithm process is irreversible, thereby ensuring that the digital watermark generated in the end cannot be tampered with. Therefore, the present 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, in order to further ensure that the digital watermark generated in the end is not easily detected and tampered with, the hash array in the present embodiment is obtained by performing a hash operation based on the current query information, thereby ensuring that the digital watermark of each query data request is dynamic and non-unique.

[0053] In this embodiment, the query data is short data such as pure digital data, short digit data, etc.

[0054] Furthermore, since the original information carrier of the query data such as pure digital data and short bit numbers is small, in order to ensure that the digital watermark generated in the end has high embedding concealment and less interference with the original query data, this embodiment first obtains a first array with a length of a preset bit value from the hash array. For example, the preset bit value is 64 bits, and it can also be set to other values ​​according to actual needs. This embodiment is not specifically limited here. Then, the first array is converted into an unsigned number, for example, the first array is converted into an unsigned integer, so as to obtain a second array. In response to watermark requirements of different lengths, this embodiment converts the second array into 10 n Take the remainder, so as to generate a digital watermark of length n. For example, the second array is divided into 10 6 The remainder is taken, so that an integer consisting of the last 6 digits of the second array can be selected 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 specifically as follows: the highest bit of each byte in the first array is defined as a numerical bit rather than a sign bit. For example, the complement of -1 is 111111111, which is converted to an unsigned number equal to 255.

[0056] The digital watermark generation method provided by the embodiment of the present invention takes into account the small original information carrier of query data such as pure digital data and short bit number, and can generate watermarks of different lengths according to 10 n By taking the remainder, integers of different lengths are obtained as digital watermarks, which improves the embedding concealment, ensures that the digital watermark is not easily detected and tampered with, and ensures that the interference with the original query data is small.

[0057] As a preferred solution, the query information at least includes a query party message, a query interface name, the query data and a time series; performing a hash operation according to the query information corresponding to the current query data to obtain a hash array specifically includes:

[0058] Filling the query information to obtain filling information whose length is a multiple of a preset packet length;

[0059] Grouping the padding information according to the preset group length bits to obtain a plurality of bit groups;

[0060] The plurality of bit groups are iteratively compressed in sequence to obtain the hash array.

[0061] In this embodiment, the query party message, query interface name, query data and time series are used as influencing factors, and the SM3 algorithm is used for hash operation to obtain a hash array with a length of 32 bytes, totaling 256 bits. Specifically, the SM3 algorithm is suitable for digital signatures and verification in commercial cryptographic applications, and its security is equivalent to SHA256. The message packet length is preset to 512 bits, and can also be set to other packet lengths according to actual needs. This embodiment is not specifically limited here. 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 packet length. For example, assuming that the preset packet length is 512 bits, the length of the query information a is b, "1" is filled at the end of a, and then k "0"s are filled, 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 minimum integer that satisfies the condition that "the length of the filling information is a multiple of 512". Furthermore, since the length of the padding 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, the number of bit groups is (b+1+k+64) / 512. Then, for the several bit groups, the compression function is used to perform several rounds of iterative compression, and the number of rounds of iterative compression is equal to the number of bit groups, and finally the above-mentioned hash array is obtained.

[0062] The digital watermark generation method provided by the embodiment of the present invention takes the query party message, query interface name, query data and time series as influencing factors, adopts the SM3 algorithm to perform hash operation, and obtains a hash array with high security, thereby ensuring that the digital watermark finally generated is not easy to be detected and tampered with.

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

[0064] According to the preset bit value, obtaining the last several bytes of the hash array;

[0065] Convert a number of the bytes into unsigned numbers, and concatenate them according to the bit order of each byte to obtain the first array.

[0066] Specifically, this embodiment obtains the last several bytes of the hash array according to the preset bit value required by the first array. For example, if the length of the first array to be obtained is 64 bits, the last 8 bytes of the hash array are obtained. This embodiment does not specifically limit the preset bit value. In the specific implementation process, different preset bit values ​​can be set according to actual application requirements, so as to obtain the last several bytes in the hash array accordingly. Further, the several bytes selected from the hash array are converted into unsigned numbers, that is, the highest bit of each byte is defined as a numerical bit rather than a sign bit, and then spliced ​​according to the bit order of each byte, so as to obtain the above-mentioned first array.

[0067] As a preferred solution, the second array is divided into 10 n Taking the remainder to generate a digital watermark of the query data specifically includes:

[0068] The second array is divided into 10 n Take the remainder and get the target remainder;

[0069] When the length of the target remainder is equal to n, determining that the target remainder is the digital watermark of the query data;

[0070] When the length of the target remainder is less than n, the target remainder is padded with high-order zeros to make the length of the target remainder after the high-order zero-padded processing equal to n, and the target remainder after the high-order zero-padded processing 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, this embodiment divides the second array into 10 n The remainder is taken to obtain a target remainder of a certain length. It can be understood that the length of the target remainder may be equal to n or may be 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 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 converted to 10 4 The target remainder is 255, and its length is less than n. Further, if the length of the target remainder is equal to n, it indicates that the current target remainder has met the preset digital watermark length, so the target remainder is directly used as the digital watermark of the query data. 2The target remainder obtained by taking the second array of remainders is 11, and the digital watermark of the current query 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, so it is necessary to perform high-order zero padding on the target remainder so that the length of the target remainder after high-order zero padding is equal to n, which meets the preset digital watermark length, and thus the target remainder after high-order zero padding is used as the digital watermark of the query data. For example, the above-mentioned target remainder is 10. 4 The second array of remainder is taken, and the final target remainder is 255. It is necessary to fill the high bits of the target remainder with zeros to 4 bits, that is, 0255, and then use 0255 as the digital watermark of the current query data.

[0072] As a preferred solution, the method specifically determines whether the query data of the current request needs to be watermarked by the following steps:

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

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

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

[0076] Specifically, when a data query request initiated by a client is received, the query data currently requested by the client is obtained according to the request content in the data query request. Furthermore, the present embodiment pre-stores watermark configuration information, wherein a number of query interface names and watermark configuration information corresponding to each query interface name are stored, so as to indicate whether the watermark configuration is enabled for such query interface. When the watermark configuration information of the query interface of the current client is determined to be the enabled watermark configuration based on the preset watermark configuration list, it is determined that the query data currently requested needs to be watermarked; when the watermark configuration information of the query interface of the client is determined to be the disabled watermark configuration based on the watermark configuration list, it is determined that the query data currently requested does not need to be watermarked.

[0077] In one embodiment, when it is detected that the query data of the current request does not need to be watermarked, the query data is directly fed back to the client.

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

[0079] splicing the digital watermark with the query data to obtain the query data embedded with the watermark;

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

[0081] Specifically, after generating the digital watermark of the query data of the current request, the digital watermark needs to be further embedded into the query data, that is, the digital watermark and the query data are spliced ​​to obtain the query data embedded with the watermark, and then the query data embedded with the watermark is fed back to the client that sent the current request.

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

[0083] When the query data is a decimal, the digital watermark is directly concatenated to the end of the query data to obtain the query data embedded with the 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 embedded with the watermark.

[0085] Specifically, in this embodiment, when the query data of the current request is a decimal, the generated digital watermark is directly spliced ​​to the end of the query data, that is, the digital watermark is embedded in the decimal part of the query data, while ensuring the embedding concealment, ensuring that the interference to the original query data is small; when the query data is an integer, the digital watermark is used as the decimal part of the query data and spliced ​​with the query data. Specifically, a decimal point is first added to the end of the query data, and then the generated digital watermark is spliced ​​after the decimal point, so as to embed the digital watermark into the decimal part of the query data, while ensuring the embedding concealment, ensuring that the interference to the original query data is small.

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

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

[0088] Specifically, this embodiment stores query interaction information such as digital watermark, current requested data interaction time, client query party message, query interface name, and query data embedded with watermark in a preset database, which can be used for subsequent data asset ownership verification. Specifically, according to the digital watermark information of the data, matching and retrieval are performed through the query interaction information stored in the database, so that the data can be traced and verified, and the ownership of the data assets can be verified to a certain extent. In addition, this embodiment also supports positive verification of data asset ownership through parameters.

[0089] See also Figure 2 The second aspect of the embodiment of the present invention provides a digital watermark generating device 100, comprising:

[0090] The hash operation module 11 is used to perform a hash operation according to the query information corresponding to the current query data to obtain a hash array when it is detected that the query data currently requested needs to be watermarked;

[0091] A first array acquisition module 12, used to acquire a first array having a length of a preset bit value from the hash array;

[0092] A second array acquisition module 13, used for converting the first array into an unsigned number to obtain a second array;

[0093] The digital watermark generating module 14 is used to convert the second array into n The remainder is taken to generate a digital watermark of the query data; wherein n is a preset digital watermark length, and n>0.

[0094] As a preferred solution, the query information at least includes a query party message, a query interface name, the query data and a time series; the hash operation module 11 is used to perform a hash operation according to the query information corresponding to the current query data to obtain a hash array, which specifically includes:

[0095] Filling the query information to obtain filling information whose length is a multiple of a preset packet length;

[0096] Grouping the padding information according to the preset grouping length to obtain a plurality of bit groups;

[0097] The plurality of bit groups are iteratively compressed in sequence to obtain the hash array.

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

[0099] According to the preset bit value, obtaining the last several bytes of the hash array;

[0100] Convert a number of the bytes into unsigned numbers, and concatenate them according to the bit order of each byte to obtain the first array.

[0101] As a preferred solution, the digital watermark generation module 14 is used to convert the second array into n Taking the remainder to generate a digital watermark of the query data specifically includes:

[0102] The second array is divided into 10 n Take the remainder and get the target remainder;

[0103] When the length of the target remainder is equal to n, determining that the target remainder is the digital watermark of the query data;

[0104] When the length of the target remainder is less than n, the target remainder is padded with high-order zeros to make the length of the target remainder after the high-order zero-padded processing equal to n, and the target remainder after the high-order zero-padded processing is used as the digital watermark of the query data.

[0105] As a preferred solution, the device further includes a data query request response module, which is used to:

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

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

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

[0109] As a preferred solution, the device further includes a query data feedback module, which is used to:

[0110] splicing the digital watermark with the query data to obtain the query data embedded with the watermark;

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

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

[0113] When the query data is a decimal, the digital watermark is directly concatenated to the end of the query data to obtain the query data embedded with the 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 embedded with the watermark.

[0115] As a preferred solution, the device further includes an information storage module, which is used to:

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

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

[0118] When it is detected that the query data of the current request does not need to be watermarked, 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 embodiment of the present invention can implement all the processes of the digital watermark generation method described in any of the above embodiments. The functions of each module in the device and the technical effects achieved are respectively the same as the functions and technical effects achieved by the digital watermark generation method described in the above embodiments, and will not be repeated here.

[0120] See also Figure 3 , Figure 3 It is a schematic diagram of the structure of the terminal device 200 provided by an embodiment of the present invention. The third aspect of the embodiment 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, and the processor 21 implements the digital watermark generation method described in any embodiment of the first aspect when executing the computer program.

[0121] Exemplarily, 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 implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to 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 appreciate that the schematic diagram is merely an example of the terminal device 200 and does not constitute a limitation on the terminal device 200. The terminal device 200 may include more or fewer components than shown in the figure, or may combine certain components, or different components. For example, the terminal device 200 may also include input and output devices, network access devices, buses, etc.

[0123] The processor 21 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 21 is the control center of the terminal device 200, and uses various interfaces and lines to connect various parts of the entire terminal device 200.

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

[0125] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the digital watermark generation method described in any embodiment of the first aspect.

[0126] A fifth aspect of the embodiments of the present invention provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the digital watermark generation method described in any embodiment of the first aspect.

[0127] Wherein, if the module / unit integrated in the terminal device 200 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor 21. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memo ry), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.

[0128] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A digital watermark generation method, characterized in that: include: When it is detected that the query data of the current request needs to be watermarked, a hash operation is performed according to the query information corresponding to the current query data to obtain a hash array; Obtaining a first array having a length of a preset bit value from the hash array; Convert the first array into an unsigned number to obtain a second array; The second array is divided into 10 n The remainder is taken to generate a digital watermark of the query data; wherein n is a preset digital watermark length, and n>0.

2. The digital watermark generation method according to claim 1, characterized in that: The query information at least includes a query party message, a query interface name, the query data and a time series; performing a hash operation according to the query information corresponding to the current query data to obtain a hash array specifically includes: Filling the query information to obtain filling information whose length is a multiple of a preset packet length; Grouping the padding information according to the preset grouping length to obtain a plurality of bit groups; The plurality of bit groups are iteratively compressed in sequence to obtain the hash array.

3. The digital watermark generation method according to claim 1, characterized in that: The step of obtaining a first array having a length of a preset bit value from the hash array specifically includes: According to the preset bit value, obtaining the last several bytes of the hash array; Convert a number of the bytes into unsigned numbers, and concatenate them according to the bit order of each byte to obtain the first array.

4. The digital watermark generation method according to claim 1, characterized in that: The second array is divided into 10 n Taking the remainder to generate a digital watermark of the query data specifically includes: The second array is divided into 10 n Take the remainder and get the target remainder; When the length of the target remainder is equal to n, determining that the target remainder is the digital watermark of the query data; When the length of the target remainder is less than n, the target remainder is padded with high-order zeros to make the length of the target remainder after the high-order zero-padded processing equal to n, and the target remainder after the high-order zero-padded processing is used as the digital watermark of the query data.

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

6. The digital watermark generation method according to claim 1, characterized in that: The method further comprises: splicing the digital watermark with the query data to obtain the query data embedded with the watermark; The query data embedded with the watermark is fed back to the client sending the current request.

7. The digital watermark generation method according to claim 6, characterized in that: The step of concatenating the digital watermark with the query data to obtain the query data embedded with the watermark specifically includes: When the query data is a decimal, the digital watermark is directly concatenated to the end of the query data to obtain the query data embedded with the 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 embedded with the watermark.

8. The digital watermark generation method according to claim 6, characterized in that: The method further comprises: The digital watermark, the data interaction time of the current request, the querying party message of the client, the querying interface name and the querying data embedded with the watermark are stored in a preset database.

9. The digital watermark generation method according to claim 5, characterized in that: The method further comprises: When it is detected that the query data of the current request does not need to be watermarked, the query data is directly fed back to the client.

10. A digital watermark generating device, characterized in that: include: A hash operation module, for performing a hash operation according to the query information corresponding to the current query data to obtain a hash array when it is detected that the query data currently requested needs to be watermarked; A first array acquisition module, used to acquire a first array having a length of a preset bit value from the hash array; A second array acquisition module, used for converting the first array into an unsigned number to obtain a second array; The digital watermark generation module is used to convert the second array into n The remainder is taken to generate a digital watermark of the query data; wherein n is a preset digital watermark length, and n>0.

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

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, the device where the computer-readable storage medium is located is controlled to execute the digital watermark generation method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The method comprises a computer program / instruction, which, when executed by a processor, implements 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

  • Database watermark processing method and device, equipment and storage medium

    CN115114599A

  • Watermark adding method and device, electronic equipment, storage medium and program product

    CN117332385A