Method, apparatus, electronic device and medium for watermark processing

By generating and sending watermark font files based on client identification information, the problem of background watermark affecting user reading experience in the prior art is solved, and watermark processing without visual influence and text traceability is realized.

CN115797138BActive Publication Date: 2025-06-03BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211540259.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-02
Publication Date
2025-06-03
Estimated Expiration
2042-12-02

AI Technical Summary

Technical Problem

In the prior art, when embedding background watermarks in text, the background watermark and the content of text are displayed superimposedly, which affects the user's reading experience.

Method used

By receiving the watermark font file acquisition request sent by the client, based on the client's identification information, determine the encoding value of the standard font bucket, select a candidate watermark font from the watermark font set corresponding to the standard font as the target watermark font, generate a watermark font file, and send it to the client.

Benefits of technology

This enables no need to embed additional background watermarks, which reduces the visual impact of watermarks on user reading. At the same time, different watermark font files are displayed through different clients, which realizes traceability of text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115797138B_ABST
    Figure CN115797138B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method, apparatus, electronic device, and medium for processing watermarks, and relates to the field of computer technologies. The method includes: receiving a watermark font file acquisition request sent by a client, where the watermark font file acquisition request carries identification information corresponding to the client; determining the encoding values of the buckets of each standard font based on the correspondence between the encoding positions of the buckets of each standard font and the identification information; determining a candidate watermark font from the watermark font set corresponding to the standard font as the target watermark font corresponding to the standard font based on the encoding values of the buckets of the standard font, and generating a watermark font file based on the target watermark fonts corresponding to each standard font; sending a watermark font file acquisition response to the client, where the watermark font file acquisition response includes the watermark font file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to a method, apparatus, electronic device, and medium for processing watermarks. Background Art

[0002] Watermarks are usually used to trace the origin of text. In the prior art, background watermarks are embedded in the text. For example, the name of the reader is embedded in the text. The background watermark and the content of the text are usually superimposed and displayed in the document to increase the difficulty of eliminating the background watermark. However, with the existing method of embedding background watermarks in the text, since the background watermark and the content of the text are superimposed and displayed in the document, it will affect the reading experience of users visually. Summary of the Invention

[0003] To solve the above technical problems, the present disclosure provides a method, apparatus, electronic device, and medium for processing watermarks.

[0004] In a first aspect, the present disclosure provides a method for processing watermarks, including:

[0005] Receiving a watermark font file acquisition request sent by a client, where the watermark font file acquisition request carries identification information corresponding to the client for requesting a watermark font file corresponding to the client;

[0006] Determining the encoding values of the buckets of each standard font based on the correspondence between the encoding positions of the buckets of each standard font and the identification information;

[0007] Based on the encoding values of the buckets of the standard font, determining a candidate watermark font from the watermark font set corresponding to the standard font as the target watermark font corresponding to the standard font, where the watermark font set corresponding to the standard font includes: candidate watermark fonts of different styles obtained by deforming the standard font;

[0008] Generating the watermark font file based on the target watermark fonts respectively corresponding to each standard font, where the watermark font file includes: the target watermark fonts respectively corresponding to each standard font;

[0009] Sending a watermark font file acquisition response to the client, where the watermark font file acquisition response includes the watermark font file, and the watermark font file is used for watermark addition processing.

[0010] In a possible design, the identification information is a multi-digit code;

[0011] The determining the encoding values of the buckets of each standard font based on the correspondence between the encoding positions of the buckets of each standard font and the identification information includes:

[0012] Determine the target bit of each standard font bucket corresponding to the multi - digit code according to the correspondence between the encoding position of the standard font bucket and the multi - digit code;

[0013] Obtain the value corresponding to the target bit of the multi - digit code, and determine that this value is the encoding value of the standard font bucket.

[0014] In a possible design, the multi - digit code is a binary code with a preset length.

[0015] In a possible design, the correspondence between the encoding position of the standard font bucket and the multi - digit code is represented by a starting position and an encoding length.

[0016] In a possible design, before receiving the watermark font file acquisition request sent by the client, it further includes:

[0017] Candidate watermark fonts in different styles obtained by deforming the standard font;

[0018] Establish and store the correspondence between the candidate watermark fonts and the encoding values of the standard font buckets, where the candidate watermark fonts and the encoding values of the standard font buckets are in one - to - one correspondence;

[0019] The determining a candidate watermark font corresponding to the standard font as the target watermark font corresponding to the standard font based on the encoding value of the standard font bucket includes:

[0020] Based on the encoding value of the standard font bucket and the correspondence between the candidate watermark fonts and the encoding values of the standard font buckets, determine the candidate watermark font corresponding to the encoding value of the standard font bucket as the target watermark font corresponding to the standard font.

[0021] In a possible design, the generating the watermark font file based on the target watermark fonts corresponding to each standard font includes:

[0022] Replace the scalable vector graphics SVG of the standard font in the standard font file with the SVG of the corresponding target watermark font to generate a watermark font file.

[0023] In a possible design, the method further includes: receiving a file to be decoded, and obtaining the target watermark font in the file to be decoded;

[0024] Based on the style of the target watermark font, determine the encoding value of the standard font bucket corresponding to the target watermark font;

[0025] Based on the encoding value of the bucket of the standard font and the correspondence between the encoding position of the bucket of the standard font and the identification information, the identification information corresponding to the client is obtained.

[0026] In a second aspect, the present disclosure provides a watermark processing device, including:

[0027] A receiving module, configured to receive a watermark font file acquisition request sent by a client, where the watermark font file acquisition request carries the identification information corresponding to the client and is used to request the watermark font file corresponding to the client;

[0028] A processing module, configured to determine the encoding value of each bucket of the standard font based on the correspondence between the encoding position of each bucket of the standard font and the identification information; based on the encoding value of the bucket of the standard font, determine a candidate watermark font from the watermark font set corresponding to the standard font as the target watermark font corresponding to the standard font, where the watermark font set corresponding to the standard font includes: candidate watermark fonts of different styles obtained by deforming the standard font; based on the target watermark fonts corresponding to each standard font respectively, generate the watermark font file, where the watermark font file includes: the target watermark fonts corresponding to each standard font respectively;

[0029] A sending module, configured to send a watermark font file acquisition response to the client, where the watermark font file acquisition response includes the watermark font file, and the watermark font file is used for watermark addition processing.

[0030] In a possible design, the identification information is a multi-digit code;

[0031] The processing module is specifically configured to determine the target bit of each bucket of the standard font corresponding to the multi-digit code according to the correspondence between the encoding position of the bucket of the standard font and the multi-digit code;

[0032] Obtain the value corresponding to the target bit of the multi-digit code, and determine the value as the encoding value of the bucket of the standard font.

[0033] In a possible design, the multi-digit code is a binary code with a preset length.

[0034] In a possible design, the correspondence between the encoding position of the bucket of the standard font and the multi-digit code is represented by a starting position and an encoding length.

[0035] In a possible design, the device further includes:

[0036] A construction module, configured to obtain candidate watermark fonts of different styles by deforming the standard font;

[0037] Establish and store the corresponding relationship between the encoded values of the buckets of the candidate watermark font and the standard font, where the encoded values of the buckets of the candidate watermark font and the standard font are in one-to-one correspondence;

[0038] The processing module is specifically configured to determine, based on the encoded value of the bucket of the standard font and the corresponding relationship between the encoded values of the buckets of the candidate watermark font and the standard font, that the candidate watermark font corresponding to the encoded value of the bucket of the standard font is the target watermark font corresponding to the standard font.

[0039] In a possible design, the processing module is specifically configured to replace the scalable vector graphics (SVG) of the standard font in the standard font file with the SVG of the corresponding target watermark font to generate a watermark font file.

[0040] In a possible design, the device further includes:

[0041] A parsing module, configured to receive a file to be decoded and obtain the target watermark font in the file to be decoded;

[0042] Determine the encoded value of the bucket of the standard font corresponding to the target watermark font based on the style of the target watermark font;

[0043] Obtain the identification information corresponding to the client based on the encoded value of the bucket of the standard font and the corresponding relationship between the encoded position of the bucket of the standard font and the identification information.

[0044] In a third aspect, the present disclosure provides an electronic device, including: a memory and a processor; the memory is used to store program instructions; the processor is used to call the program instructions in the memory to cause the electronic device to execute the watermark processing method in the first aspect and any possible design of the first aspect.

[0045] In a fourth aspect, the present disclosure provides a computer storage medium, including computer instructions, which when running on an electronic device, cause the electronic device to execute the watermark processing method in the first aspect and any possible design of the first aspect.

[0046] The technical solutions provided by the embodiments of the present disclosure have the following advantages compared with the prior art:

[0047] The watermark processing method, device, electronic device, and medium provided by the embodiments of the present disclosure receive a request for a watermark font file sent by a client. When the request for the watermark font file carries the identification information corresponding to the client, the server can determine the encoding values of the buckets of each standard font based on the corresponding relationship between the encoding positions of the buckets of each standard font and the identification information. Then, based on the encoding values of the buckets of the standard font, a candidate watermark font is determined from the watermark font set corresponding to the standard font as the target watermark font corresponding to the standard font. Based on the target watermark fonts corresponding to each standard font, a watermark font file corresponding to the client is generated, and a response to the request for the watermark font file is sent to the client to enable the client to perform watermark addition processing. Since the watermark fonts in this technical solution are obtained by deforming the standard fonts, there is no need to embed additional background watermarks, which reduces the impact of the watermark on the user's reading visually. At the same time, since each watermark font file corresponding to the client corresponds to the identification information of the client, different watermark font files can be displayed differently on different clients, and the identification information corresponding to the client can be identified based on the different styles of watermark fonts displayed in the text on the client, thereby realizing the traceability of the text. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present disclosure and used together with the specification to explain the principles of the present disclosure.

[0049] To more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the accompanying drawings required for use in the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0050] Figure 1 is an interaction schematic diagram of a watermark processing method provided by an embodiment of the present disclosure;

[0051] Figure 2 is a flowchart of another watermark processing method provided by an embodiment of the present disclosure;

[0052] Figure 3 is a flowchart of yet another watermark processing method provided by an embodiment of the present disclosure;

[0053] Figures 4A - 4E is a schematic diagram of a character display interface provided by an embodiment of the present disclosure;

[0054] Figure 5 is a flowchart of yet another embodiment of a watermark processing method provided by the present disclosure;

[0055] Figure 6 Structural schematic diagram of a watermark processing device provided by an embodiment of the present disclosure;

[0056] Figure 7 Structural schematic diagram of another watermark processing device provided by an embodiment of the present disclosure. Detailed implementation manners

[0057] In order to more clearly understand the above objects, features and advantages of the present disclosure, the solutions of the present disclosure will be further described below. It should be noted that, without conflict, the embodiments of the present disclosure and the features in the embodiments may be combined with each other.

[0058] Many specific details are set forth in the following description in order to provide a thorough understanding of the present disclosure, but the present disclosure may be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only a part of the embodiments of the present disclosure, rather than all the embodiments.

[0059] The watermark processing method of the present disclosure is executed by a server. The server requests a watermark font file from a client, generates a watermark font file corresponding to the client based on the identification information of the client, and sends the watermark font file corresponding to the client to the client, so that the client displays corresponding characters based on the watermark font file.

[0060] Among them, the client can be installed on any electronic device that can process text content. For example, it can be a tablet computer, a mobile phone, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), a smart TV, a smart screen, a high-definition TV, a 4K TV, a smart speaker, a smart projector, etc. The present disclosure does not impose any restrictions on the specific type of the electronic device.

[0061] Among them, the present disclosure does not limit the type of the operating system of the electronic device. For example, Android system, Linux system, Windows system, iOS system, etc.

[0062] Please refer to Figure 1 , Figure 1 which is an interaction schematic diagram of a watermark processing method provided by an embodiment of the present disclosure. As Figure 1 shown, the watermark processing method provided by the present disclosure may include:

[0063] S110. The client sends a request to obtain a watermark font file to the server.

[0064] Among them, the request to obtain the watermark font file is used to request to obtain the watermark font file corresponding to the client, so that the client can display the characters input by the user or the characters in the document opened by the user based on the watermark font file. The watermark font file includes multiple watermark fonts. The watermark font is a font obtained by deforming the standard font. It should be noted that the deformation of the watermark font is only a slight deformation and does not affect the user's recognition of the font. For example, leaving a certain gap between the horizontal and vertical hooks of the standard font "Ding" can be used as a deformed watermark font of "Ding", or the hook of the standard font "Ding" can be deformed into a short horizontal bar as another deformed watermark font of "Ding".

[0065] The client can send a request to obtain the watermark font file to the server when it is first started. The client can also send a request to obtain the watermark font file to the server every time it is started. The client can also send a request to obtain the watermark font file to the server at a preset period. The client can also send a request to obtain the watermark font file to the server after receiving the notice of the update of the watermark font file library from the server side. In this regard, the present disclosure does not make any restrictions.

[0066] The client carries the identification information corresponding to the client in the request to obtain the watermark font file sent, and requests the watermark font file corresponding to the client from the server. The identification information corresponding to the client is used to distinguish different clients, and the client and the identification information are in one-to-one correspondence.

[0067] For example, the identification information of the client can be the identity document (ID) of the client, etc. The ID can be a binary number code with a preset number of digits composed of "0" and "1", or it can also be a code with a preset number of digits composed of decimal numbers, or a code with a preset number of digits in other number systems, etc. The specific setting of the preset number of digits can be determined based on the number of clients. In this regard, the present disclosure does not make any restrictions.

[0068] For example, the identification information corresponding to the client can be a code composed of a fourteen-bit binary number, such as "01010011001111".

[0069] Correspondingly, the server receives the request to obtain the watermark font file sent by the client.

[0070] S120. The server determines the encoding values of the buckets of each standard font based on the corresponding relationship between the encoding positions of the buckets of each standard font and the identification information.

[0071] Each standard font corresponds to a bucket. The server maintains the correspondence between the encoding position of the bucket of the standard font and the identification information. Therefore, the encoding position of the bucket of the standard font can be determined based on the correspondence between the encoding position of the bucket of the standard font and the identification information maintained by the server.

[0072] For example, the identification information is a fourteen-bit binary code, the encoding position of the barrel of the standard font "事" corresponds to the 0th to 1st bits of the identification information, and the encoding position of the barrel of the standard font "跳" corresponds to the 3rd to 5th bits of the identification information.

[0073] After determining the encoding position of the standard font, the encoding value of the bucket of the standard font can be determined based on the identification information. The encoding value of the bucket of the standard font has a corresponding relationship with the watermark font corresponding to the standard font, that is, different encoding values ​​of the bucket of the standard font correspond to different watermark fonts of the standard font. Therefore, based on the encoding value of the bucket of the standard font, it can be determined which watermark font corresponding to the standard font is applied by the client.

[0074] Combined with the above example, the identification information corresponding to the client is "01010011001111". The encoding position of the barrel of the standard font "事" corresponds to the 0th to 1st bit of the identification information, and the 0th to 1st bit of the identification information is "01", so the encoding value of the barrel of the standard font "事" is 1. For another example, the encoding position of the barrel of the standard font "跳" corresponds to the 3rd to 5th bit of the identification information is "100", so the encoding value of the barrel of the standard font "跳" is 4.

[0075] S130: Based on the code value of the bucket of the standard font, determine a candidate watermark font from a watermark font set corresponding to the standard font as a target watermark font corresponding to the standard font.

[0076] The watermark font set corresponding to the standard font includes: candidate watermark fonts of different styles obtained by deforming the standard font.

[0077] For example, the standard font can be transformed into four types, and the watermark font set corresponding to the standard font includes candidate watermark fonts of four different styles.

[0078] The server stores a watermark font set corresponding to the standard font, and based on the encoding value of the bucket of the standard font, a candidate watermark font can be determined from the watermark font set corresponding to the standard font as the target watermark font corresponding to the standard font.

[0079] Combined with the above example, the code value of the bucket of the standard font "事" is 1, so the first variant candidate watermark font can be determined as the target watermark font from the watermark font set corresponding to "事", and the code value of the bucket of the standard font "跳" is 4, so the fourth variant candidate watermark font can be determined as the target watermark font from the watermark font set corresponding to "跳". In the same way, select the target watermark fonts corresponding to other standard fonts.

[0080] S140: Generate the watermark font file based on the target watermark fonts corresponding to the standard fonts.

[0081] The watermark font file includes: target watermark fonts corresponding to each standard font.

[0082] That is, a watermark font file is generated based on the target watermark fonts corresponding to the plurality of standard fonts respectively.

[0083] S150: The server sends a watermark font file acquisition response to the client.

[0084] The watermark font file acquisition response includes the watermark font file, and the watermark font file is used for adding watermark processing.

[0085] When the server determines the watermark font file corresponding to the identification information of the client, the server may send the determined watermark font file to the client.

[0086] Furthermore, after receiving the watermark font file sent by the server, the client displays text based on the watermark font file. For example, when the client opens a text document, it can display the content of the text document based on the watermark font file, or when the client receives a text input request from the user, it can display the corresponding text based on the watermark font file. That is, when the client needs to display a certain text, if the text has a watermark font, the watermark font corresponding to the text is displayed. Since different clients obtain different watermark font files through the above method, different styles of watermark fonts may be displayed on different clients for the same standard font.

[0087] In this embodiment, by receiving a watermark font file acquisition request sent by a client, the identification information corresponding to the client is carried in the watermark font file acquisition request, so that the server can determine the encoding values of the buckets of each standard font based on the corresponding relationship between the encoding positions of the buckets of each standard font and the identification information; and based on the encoding values of the buckets of the standard font, a candidate watermark font is determined from the watermark font set corresponding to the standard font as the target watermark font corresponding to the standard font. Based on the target watermark fonts corresponding to each standard font, a watermark font file corresponding to the client is generated, and a watermark font file acquisition response is sent to the client, so that the client can perform watermark addition processing. Since the watermark font in this technical solution is a deformation of the standard font, there is no need to embed an additional background watermark, which visually reduces the impact of the watermark on the user's reading. At the same time, since the watermark font file corresponding to each client corresponds to the identification information corresponding to the client, different watermark font files can be displayed differently on different clients, and the identification information corresponding to the client can be identified based on the watermark fonts of different styles displayed in the text on the client, thereby realizing the traceability of the text.

[0088] In the above embodiment, since the watermark font file corresponding to the client can be determined through the identification information of the client, and the watermark font file corresponding to the client can be encoded through the identification information of the client, the encoding method is simple and there is no need for additional encoding content, such as identification header information, etc., which shortens the encoding length.

[0089] In the above embodiment, based on the identification information of the client, the watermark font file corresponding to the client determined is a set of fixed watermark font files, so the access is simple. Further, since the target watermark font file in the watermark font file is to determine a candidate watermark font from the watermark font set corresponding to the standard font as the target watermark font corresponding to the standard font, the same character in the watermark font file corresponding to one client is displayed as the same target watermark font everywhere, and there will be no situation where the same character of one client corresponds to multiple target watermark fonts.

[0090] Figure 2 It is a schematic flowchart of another watermark processing method provided by an embodiment of the present disclosure, where the identification information can be multi-digit encoded;

[0091] It should be noted that the multi-digit encoding can be a binary encoding of a preset length, or a decimal encoding of a preset length, or a hexadecimal encoding of a preset length, etc. Among them, the preset length of the encoding is related to the number of clients. For example, the more clients there are, the generally longer the preset length of the encoding is.

[0092] Refer to Figure 2As shown, in the case where the identification information is a multi-digit code, a possible implementation of the above step S120 can be implemented through the following steps S1201 to S1202. Figure 1 The same or similar steps in the embodiment shown are described in detail. Figure 1 The explanations and illustrations in the illustrated embodiments are not repeated in this embodiment.

[0093] S1201. Determine, according to the correspondence between the encoding position of the barrel of the standard font and the multi-digit code, the target position of the barrel of each standard font corresponding to the multi-digit code.

[0094] For example, the corresponding relationship between the encoding position of the barrel of the standard font and the multi-digit encoding is shown in Table 1, where the identification information is a 14-bit binary code:

[0095] Table 1

[0096]

[0097] Optionally, the correspondence between the encoding position of the barrel of the standard font and the multi-digit code can be represented by the starting position and ending position of the standard font in the multi-digit code. For example, combined with the above example, the encoding position of the barrel of the standard font "事" can be represented by the starting position 0 and the ending position 1, and the encoding position of the barrel of the standard font "跳" can be represented by the starting position 3 and the ending position 5.

[0098] Optionally, the correspondence between the code position of the barrel of the standard font and the multi-digit code is represented by the starting position and the code length. For example, in combination with the above example, the code position of the barrel of the standard font "事" can be represented by the starting position 0 and the code length 2, and the code position of the barrel of the standard font "跳" can be represented by the starting position 3 and the code length 3.

[0099] According to the correspondence between the encoding position of the barrel of the standard font and the multi-digit code, the target position of the multi-digit code corresponding to the barrel of each standard font is determined.

[0100] Combined with the above examples, it can be determined that the target bits of the multi-digit code corresponding to the bucket of the standard font "事" are the 0th and 1st bits, and the target bits of the multi-digit code corresponding to the bucket of the standard font "跳" are the 3rd, 4th and 5th bits.

[0101] S1202: Obtain a numerical value corresponding to a target bit of the multi-digit code, and determine that the numerical value is a code value of a bucket of the standard font.

[0102] The numerical value corresponding to the standard font may be the encoding value of the candidate watermark font corresponding to the standard font.

[0103] For example, Table 2 shows the corresponding relationship between the encoding position, the identification information of the client and the standard font, as shown in Table 2, wherein the identification information of the client is composed of 14-bit binary encoding, as shown in Table 2:

[0104] Table 2

[0105]

[0106] Combined with the above example, it can be determined that the target bits of the multi-digit code corresponding to the bucket of the standard font "事" are the 0th and 1st bits, and the values ​​in the identification information corresponding to the 0th and 1st bits are 1 (binary number 01). Therefore, it can be determined that the encoding value of the bucket of "事" is 1; the target bits of the multi-digit code corresponding to the bucket of the standard font "跳" are determined to be the 3rd, 4th and 5th bits; the values ​​in the identification information corresponding to the 3rd, 4th and 5th bits are 4 (binary number 100). Therefore, it can be determined that the encoding value of the bucket of the standard font "跳" is 4.

[0107] In this embodiment, according to the correspondence between the code position of the barrel of the standard font and the multi-digit code, the target position of the multi-digit code corresponding to the barrel of each standard font is determined, the value corresponding to the target position of the multi-digit code is obtained, and the value is determined as the code value of the barrel of the standard font. Thus, the code value of the barrel of the standard font is obtained.

[0108] Since the server maintains the correspondence between the encoding position of the standard font bucket and the multi-digit code, standard fonts can be flexibly added or deleted. For example, if there are 1,000 standard fonts with corresponding watermark fonts, there are 1,000 standard font buckets with corresponding encoding positions and multi-digit codes. If a new standard font corresponding to a watermark font is created, the corresponding relationship between the encoding position of the new standard font and the multi-digit code can be added. If you want the original standard font corresponding to the watermark font to always be displayed in the standard font in the text document, you can delete the corresponding relationship between the encoding position of the standard font bucket and the multi-digit code.

[0109] Optionally, the corresponding relationship between the encoding position of the standard font and the barrel and the multi-digit code can also be adjusted on the server side as needed. For example, if the standard font originally has 2 watermark fonts of different styles and 3 watermark fonts of different styles are added, the encoding length of the barrel of the standard font needs to be adjusted from 1 to 3, and accordingly, the corresponding relationship between the encoding position of the barrel of the standard font and the multi-digit code can be adjusted. Similarly, if the standard font originally has 5 watermark fonts of different styles and 2 watermark fonts of different styles are reduced, the encoding length of the barrel of the standard font needs to be adjusted from 3 to 1, and accordingly, the corresponding relationship between the encoding position of the barrel of the standard font and the multi-digit code can be adjusted.

[0110] Figure 3 This is a flowchart of obtaining a watermark font file provided by another embodiment of the present disclosure. Before step S110, receiving a watermark font file obtaining request sent by a client, it also includes the following steps S310 to S320.

[0111] S310: deforming the standard font to obtain candidate watermark fonts of different styles.

[0112] Among them, the styles of candidate watermark fonts corresponding to each standard font are different, which can be obtained by deforming the standard font, for example, by deforming the standard length / standard arc of a radical / stroke in each standard font, to obtain candidate watermark fonts of different styles corresponding to the standard font.

[0113] The encoding length of the bucket of the standard font can be set based on the number of styles of the candidate watermark fonts obtained by the deformation of the standard font. For example, if "事" corresponds to 5 different candidate watermark fonts, the encoding length of the bucket of "事" can be set to 3. For another example, if "丁" corresponds to 2 different candidate watermark fonts, the encoding length of the bucket of "丁" can be set to "1". Since the encoding length of the bucket of the standard font can be determined based on the number of candidate watermark fonts of the standard font, watermark fonts can be flexibly added or deleted.

[0114] S320: Establish and store a correspondence between the encoding values ​​of the buckets of the candidate watermark font and the standard font.

[0115] The encoding values ​​of the buckets of the candidate watermark fonts and the standard fonts correspond one to one.

[0116] In this embodiment, steps S310 and S320 can be completed offline or online.

[0117] Since the server stores the correspondence between the encoding values ​​of the candidate watermark fonts and the buckets of the standard fonts, the number of watermark fonts corresponding to the standard fonts can be flexibly increased or deleted. For example, the original standard font "事" corresponds to 5 different styles of candidate watermark fonts. If a candidate watermark font is added, it is only necessary to add a correspondence between the encoding values ​​of the candidate watermark fonts and the buckets of the standard fonts maintained by the server. Similarly, if the original standard font "事" corresponds to 5 different styles of candidate watermark fonts and a candidate watermark font is deleted, it is only necessary to delete the correspondence between the encoding values ​​of the candidate watermark fonts and the buckets of the standard fonts maintained by the server.

[0118] Optionally, based on the above embodiment, a possible implementation of S130 is implemented as S1301.

[0119] S1301, based on the code value of the bucket of the standard font and the correspondence between the code values ​​of the candidate watermark font and the bucket of the standard font, determine that the candidate watermark font corresponding to the code value of the bucket of the standard font is the target watermark font corresponding to the standard font.

[0120] The server side stores the correspondence between the encoding values ​​of the buckets of the candidate watermark fonts and the standard fonts. Therefore, based on the encoding values ​​of the buckets of the standard fonts, the above correspondence can be matched to determine that the candidate watermark font corresponding to the encoding value of the matching bucket is the target watermark font corresponding to the standard font.

[0121] Optionally, based on any of the above embodiments, the generating of the watermark font file based on the target watermark fonts corresponding to the standard fonts may include: replacing the scalable vector graphics (SVG) of the standard font in the standard font file with the SVG of the corresponding target watermark font, generating a watermark font file, and obtaining a watermark font file corresponding to the identification information, wherein SVG is used to depict the corresponding font, and different SVGs depict different font styles.

[0122] Combined with the above example, suppose that all standard fonts included in the standard font file are as follows Figure 4A As shown in the example, the standard fonts may include: "jump", "rope", "is", "physical", "sports", "China", "one", "item", "very", "important", "important", "of", "sports", "movement"; the styles of candidate watermark fonts corresponding to "jump", "physical", and "China" in the standard fonts can be found in Figure 4B As shown in the example; when it is determined that the value corresponding to "跳" is "4", it indicates that the style of the corresponding target watermark font is the 4th candidate watermark font style, when it is determined that the value corresponding to "体" is "1", it indicates that the style of the corresponding target watermark font is the 1st candidate watermark font style, when it is determined that the value corresponding to "中" is "3", it indicates that the style of the corresponding target watermark font is the 3rd candidate watermark font style, then the determined watermark font file can be referred to Figure 4C As shown in the example.

[0123] in, Figure 4C In the text, “rope”, “is”, “education”, “one”, “item”, “very”, “important”, “important”, “of”, “sports” and “movement” should use the original standard fonts, and “jump”, “body” and “China” should be replaced with the corresponding target watermark font styles.

[0124] In addition, assuming that the standard font file includes some standard fonts, such as "jump", "body", and "China", the watermark font file corresponding to the generated identification information may include three watermark fonts composed of the target watermark font style corresponding to "jump", the target watermark font style corresponding to "body", and the target watermark font style corresponding to "China". For details, please refer to Figure 4D Exemplarily shown.

[0125] Figure 5 As shown in Figure 5 the flowchart of another embodiment of a watermark processing method provided by the present disclosure, the method of this embodiment is as follows:

[0126] S510: Receive the file to be decoded, and obtain the target watermark font in the file to be decoded.

[0127] Among them, the file to be decoded may include: multiple standard fonts and target watermark fonts corresponding to other standard fonts outside the multiple standard fonts.

[0128] All existing target watermark fonts in the file to be decoded are obtained through screening.

[0129] S520: Determine the bucket encoding value of the standard font corresponding to the target watermark font based on the style of the target watermark font.

[0130] Combined with the above example, the file to be decoded is Figure 4C Exemplarily shown. Among them, the target watermark fonts are "jump (the 4th style)", "body (the 1st style)", and "China (the 3rd style)". The bucket encoding value corresponding to "jump (the 4th style)" is "4", the bucket encoding value corresponding to "body (the 1st style)" is "1", and the bucket encoding value corresponding to "China (the 3rd style)" is "3", that is, the bucket encoding values of the standard fonts corresponding to each target watermark font are obtained.

[0131] S530: Obtain the identification information corresponding to the client based on the bucket encoding value of the standard font and the correspondence between the bucket encoding position of the standard font and the identification information.

[0132] Among them, based on the correspondence between the bucket encoding value of the standard font, the bucket encoding position of the standard font and the multi-digit encoding, the numerical value corresponding to the target bit of the multi-digit encoding corresponding to each bucket of the standard font is obtained, and then part or all of the encoding is obtained.

[0133] Combined with the above example, the correspondence between the standard font and the encoding position can be referred to Figure 4EExemplarily, it is determined that the standard fonts corresponding to the target watermark fonts are: "jump", "body", and "middle". It can be obtained that according to the correspondence between the standard fonts and the coding positions of the buckets, and the numerical values corresponding to the target bits of the multi-digit coding, the partial coding can be obtained as shown in Table 8 below.

[0134] Table 8 Partial Coding Table

[0135]

[0136] Based on the partial or all coding, the identification information corresponding to the client is determined, thereby realizing the traceability of the client of the file to be decoded.

[0137] Among them, based on the determined partial coding or all coding, it can be compared with the identification information of each client, thereby determining the corresponding client.

[0138] Since in this embodiment, based on the coding values of the buckets of the standard fonts and the correspondence between the coding positions of the buckets of the standard fonts and the identification information, the identification information corresponding to the client is obtained. The correspondence between the coding position of each standard font bucket and the identification information is independent of each other. Even if there are no watermark fonts corresponding to some coding positions in the document to be decoded, or some target watermark fonts in the document to be decoded are blocked, partial coding of the identification information can still be decoded.

[0139] It should be noted that when all coding is determined, the corresponding client can be accurately found based on all coding; when partial coding is determined, the search range of the client can be effectively reduced, and the screening efficiency can be improved.

[0140] Figure 6 The structural schematic diagram of a watermark processing device provided by the present disclosure is as Figure 6 shown. The watermark processing device 600 of this embodiment includes:

[0141] A receiving module 610, configured to receive a watermark font file acquisition request sent by a client, where the watermark font file acquisition request carries the identification information corresponding to the client, and is used to request the watermark font file corresponding to the client;

[0142] A processing module 620 is configured to determine the encoding values of the buckets of each standard font based on the correspondence between the encoding positions of the buckets of each standard font and the identification information; based on the encoding values of the buckets of the standard font, determine a candidate watermark font from the watermark font set corresponding to the standard font as the target watermark font corresponding to the standard font, where the watermark font set corresponding to the standard font includes: candidate watermark fonts of different styles obtained by deforming the standard font; generate the watermark font file based on the target watermark fonts corresponding to each standard font, where the watermark font file includes: the target watermark fonts corresponding to each standard font.

[0143] A sending module 630 is configured to send a watermark font file acquisition response to the client, where the watermark font file acquisition response includes the watermark font file, and the watermark font file is used for watermark addition processing.

[0144] As an optional implementation manner of an embodiment of the present disclosure, the identification information is a multi-digit code.

[0145] The processing module 620 is specifically configured to determine the target bits of the multi-digit code corresponding to the buckets of each standard font according to the correspondence between the encoding positions of the buckets of the standard font and the multi-digit code; obtain the numerical value corresponding to the target bit of the multi-digit code, and determine the numerical value as the encoding value of the bucket of the standard font.

[0146] As an optional implementation manner of an embodiment of the present disclosure, the multi-digit code is a binary code of a preset length.

[0147] As an optional implementation manner of an embodiment of the present disclosure, the correspondence between the encoding positions of the buckets of the standard font and the multi-digit code is represented by a starting position and an encoding length.

[0148] Figure 7 The structure diagram of the watermark processing device provided by another embodiment of the present disclosure is referred to Figure 7 as shown. On the basis of the device shown in Figure 6 it further includes: a construction module 710 and an analysis module 720;

[0149] The construction module 710 is configured to obtain candidate watermark fonts of different styles obtained by deforming the standard font; establish and store the correspondence between the candidate watermark fonts and the encoding values of the buckets of the standard font, and the candidate watermark fonts and the encoding values of the buckets of the standard font are in one-to-one correspondence.

[0150] The processing module 720 is specifically configured to determine, based on the encoding value of the bucket of the standard font and the corresponding relationship between the encoding values of the buckets of the candidate watermark font and the standard font, that the candidate watermark font corresponding to the encoding value of the bucket of the standard font is the target watermark font corresponding to the standard font.

[0151] As an optional implementation manner of an embodiment of the present disclosure, the processing module 720 is specifically configured to replace the scalable vector graphics SVG of the standard font in the standard font file with the SVG of the corresponding target watermark font to generate a watermark font file.

[0152] As an optional implementation manner of an embodiment of the present disclosure, the apparatus further includes:

[0153] A parsing module 720, configured to receive a file to be decoded, obtain the target watermark font in the file to be decoded; determine the encoding value of the bucket of the standard font corresponding to the target watermark font based on the style of the target watermark font; and obtain the identification information corresponding to the client based on the encoding value of the bucket of the standard font and the corresponding relationship between the encoding position of the bucket of the standard font and the identification information.

[0154] The watermark processing apparatus provided by the present disclosure can execute the foregoing method embodiments, and for the specific implementation principle and technical effects, reference may be made to the foregoing method embodiments, which are not elaborated herein.

[0155] Exemplarily, the present disclosure provides an electronic device, including: one or more processors; a memory; and one or more computer programs; wherein one or more computer programs are stored in the memory; when one or more processors execute the one or more computer programs, the electronic device implements the watermark processing method in the foregoing embodiments.

[0156] Exemplarily, the present disclosure provides a chip system, and the chip system is applied to an electronic device including a memory and a sensor; the chip system includes: a processor; when the processor executes the watermark processing method in the foregoing embodiments.

[0157] Exemplarily, the present disclosure provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the electronic device is caused to implement the watermark processing method in the foregoing embodiments.

[0158] In the above embodiments, all or part of the functions may be implemented by software, hardware, or a combination of software and hardware. When implemented by software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present disclosure are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium. The computer-readable storage medium may be any available medium that can be accessed by the computer or a data storage device such as a server or a data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.

[0159] It should be noted that in this document, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.

[0160] The above are only specific embodiments of the present disclosure, enabling those skilled in the art to understand or implement the present disclosure. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for processing watermark fonts, characterized in that, it includes: Receiving a watermark font file acquisition request sent by a client, where the watermark font file acquisition request carries identification information corresponding to the client for requesting the watermark font file corresponding to the client; the identification information is a multi-digit code; Based on the correspondence between the coding positions of the buckets of each standard font and the identification information, determining the coding values of the buckets of each standard font; Based on the coding values of the buckets of the standard font, determining a candidate watermark font from the watermark font set corresponding to the standard font as the target watermark font corresponding to the standard font, where the watermark font set corresponding to the standard font includes: candidate watermark fonts of different styles obtained by deforming the standard font; Based on the target watermark fonts corresponding to each standard font respectively, generating the watermark font file, where the watermark font file includes: the target watermark fonts corresponding to each standard font respectively; Sending a watermark font file acquisition response to the client, where the watermark font file acquisition response includes the watermark font file, and the watermark font file is used for watermark addition processing.

2. The method according to claim 1, characterized in that, The step of determining the coding values of the buckets of each standard font based on the correspondence between the coding positions of the buckets of each standard font and the identification information includes: According to the correspondence between the coding positions of the buckets of the standard font and the multi-digit code, determining the target bits of the buckets of each standard font corresponding to the multi-digit code; Obtaining the numerical value corresponding to the target bit of the multi-digit code and determining the numerical value as the coding value of the bucket of the standard font.

3. The method according to claim 2, characterized in that, The multi-digit code is a binary code of a preset length.

4. The method according to claim 2 or 3, characterized in that, The correspondence between the coding positions of the buckets of the standard font and the multi-digit code is represented by a starting position and a coding length.

5. The method according to any one of claims 1-3, characterized in that, Before receiving the watermark font file acquisition request sent by the client, it further includes: Candidate watermark fonts of different styles obtained by deforming the standard font; Establishing and storing the correspondence between the candidate watermark fonts and the coding values of the buckets of the standard font, where the candidate watermark fonts and the coding values of the buckets of the standard font are in one-to-one correspondence; The step of determining a candidate watermark font from the watermark font set corresponding to the standard font as the target watermark font corresponding to the standard font based on the coding value of the bucket of the standard font includes: Based on the coding value of the bucket of the standard font and the correspondence between the candidate watermark font and the coding value of the bucket of the standard font, determining the candidate watermark font corresponding to the coding value of the bucket of the standard font as the target watermark font corresponding to the standard font.

6. The method according to any one of claims 1-3, characterized in that, The step of generating the watermark font file based on the target watermark fonts corresponding to each standard font respectively includes: Replace the scalable vector graphics (SVG) of the standard font in the standard font file with the SVG of the corresponding target watermark font to generate a watermark font file.

7. The method according to any one of claims 1-3, wherein, further comprising: Receiving a file to be decoded, and obtaining the target watermark font in the file to be decoded; Determining the encoding value of the bucket of the standard font corresponding to the target watermark font based on the style of the target watermark font; Based on the encoding value of the bucket of the standard font and the correspondence between the encoding position of the bucket of the standard font and the identification information, obtaining the identification information corresponding to the client.

8. A watermark processing device, wherein, comprising: A receiving module, configured to receive a watermark font file acquisition request sent by a client, where the watermark font file acquisition request carries the identification information corresponding to the client, and is used to request the watermark font file corresponding to the client; the identification information is a multi-digit code; A processing module, configured to determine the encoding value of the bucket of each standard font based on the correspondence between the encoding position of the bucket of each standard font and the identification information; Based on the encoding value of the bucket of the standard font, determining a candidate watermark font from the watermark font set corresponding to the standard font as the target watermark font corresponding to the standard font, where the watermark font set corresponding to the standard font includes: candidate watermark fonts of different styles obtained by deforming the standard font; generating the watermark font file based on the target watermark fonts corresponding to each standard font, where the watermark font file includes: the target watermark fonts corresponding to each standard font; A sending module, configured to send a watermark font file acquisition response to the client, where the watermark font file acquisition response includes the watermark font file, and the watermark font file is used for watermark addition processing.

9. An electronic device, comprising: One or more processors; A memory; And one or more computer programs; wherein the one or more computer programs are stored in the memory; characterized in that, when the one or more processors execute the one or more computer programs, the electronic device implements the watermark processing method according to any one of claims 1-7.

10. A computer storage medium, wherein, comprising computer instructions, when the computer instructions run on an electronic device, enabling the electronic device to execute the watermark processing method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Document processing method, device and equipment

    CN114547564A