Watermark generation method, device and equipment and computer readable storage medium

By obtaining the device name and screen aspect ratio, dynamically splicing watermark strings and encrypting, the existing watermark generation mechanism is solved, and the dynamic nature and high imitation recognition capabilities of watermarks are achieved, improving the user experience.

CN118941435APending Publication Date: 2024-11-12SHENZHEN SDMC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411010480.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The existing watermark generation mechanism is fixed, easy to be stolen, and has weak imitation capabilities, so it cannot be configured dynamically.

Method used

By obtaining the aspect ratio of the current device name and screen, dynamically determine the number of values ​​and the splicing method of the watermark string, generate the coordinates of the target watermark, increase the dynamicity and randomness of the watermark, and encrypt the watermark string to enhance the imitation and Identification ability.

Benefits of technology

It improves the dynamicity and randomness of the watermark generation mechanism, significantly enhances the counterfeiting and recognition capabilities of watermarks, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941435A_ABST
    Figure CN118941435A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a watermark generation method and device, equipment and a computer readable storage medium. The method comprises the following steps: acquiring a current equipment name and an aspect ratio of a current equipment screen; determining the number of valuing times according to the aspect ratio; splicing the number of valuing times and a watermark character string obtained from a preset watermark character string set according to the number of valuing times to obtain an original watermark character string; splicing a current device name and the original character string to generate a first watermark character string; splicing the number of valuing times and the first watermark character string to generate a second watermark character string; determining coordinates of a target watermark according to the valuing times, the aspect ratio and the second watermark character string; and generating the watermark according to the coordinate of the target watermark. In this way, the dynamic nature and randomness of a watermark generation mechanism are improved, meanwhile, the counterfeiting and recognition capacity of the watermark is enhanced, and the user experience is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing, and in particular to a watermark generation method, apparatus, device and computer-readable storage medium. Background Art

[0002] With the development of science and technology, terminal equipment and video services have developed rapidly. Piracy has always been a common problem, and anti-piracy has become an issue that needs to be focused on at present.

[0003] At present, the commonly used anti-piracy mechanism includes adding a watermark mechanism to the content. However, the current watermark generation mechanism still has the following problems:

[0004] 1. The watermark generation is relatively fixed and easy to be stolen;

[0005] 2. The watermark is relatively fixed, cannot be dynamically configured, and has weak forgery capabilities. Summary of the invention

[0006] According to the embodiments of the present application, a watermark generation scheme is provided, which optimizes the existing watermark generation mechanism. While increasing the dynamics and randomness of the watermark generation mechanism, it also enhances the watermark imitation and recognition capabilities, greatly improving the user experience.

[0007] In a first aspect of the present application, a watermark generation method is provided. The method comprises:

[0008] Get the current device name and the aspect ratio of the current device screen.

[0009] According to the aspect ratio, determining the number of times of taking values;

[0010] The number of times the value is taken is concatenated with a watermark string obtained from a preset watermark string set according to the number of times the value is taken, to obtain an original watermark string;

[0011] Concatenate the current device name and the original watermark string to generate a first watermark string;

[0012] Concatenate the number of times the value is taken and the first watermark character string to generate a second watermark character string;

[0013] Determining the coordinates of the target watermark according to the number of times of taking values, the aspect ratio and the second watermark character string;

[0014] A watermark is generated according to the coordinates of the target watermark.

[0015] Further, determining the number of times of taking values ​​according to the aspect ratio includes:

[0016] Determining a capability level of a current device according to the aspect ratio;

[0017] According to the capability level, the number of times of taking values ​​is determined from a preset random set.

[0018] Further, determining the capability level of the current device according to the aspect ratio includes:

[0019] If the aspect ratio is less than a first threshold, determining that the current device has a first capability value;

[0020] If the aspect ratio is greater than or equal to the first threshold and less than or equal to the second threshold, determining that the current device has a second capability value;

[0021] If the aspect ratio is greater than the second threshold, it is determined that the current device has a third capability value.

[0022] Furthermore, the step of concatenating the number of times the value is taken and the first watermark character string to generate a second watermark character string includes:

[0023] Based on the modulo interlacing rule, the number of value taking and the first watermark character string are concatenated to generate a second watermark character string.

[0024] Furthermore, it also includes:

[0025] The second watermark character string is encrypted.

[0026] Further, encrypting the second watermark character string includes:

[0027] The current device name is used as a secret key to perform RAS encryption on the second watermark string.

[0028] Furthermore, after performing RAS encryption on the second watermark character string, the method further includes:

[0029] The watermark string after RAS encryption is Base64 encrypted.

[0030] In a second aspect of the present application, a watermark generation device is provided. The device comprises:

[0031] The first acquisition module is used to obtain the current device name and the aspect ratio of the current device screen.

[0032] A first determination module, used to determine the number of times of taking values ​​according to the aspect ratio;

[0033] A second acquisition module is used to concatenate the number of value acquisitions and a watermark string acquired from a preset watermark string set according to the number of value acquisitions to obtain an original watermark string;

[0034] A first concatenation module, used for concatenating the current device name and the original watermark string to generate a first watermark string;

[0035] A second concatenation module, used for concatenating the number of value acquisitions and the first watermark character string to generate a second watermark character string;

[0036] A second determination module determines the coordinates of the target watermark according to the number of value acquisitions, the aspect ratio and the second watermark character string;

[0037] The generating module is used to generate a watermark according to the coordinates of the target watermark.

[0038] In a third aspect of the present application, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.

[0039] In a fourth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method according to the first aspect of the present application is implemented.

[0040] The watermark generation method provided in the embodiment of the present application obtains the current device name and the aspect ratio of the current device screen, and determines the number of value taking according to the aspect ratio; obtains a watermark string from a preset watermark string set according to the number of value taking; concatenates the current device name and the watermark string to generate a first watermark string; concatenates the number of value taking and the first watermark string to generate a second watermark string; determines the coordinates of the target watermark according to the number of value taking, the aspect ratio and the second watermark string; generates a watermark according to the coordinates of the target watermark, thereby increasing the dynamics and randomness of the watermark generation mechanism, while enhancing the imitation and recognition capabilities of the watermark, and greatly improving the user experience.

[0041] It should be understood that the contents described in the Summary of the Invention are not intended to limit the key or important features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:

[0043] Figure 1 is a flow chart of a watermark generation method according to an embodiment of the present application;

[0044] Figure 2is a block diagram of a watermark generating device according to an embodiment of the present application;

[0045] Figure 3 It is a schematic diagram of the structure of a terminal device or a server suitable for implementing the embodiments of the present application. DETAILED DESCRIPTION

[0046] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.

[0047] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0048] Figure 1 A flow chart of a watermark generation method according to an embodiment of the present disclosure is shown. The method comprises:

[0049] S110, obtaining the name of the current device and the aspect ratio of the current device screen.

[0050] In this embodiment, the execution subject (eg, a server) of the watermark generation method may obtain the current device name and the aspect ratio of the current device screen through a wired or wireless connection.

[0051] Furthermore, the above-mentioned execution entity can obtain the current device name and the aspect ratio of the current device screen sent by the electronic device (such as a mobile phone, tablet computer and other terminal devices) connected to it for communication, or the current device name and the aspect ratio of the current device screen pre-stored locally.

[0052] Among them, the aspect ratio of the current device screen is defined as an integer as A; the device name is defined as B.

[0053] S120: Determine the number of times of taking values ​​according to the aspect ratio.

[0054] In some embodiments, after the terminal device establishes a connection with the execution entity, it obtains a pre-set random watermark string set and a capability level set G (the default set contains three numerical values); wherein the capability level can be pre-set according to the actual application scenario to control the complexity of the watermark.

[0055] In some embodiments, according to the screen aspect ratio A and the capability level, the number of random value acquisitions C in the random set is obtained; the random set can be preset according to the actual application scenario.

[0056] Specifically, if the aspect ratio is less than a first threshold, determining that the current device is a first capability value;

[0057] If the aspect ratio is greater than or equal to the first threshold and less than or equal to the second threshold, determining that the current device has a second capability value;

[0058] If the aspect ratio is greater than the second threshold, it is determined that the current device has a third capability value.

[0059] For example, if the screen aspect ratio is less than 1, the capability level is G, and the value of the set index is 1; if it is 1 to 1.5, the value of the set index is 2 in set G is taken; if it is greater than 1.5, the value of the set index is 3 in set G is taken (for example, A=2, when the capability level is 2, then C=2 squared 4; different capabilities can be formulated according to business needs).

[0060] S130, concatenating the number of times of taking values ​​and a watermark character string obtained from a preset watermark character string set according to the number of times of taking values ​​to obtain an original watermark character string.

[0061] In some embodiments, a watermark string of a corresponding number of times is obtained from the watermark string set according to the number of times C. For example, if C=4, then 4 random strings are obtained.

[0062] Furthermore, the number of times C is taken and the watermark string obtained are concatenated by alternating concatenation (for example, four strings are taken, 1 and 3 are combined, 2 and 4 are combined and then combined again) to obtain the original watermark string D.

[0063] S140: Concatenate the current device name and the original watermark character string to generate a first watermark character string.

[0064] In some embodiments, the device name B and the original watermark string D may be spliced ​​in a random interlaced manner to generate a first watermark string E. Splicing the device name is more conducive to subsequent anti-counterfeiting identification, enhancing recognition and improving anti-counterfeiting capabilities.

[0065] S150: Concatenate the number of times the value is taken and the first watermark character string to generate a second watermark character string.

[0066] In some embodiments, the number of value acquisitions C and the first watermark string E are concatenated to generate a second watermark string F.

[0067] Specifically, the parity of the Y value can be determined according to the modulo interleaving rule (and the value Y obtained by C%A). If it is an odd number, C is inserted from the Yth position from the front to the back; if it is an even number, C is inserted from the last position to the front Y positions to generate the second watermark string F. For example, when Y=5, which is an odd number, the number C is inserted from the 5th position from the front to the back based on the obtained string E to generate a new string F.

[0068] Furthermore, the second watermark character string F may be encrypted to further enhance security.

[0069] Specifically, the current device name B may be used as a secret key to perform RAS encryption on the second watermark character string F, and then perform Base64 encryption processing.

[0070] S160: Determine the coordinates of the target watermark according to the number of value acquisitions, the aspect ratio, and the second watermark character string.

[0071] In some embodiments, the current device screen can be segmented according to the number of value acquisitions C, taking the width as 320 and the number of value acquisitions C equal to 8 as an example. 320 is divided into 8 parts, and the corresponding values ​​obtained are (0, 40, 80, 120, 160, 200, 240, 280, 320).

[0072] Furthermore, the width set is obtained as K, and the height set is obtained as H (the data stored in K and H are the width and height data after C is equally divided). The coordinates of the upper left corner of the screen are set to (0, 0), and a random number x is dynamically obtained from K and a random number y is dynamically obtained from the set H to obtain the corner mark (x, y). That is, the coordinates (x, y) of the target watermark are obtained.

[0073] S170: Generate a watermark according to the coordinates of the target watermark.

[0074] In some embodiments, according to the coordinates (x, y) of the target watermark, a corresponding watermark is generated on the current device screen.

[0075] According to the embodiments of the present disclosure, the following technical effects are achieved:

[0076] The watermark generation mechanism has been made more dynamic and random, while the watermark imitation and recognition capabilities have been enhanced, greatly improving the user experience.

[0077] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0078] The above is an introduction to the method embodiment. The following is a further explanation of the scheme described in this application through an apparatus embodiment.

[0079] Figure 2 A block diagram 200 of a watermark generating device according to an embodiment of the present application is shown. Figure 2 Shown include:

[0080] The first acquisition module 210 is used to acquire the current device name and the aspect ratio of the current device screen.

[0081] A first determination module 220, configured to determine the number of times of taking values ​​according to the aspect ratio;

[0082] A second acquisition module 230 is used to concatenate the number of value acquisitions and a watermark string acquired from a preset watermark string set according to the number of value acquisitions to obtain an original watermark string;

[0083] A first concatenation module 240 is used to concatenate the current device name and the original watermark string to generate a first watermark string;

[0084] A second concatenation module 250 is used to concatenate the number of times the value is taken and the first watermark string to generate a second watermark string;

[0085] A second determination module 260 determines the coordinates of a target watermark according to the number of times the value is taken, the aspect ratio and the second watermark character string;

[0086] The generating module 270 is used to generate a watermark according to the coordinates of the target watermark.

[0087] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0088] Figure 3 A schematic diagram of the structure of a terminal device or server suitable for implementing an embodiment of the present application is shown.

[0089] like Figure 3As shown, the terminal device or server includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 into the random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the terminal device or server are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0090] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed, so that a computer program read therefrom is installed into the storage section 308 as needed.

[0091] In particular, according to an embodiment of the present application, the above method flow steps can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a machine-readable medium, and the computer program includes a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 309, and / or installed from the removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, the above-mentioned functions defined in the system of the present application are executed.

[0092] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0093] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of the code, and the aforementioned module, program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0094] The units or modules involved in the embodiments described in the present application may be implemented by software or hardware. The units or modules described may also be arranged in a processor. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves.

[0095] As another aspect, the present application further provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable storage medium stores one or more programs, and when the above programs are used by one or more processors to execute the method described in the present application.

[0096] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of application involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the aforementioned application concept. For example, the above features are replaced with (but not limited to) technical features with similar functions applied in the present application.

Claims

1. A watermark generation method, characterized in that: include: Get the current device name and the aspect ratio of the current device screen; According to the aspect ratio, determining the number of times of taking values; The number of times the value is taken is concatenated with a watermark string obtained from a preset watermark string set according to the number of times the value is taken, to obtain an original watermark string; Concatenate the current device name and the original character string to generate a first watermark character string; Concatenate the number of times the value is taken and the first watermark character string to generate a second watermark character string; Determining the coordinates of the target watermark according to the number of times of taking values, the aspect ratio and the second watermark character string; A watermark is generated according to the coordinates of the target watermark.

2. The method according to claim 1, characterized in that: Determining the number of times of taking values ​​according to the aspect ratio includes: Determining a capability level of a current device according to the aspect ratio; According to the capability level, the number of times of taking values ​​is determined from a preset random set.

3. The method according to claim 2, characterized in that Determining the capability level of the current device according to the aspect ratio includes: If the aspect ratio is less than a first threshold, determining that the current device has a first capability value; If the aspect ratio is greater than or equal to the first threshold and less than or equal to the second threshold, determining that the current device has a second capability value; If the aspect ratio is greater than the second threshold, it is determined that the current device has a third capability value.

4. The method according to claim 3, characterized in that The step of concatenating the number of times the value is taken and the first watermark character string to generate a second watermark character string comprises: Based on the modulo interlacing rule, the number of value taking and the first watermark character string are concatenated to generate a second watermark character string.

5. The method according to claim 4, characterized in that Also includes: The second watermark character string is encrypted.

6. The method according to claim 5, characterized in that The encrypting the second watermark character string comprises: The current device name is used as a secret key to perform RAS encryption on the second watermark string.

7. The method according to claim 5, characterized in that After performing RAS encryption on the second watermark character string, the method further includes: The watermark string after RAS encryption is Base64 encrypted.

8. A watermark generating device, characterized in that: include: The first acquisition module is used to obtain the current device name and the aspect ratio of the current device screen. A first determination module, used to determine the number of times of taking values ​​according to the aspect ratio; A second acquisition module is used to concatenate the number of value acquisitions and a watermark string acquired from a preset watermark string set according to the number of value acquisitions to obtain an original watermark string; A first concatenation module, used for concatenating the current device name and the original watermark string to generate a first watermark string; A second concatenation module, used for concatenating the number of value acquisitions and the first watermark character string to generate a second watermark character string; A second determination module determines the coordinates of the target watermark according to the number of value acquisitions, the aspect ratio and the second watermark character string; The generating module is used to generate a watermark according to the coordinates of the target watermark.

9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.