Data processing method, data recognition method, font file generation method and apparatus

By dividing the font file into blocks and using the background color of the blocks to represent watermark data, the problem of digital watermarks being easily covered or lost is solved, realizing the implicit and reliable display of watermark data on web pages and improving the effectiveness of copyright protection.

CN116127419BActive Publication Date: 2026-03-13MASHANG CONSUMER FINANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-09
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

In existing technologies, digital watermarks are easily covered or lost on web pages, making it impossible to effectively protect the copyright of content resources.

Method used

The font file is divided into blocks in the glyph diagram, and the watermark data is represented by the background color of the blocks. This makes the watermark data hidden in the text data. By taking advantage of the fact that the text data is not easily covered, the watermark data is hidden and protected.

Benefits of technology

It effectively reduces the chance of watermark data being covered or lost, improves the robustness of watermark data, and ensures reliable display and copyright protection of watermark data on the page.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116127419B_ABST
    Figure CN116127419B_ABST
Patent Text Reader

Abstract

This application provides a data processing method, a data recognition method, a font file generation method, and an apparatus. The data processing method includes: upon receiving a page data retrieval request for a target page, generating watermark data to identify text data in the target page; constructing a font file; wherein the font file includes multiple glyphs representing characters or symbols; at least one glyph is divided into multiple blocks, and the background color of each block, arranged in the order of the blocks, is used to represent the watermark data; responding to the page data request based on the page data of the target page and the font file, the font file being used to render the text data in the page data of the target page, so that the rendered text data includes the watermark data. This application can improve the robustness of watermark data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer data processing, and in particular to a data processing method, a data recognition method, a font file generation method, and an apparatus. Background Technology

[0002] Currently, with the development of internet technology, the general public has become accustomed to browsing web pages through computer devices. Web pages can provide users with content resources such as images, videos, or text.

[0003] To protect the legitimate rights and interests of content publishers, digital watermarks can be set on web pages. This allows for the tracking of whether the content on a web page has been illegally reproduced.

[0004] In existing technologies, digital watermarks are typically embedded in an image and used as part of the webpage background. However, webpages often contain a lot of content, which can cause the watermarked image to be covered by other images. This can result in the webpage's content resources not being effectively protected. Summary of the Invention

[0005] This application provides a data processing method, a data recognition method, a font file generation method, and an apparatus, which can improve the robustness of watermark data.

[0006] In a first aspect, one embodiment of this application provides a data processing method, the method comprising:

[0007] Upon receiving a page data retrieval request for a target page, watermark data is generated to identify text data in the target page; a font file is constructed; wherein the font file includes multiple glyphs representing characters or symbols; at least one glyph is divided into multiple blocks, and the background color of each block according to the block arrangement order is used to characterize the watermark data; the page data request is responded to based on the page data of the target page and the font file, wherein the font file is used to render the text data in the page data of the target page so that the rendered text data includes the watermark data.

[0008] Secondly, one embodiment of this application provides a data identification method, the method comprising:

[0009] Obtain the rendered target page image as described in the foregoing embodiments; wherein the page image includes a text area; determine marker pixels in the text area; wherein the area in the text area containing the text or symbol including the marker pixels is the target area; divide the pixels of the target area into a specified grid including multiple blocks; wherein the multiple blocks of the specified grid correspond to multiple blocks of the glyph image; each block of the specified grid corresponds to multiple pixels of the target area; set a block value for each block according to the pixels corresponding to each block, and the block values ​​of the multiple blocks in the order of arrangement of the multiple blocks represent the watermark data; wherein, among the multiple blocks, the block value of the block including the marker pixels is a first value, and the block value of the block excluding the marker pixels is a second value; wherein the first value and the second value are different.

[0010] Thirdly, one embodiment of this application provides a font file generation method, including:

[0011] Generate watermark data; generate a glyph grid comprising multiple blocks; wherein the glyph grid carries glyphs representing text or symbols; set background colors for multiple blocks of the glyph grid according to the watermark data to obtain a font file; wherein the background color of each block according to the arrangement order of the multiple blocks is used to characterize the watermark data.

[0012] Fourthly, one embodiment of this application provides a data processing apparatus, comprising:

[0013] A watermark generation unit is configured to generate watermark data to identify text data in the target page when a page data acquisition request for the target page is received; a construction unit is configured to construct a font file, wherein the font file includes multiple glyphs representing characters or symbols; at least one glyph is divided into multiple blocks, and the background color of each block according to the block arrangement order is used to characterize the watermark data; a response unit is configured to respond to the page data request based on the page data of the target page and the font file, wherein the font file is used to render the text data in the page data of the target page so that the rendered text data includes the watermark data.

[0014] Fifthly, one embodiment of this application provides a data identification device, comprising:

[0015] An acquisition unit is used to acquire a page image of the rendered target page as described in the foregoing embodiments; wherein the page image includes a text area; a marker pixel determination unit is used to determine marker pixels in the text area; wherein the text area includes the text or symbols of the marker pixels as the target area; a division unit is used to divide the pixels of the target area into a specified grid including multiple blocks; wherein the multiple blocks of the specified grid correspond to multiple blocks of the glyph image; each block of the specified grid corresponds to multiple pixels of the target area; a value setting unit is used to set a block value for each block according to the pixels corresponding to each block, and the block values ​​of the multiple blocks in the order of arrangement of the multiple blocks represent the watermark data; wherein, among the multiple blocks, the block value of the block including the marker pixel is a first value, and the block value of the block excluding the marker pixel is a second value; wherein the first value and the second value are different.

[0016] Sixthly, one embodiment of this application provides a font file generation apparatus, comprising:

[0017] A data generation unit is used to generate watermark data; a grid generation unit is used to generate a glyph grid including multiple blocks; wherein the glyph grid carries glyphs representing text or symbols; a setting unit is used to set background colors for multiple blocks of the glyph grid according to the watermark data to obtain a font file; wherein the background color of each block according to the arrangement order of the multiple blocks is used to characterize the watermark data.

[0018] In a seventh aspect, one embodiment of this application provides a computer device including a memory and a processor, wherein the memory stores a computer program, characterized in that the processor, when executing the computer program, implements the data processing method, the data recognition method, and the font file generation method described in any of the foregoing embodiments.

[0019] Eighthly, one embodiment of this application provides a computer-readable storage medium storing a computer program thereon, characterized in that, when the computer program is executed by a processor, it implements the data processing method, the data recognition method, and the font file generation method described in any of the foregoing embodiments.

[0020] The various embodiments provided in this application use the background color of blocks to represent watermark data in the glyph diagram of the font file. After the page data using this font file is rendered, since the text data on the page is normally not covered, and the text data uses the aforementioned font file, the watermark data is hidden within the text data, and the watermark data is not covered on the page. This effectively reduces the problem of watermark data loss caused by the overlay of watermark data on the page. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of a page data processing system provided in one embodiment of this application.

[0022] Figure 2 This is a flowchart illustrating a data processing method provided in one embodiment of this application.

[0023] Figure 3 A schematic diagram of a character grid provided for one embodiment of this application.

[0024] Figure 4 This is a schematic diagram illustrating the setting of watermark data in a block of a glyph grid according to one embodiment of this application.

[0025] Figure 5 This is a schematic diagram illustrating the setting of the background color for the watermark data corresponding to the blocks in the glyph grid provided in one embodiment of this application.

[0026] Figure 6 This is a flowchart illustrating a data identification method provided in one embodiment of this application.

[0027] Figure 7 This is a flowchart illustrating a font file generation method provided in one embodiment of this application.

[0028] Figure 8 A schematic diagram of a data processing apparatus provided for one embodiment of this application.

[0029] Figure 9 A schematic diagram of a data recognition device provided in one embodiment of this application.

[0030] Figure 10 A schematic diagram of a font file generation apparatus provided in one embodiment of this application.

[0031] Figure 11 This is a schematic diagram of the architecture of a computer device provided for one embodiment of this application. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0033] The terms "first," "second," etc., used in this application and claims are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein. Furthermore, in this application and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0034] Digital watermarking is a technology that embeds specific data information into digital products to protect the integrity of copyright, prevent copying, or track the whereabouts of products.

[0035] Specifically, for example, watermark data can be added to content resources on certain pages. A common practice is to add watermark data to the edge areas of images, so that when the image is reproduced and displayed on the republished page, it carries the watermark data. This watermark data can indicate the image's source; for example, the watermark data could be "Made by XXX". For articles, which are primarily text-based, a combination of text and image is used, adding watermark data to the image. Alternatively, during page rendering, the text can be directly rendered within an image, allowing watermark data to be added to the image including the text area. This watermark data is usually displayed quite intuitively on the image.

[0036] However, watermark data in related technologies is prone to loss. Specifically, for example, if multiple images exist on a page, they may overlap, obscuring the watermark data. In some cases, the party reposting an image may also discover the watermark data and edit the image before publishing it. For example, they might take a screenshot of the image to remove the watermark data.

[0037] Therefore, it is necessary to provide a technical solution that can improve the robustness of watermark data.

[0038] Please see Figure 1This application provides a page data processing system. The page data processing system may include a client and a server. The client may be a computer device with network access capabilities. Specifically, for example, the client may be a desktop computer, tablet computer, laptop computer, smartphone, digital assistant, smart wearable device, shopping guide terminal, television, smart speaker, microphone, etc. Smart wearable devices include, but are not limited to, smart bracelets, smartwatches, smart glasses, smart helmets, smart necklaces, etc. Alternatively, the client may be software that can run on the computer device. The server may be a computer device with certain computing power. It may have a network communication module, processor, and memory, etc. Of course, the server may also refer to software running on the computer device. The server may be a distributed server, or a system with multiple processors, memory, network communication modules, etc., operating collaboratively. Alternatively, the server may be a server cluster formed by several servers. Alternatively, with the development of science and technology, the server may also be a new technical means capable of realizing the corresponding functions of the embodiments described in this specification. For example, it may be a new form of "server" based on quantum computing.

[0039] In the data processing method provided in this application, when the client sends a data acquisition request for a target page to the server, the server, upon receiving the request, first generates watermark data to identify the text data in the target page, then constructs a font file, which includes glyphs with the watermark data hidden within them. The server then sends the page data and font file of the target page to the client in response to the client's page data request. Upon receiving the page data and font file, the client uses the font file to render the text data in the page data, thereby obtaining the page data with the watermark data hidden within it. This achieves the protection of the target page's intellectual property rights.

[0040] Please see Figure 2 One embodiment of this application provides a data processing method. The data processing method can be applied to a server. The data processing method may include the following steps.

[0041] Step S101: Upon receiving a page data retrieval request for a target page, generate watermark data to identify the text data in the target page.

[0042] Users can use a client to send a page data retrieval request to the server, indicating the page they wish to access. This request can include the target page's URL or an access identifier. Upon receiving the request, the server can determine the target page and prepare its data.

[0043] In this embodiment, watermark data can be used to identify text data on a target page. This allows the text data to be tracked when it is reproduced, and the copyright ownership of the text data to be determined.

[0044] Watermark data can serve as a unified identifier for text data, and a corresponding relationship exists between the two. Thus, after obtaining the watermark data, the identified text data can be determined based on it. The watermark data can be a numerical sequence generated by an algorithm based on basic information. In some embodiments, the basic information of the watermark data may include: user information about the copyright holder of the text data; or, the content of the text data; or, user information of the requester who issued the page data retrieval request. This numerical sequence can have a preset length. In some embodiments, preferably, the numerical sequence can be a binary numerical sequence. The length of the numerical sequence can be 2 bytes, 3 bytes, or 4 bytes, etc.

[0045] Algorithms for generating watermarked data can include hash functions. Specifically, for example, an algorithm for generating watermarked data can be a cryptographic hash function, such as a message digest algorithm.

[0046] Step S102: Construct a font file; wherein the font file includes multiple glyphs representing characters or symbols; at least one of the glyphs is divided into multiple blocks, and the background color of each block according to the block arrangement order is used to represent the watermark data.

[0047] In this embodiment, a font file can be constructed for the text data of the target page. The font file represents a vector font. Thus, the font file can be applied to the target page. The font file can include glyphs representing characters or symbols. Specifically, the glyphs can contain characters or symbols. The characters can be from any language, including but not limited to Chinese, English, or Latin. The symbols can be any symbols input using an input method, including but not limited to mathematical symbols, punctuation marks, etc. Therefore, when the target page is displayed, the font file will be used to display the corresponding text data. In this embodiment, watermark data is hidden within the glyphs of the font file, allowing the target page to display its text data. Normally, the text data on the target page needs to be displayed to the reader and therefore will not be covered or obscured by any graphics, symbols, or other elements on the webpage. Therefore, when the watermark data is hidden within the text data of the webpage, the watermark data will still be displayed normally, thus achieving the retention of watermark data on the target page.

[0048] In some implementations, the background of the glyph blocks has high transparency, thus reducing the impact of setting the background color of the glyph blocks on the final display effect when displaying text data using the font file.

[0049] In some implementations, the number of blocks in the glyph diagram can correspond to the length of the numerical sequence representing the watermark data. Specifically, for example, the number of blocks can be 64, and the length of the numerical sequence can be 64 bits. Of course, the number of blocks and the length of the numerical sequence can also be different. Specifically, for example, the number of blocks can be 128, and the length of the numerical sequence can be 64 bits.

[0050] In some implementations, the glyphs representing characters or symbols included in the font file are obtained by: generating a glyph grid comprising multiple blocks; setting a background color for multiple blocks of the glyph grid according to the watermark data; adding glyphs representing characters or symbols to the glyph grid after setting the background color, thereby obtaining a glyph image, wherein the glyphs representing characters or symbols are determined based on the text data of the target page. Specifically, for example, see [link to relevant documentation]. Figure 3 , Figure 4 and Figure 5 A glyph image with a granularity of 256*256 pixels can be constructed. Starting from pixel coordinates (0,0), the glyph image can be created into 32*32 pixel blocks sequentially, resulting in 64 blocks. A background color can be set for each block. In some implementations, the numerical sequence of the watermark data can contain multiple values, each corresponding to a background color for a block. Thus, according to the arrangement of the blocks and the numerical sequence, the value in the numerical sequence sets the background color for the block. Specifically, for example, if the numerical sequence of the watermark data is a binary numerical sequence, the background color corresponding to the value 1 can be set to #00000001 or #FFFFFF01, and the background color corresponding to the value 0 can be set to #00000003. Alternatively, the background color can be set only for the block corresponding to the value 1, while keeping the background color of the block corresponding to the value 0 unchanged.

[0051] In some implementations, a font file may include multiple glyphs, each capable of carrying different characters or symbols. Each glyph can be divided into blocks, with a background color set for the corresponding watermark data. Alternatively, blocks can be divided only for a subset of the glyphs, with the background color set for the corresponding watermark data. In some implementations, the glyphs corresponding to the text data on the target page are preferentially selected for block division, and the background color set for the corresponding watermark data. In this implementation, the glyphs representing characters or symbols are determined based on the text data of the target page. That is, the characters or symbols represented by the glyphs are those included in the text data. Thus, the text data of the final displayed target page can contain glyphs carrying watermark data, thereby enabling the watermark data to be displayed on the target page.

[0052] Step S103: Respond to the page data request based on the page data of the target page and the font file. The font file is used to render the text data in the page data of the target page so that the rendered text data includes the watermark data.

[0053] The page data and font file can be sent as response data to the client that issued the page retrieval request. This ensures that when the client displays the target page, it uses the font file for the text data during the page rendering process. Thus, the watermark data is already included in the text data of the final displayed target page.

[0054] In this embodiment, watermark data is cleverly embedded within multiple glyphs in a font file, and the font file is used to render the text data on the target page. Since text is typically not covered on a webpage, the hidden watermark data within the text data is also protected, thus reducing the likelihood of watermark data being covered or lost. Furthermore, to protect the author's copyright, text data is usually rendered as an image on the initial published page. Therefore, the text data with watermark data, as part of the image, will also be included when the text data is reproduced on other webpages or websites. As can be seen, the data processing method provided in this embodiment makes it less likely for the target page's watermark data to be lost or covered, improving the robustness of the watermark data.

[0055] In some implementations, generating watermark data for identifying text data on the target page includes: obtaining user information; wherein the user information includes user information of the user who published the target page, and / or user information of the user who issued the page data acquisition request; generating an identification code based on the user information, wherein the identification code serves as the watermark data.

[0056] In some cases, watermark data can be generated based on user information, which may include the user information of the user who published the target page, and / or the user information of the user who requested the page data. Specifically, watermark data can be generated based on the user information of the user who published the target page. Thus, after the text data from the target page is reproduced, the copyright ownership of the reproduced page can be determined by identifying the watermark data on the reproduced page. Watermark data can also be generated based on the user information of the user who requested the page data. Therefore, identifying the watermark data on the reproduced page allows the user information of the user who initially reproduced the content from the target page to be identified, facilitating the tracking of reproduction activities.

[0057] An identifier can be used to correspond to and identify text data on a target page. The identifier can be generated based on user information. Different pages may have different identifiers for their text data. Specifically, the algorithm for generating the identifier can include a one-way hash function. For example, the algorithm for generating the identifier can be a cryptographic hash function, such as a message digest algorithm.

[0058] In some embodiments, the watermark data is a numerical sequence including a first value and / or a second value; wherein the first value is different from the second value; setting a background color for multiple blocks of the glyph grid according to the watermark data includes: sequentially reading each value in the numerical sequence according to the arrangement order of each block in the glyph grid, wherein each value corresponds to one block; setting a background color for each block according to the value of each block, wherein the block with the first value has a first background color, and the block with the second value has a second background color.

[0059] In some cases, if the watermark data includes a large number of values, it may be necessary to set multiple background colors for each block. This relatively increases the complexity.

[0060] In this embodiment, the numerical values ​​in the numerical sequence representing the watermark data may include a first value and / or a second value. Specifically, for example, the numerical sequence may be a binary numerical sequence. The first value may be 1, and the second value may be 0. Thus, corresponding to the values ​​1 and 0, the background colors of the corresponding blocks may be different, and the watermark data can be represented by blocks in the glyph diagram. Specifically, for example, the first value and the second value may correspond to different colors.

[0061] In some cases, the values ​​of the data bits in the numerical sequence can be read sequentially to set the background color for the block; wherein the background colors of the blocks corresponding to the first value and the second value are different. A specific color can be set for only one of the first and second values, while the other value can remain unchanged. In this way, the first and second values ​​can be distinguished by the block color of the glyph. Of course, separate colors can be set for the first and second values. In some implementations, for example, the first background color can be set to #00000001 or #FFFFFF01, and the second background color can be set to #00000003.

[0062] Please see Figure 6 This application also provides a page data recognition method. The page data recognition method can be applied to a server. The page data recognition method may include the following steps.

[0063] Step S201: Obtain the page image of the rendered target page as described in any of the foregoing embodiments; wherein the page image includes a text area.

[0064] In some cases, if only the text data of the text area in a page image is captured and placed on another editing page, the font file used may change. In this situation, the watermark data hidden in the text or symbols on the page may be lost. Therefore, it is necessary to capture the page image to maintain the displayed content. The page image is then used as a benchmark to further identify the watermark data.

[0065] In this embodiment, the method for obtaining the page image of the target page can be to download the page data and then convert the page data into a page image. Alternatively, it can be to obtain the page data for a specific page and then convert the page data into a page image.

[0066] In this embodiment, the text area in the page image can display text or symbols. Specifically, for example, the text area can refer to the portion of the page image that displays text.

[0067] Step S202: Determine the marker pixels in the text region; wherein the text region includes the text or symbols of the marker pixels as the target region.

[0068] In this embodiment, watermark data is hidden within the glyphs of the text or symbols. In some cases, watermark data may only be added to a portion of the glyphs of the text or symbols. Therefore, it is necessary to first determine the marker pixels in the text area, and then further parse the watermark data from the text or symbols including the marker pixels.

[0069] Marked pixels can be used to indicate that a portion of pixels contains watermark data. Thus, the watermark data can be further obtained based on the marked pixels. In some implementations, the location of the marked pixels can be determined first, and then the target area can be further determined. Specifically, for example, during page rendering, text or symbols may use a specific font file, so that the watermark data is represented by the background color of the blocks in the glyphs of the text or symbols. The text or symbols containing marked pixels can be used as the target area. Specifically, for example, each text or symbol containing marked pixels can be considered an independent target area. Of course, in some cases, multiple consecutive text or symbols may contain marked pixels; in this case, the entire set of text or symbols can be used as the target area.

[0070] In the final rendered page, the pixel values ​​of the text or symbols corresponding to the glyphs containing the hidden watermark data will differ from the pixel values ​​of the text or symbols corresponding to the glyphs without the hidden watermark data. Specifically, for example, when the glyphs containing the hidden watermark data are rendered to the page, the background color of the glyph block will overlap with the background color of the page background to a certain extent. This results in a difference between the pixel values ​​of the overlapping areas and the non-overlapping areas in the rendered page. This difference can be used to determine the marker pixels. Furthermore, after determining the marker pixels, the text or symbols including the marker pixels can be defined as the target area. The target area includes the marker pixels and a portion of non-marked pixels. In some embodiments, the target area can be used to have a similar or identical shape to the glyph grid in the aforementioned embodiments.

[0071] In some implementations, determining the marker pixels in the text region may include: performing grayscale processing on the page image to obtain a grayscale image of the page image; using the background grayscale of the grayscale image of the page image as a reference, performing binarization processing on the page image to obtain a first process image; using the grayscale of the text or symbols in the text region as a reference, performing binarization processing on the page image to obtain a second process image; and using pixels with the same coordinates but different grayscale values ​​in the first process image and the second process image as the marker pixels.

[0072] In some implementations, the page image can be first processed to obtain a grayscale image of the page image. Then, the target region can be determined within the text area of ​​the grayscale image of the page image.

[0073] In this embodiment, the background color of the page image can be a solid color. The grayscale image of the page image can be binarized using the background grayscale value as a reference to obtain a first process image. The grayscale image of the page image can be binarized using the grayscale value of the text or symbols in the text area as a reference to obtain a second process image. Pixels with the same coordinates but different grayscale values ​​in the first and second process images are designated as the marker pixels, and the area where the marker pixels are located is designated as the target area.

[0074] In this embodiment, the page image is first processed into grayscale. This allows further calculations to be based on the grayscale values ​​in the grayscale image, thus reducing the complexity of the calculations.

[0075] In this embodiment, the page image is binarized based on the background grayscale and the grayscale of the text or symbols, respectively, to obtain a first process image and a second process image. The grayscale values ​​of pixels in both the first and second process images can include a first grayscale value and a second grayscale value, and the first grayscale value and the second grayscale value are different. In the first process image, the grayscale value of the background grayscale of the page image is used as the reference grayscale value. When the grayscale value of a pixel equals the reference grayscale value, the grayscale value corresponding to that pixel in the first process image can be the first pixel value. When the grayscale value of a pixel is not equal to the reference grayscale value, the grayscale value corresponding to that pixel in the first process image can be the second grayscale value. Because the background color of the blocks in the glyph image containing watermark data will overlap with the background color of the page image when rendered to the page. Therefore, when performing binarization processing based on the background grayscale of the page image, at least part of the background of the glyph image containing the watermark data will be identified as the background of the non-page image, and the grayscale value of the corresponding pixel in the first process image will be the second grayscale value.

[0076] The second process image uses the grayscale of the text or symbols in the text area as a baseline. In the second process image, the text or symbols in the page image are maintained, meaning the grayscale value of those pixels can be the second grayscale value. The background of the glyph containing the watermark data is processed to the same color as the background of the entire page image. That is, the grayscale value of the pixels in the background portion of the second process image is the second grayscale value.

[0077] Thus, by comparing the grayscale values ​​of the first and second process images, it can be concluded that there are some differences in grayscale values ​​between the two images. These differences are due to the background color of the block in the glyph image that contains the watermark data. Pixels with the same coordinates but different grayscale values ​​in the first and second process images are the marked pixels.

[0078] In some implementations, determining the marker pixels in the text area may include: obtaining the original image corresponding to the page image; wherein the text area in the original image does not contain the watermark data; comparing the page image with the original image to determine the marker pixels in the page image; wherein the marker pixels are pixels in the page image and the original image that have the same coordinates but different pixel values.

[0079] In this embodiment, the original image can be an image without watermark data corresponding to the page image. Specifically, for example, an initial font file can be obtained, in which the glyphs may not be divided into blocks, and the glyphs in the glyphs of the initial font file are the same as the glyphs in the block-divided glyphs of the font file in the aforementioned embodiment. Page data is rendered based on this initial font file. Thus, the rendered page image serves as the original image, which does not contain watermark data.

[0080] The page image can be compared with the original image to determine the marker pixels in the page image. Specifically, for example, the page image can be compared pixel by pixel with the original image, and pixels in the page image whose pixel values ​​differ from those in the original image can be used as marker pixels.

[0081] Step S203: Divide the pixels of the target region into a specified grid comprising multiple blocks; wherein, the multiple blocks of the specified grid correspond to the multiple blocks of the glyph; each block of the specified grid corresponds to multiple pixels of the target region.

[0082] In this embodiment, after determining the target area, it can be clearly identified that the background of the text or symbols within the target area contains marker pixels. Alternatively, it can be understood that when the text data containing the text or symbols is initially rendered into a page, at least a portion of the glyphs in the font file used for rendering the text or symbols are divided into multiple blocks, and the background colors of these multiple blocks represent watermark data in an ordered sequence. The pixels corresponding to the watermark data in the target area are the marker pixels.

[0083] A specified grid can be constructed to simulate multiple blocks of a glyph. The blocks within the specified grid can correspond to multiple blocks of the glyph. In this way, the specified grid is compared with the target region. This allows the pixels of the target region to be proportionally divided into blocks of the specified grid. In some implementations, the size of the target region can be scaled up or down to match the size of the target region to the specified grid.

[0084] In some implementations, dividing the pixels of the target region into a designated grid can be understood as overlaying the target region with the designated grid. This divides the target region into multiple blocks using the designated grid. In some implementations, the designated grid can also be mapped onto the target region, thus dividing the pixels of the target region into blocks of the designated grid. Alternatively, the pixels of the target region can be mapped directly to the designated grid, dividing the pixels into blocks of the designated grid.

[0085] In some implementations, dividing the pixels of the target region into a designated grid may include: performing a transformation operation on the target region to match the size of the target region with the size of the designated grid; and determining the correspondence between the pixels of the target region and the blocks of the designated grid based on the projection of the pixels of the target region onto the designated grid.

[0086] In this embodiment, the target region is transformed to match its size with the size of the specified grid. Specifically, for example, the specified grid may have a grid granularity. The ratio of the size of the Chinese characters in the target region to the grid granularity can be calculated first. Specifically, for example, a square region can be constructed for each character, and the grid granularity can be a block with a side length of 256 pixels. The ratio between this square region and the grid granularity can be N. Further, the coordinates of the marker pixels are divided by N to change the coordinates of the marker pixels. Furthermore, the marker pixels have start and end coordinates. The result of dividing the start coordinate by the ratio N is rounded up, and the result of dividing the end coordinate by the ratio N is rounded down. Thus, the area enclosed by the adjusted start and end coordinates of the marker pixels can be used to locate the specified grid.

[0087] Step S204: Set a block value for each block according to the pixels corresponding to each block, and the block values ​​of the multiple blocks in the order of arrangement of the multiple blocks represent the watermark data; wherein, among the multiple blocks, the block value of the block including the marker pixel is a first value, and the block value of the block excluding the marker pixel is a second value; wherein, the first value and the second value are different.

[0088] In this embodiment, the marker pixel can be a pixel used to represent a first value in the watermark data. After dividing the pixels of the target area into blocks, the block in which the marker pixel is located can be clearly identified. The block value corresponding to each block can be determined based on whether the block includes the marker pixel. Specifically, the block value of the block that includes the marker pixel can be set as the first value, and the block value of the block that does not include the marker pixel can be set as the second value. The first value can be 1, and the second value can be 0. Thus, according to the arrangement order of the blocks, the block values ​​form a binary value sequence. This binary value sequence can be used to represent the watermark data. Of course, in some embodiments, the first value can also be 0 and the second value can be 1, depending on the specific implementation.

[0089] In some implementations, the binary numerical sequence can be further converted to obtain watermark data expressed in binary data. The watermark data can further clarify user information. Thus, the copyright ownership of text or symbols in the text area of ​​a page image can be further clarified.

[0090] Please see Figure 7 In some embodiments, this application also provides a method for generating font files. The font file generation method can be applied to a server. The font file generation method may include the following steps.

[0091] Step S301: Generate watermark data.

[0092] Step S302: Generate a glyph grid comprising multiple blocks; wherein the glyph grid carries glyphs representing characters or symbols.

[0093] Step S303: Set the background color for multiple blocks of the character grid according to the watermark data to obtain a font file; wherein, the background color of each block according to the arrangement order of the multiple blocks is used to represent the watermark data.

[0094] In this embodiment, watermark data can be hidden using the glyph grid of a font file. This allows text data using that font file to carry watermark data, thus improving the ease of adding watermark data. Furthermore, the watermark data applied to text data in this embodiment exhibits good robustness.

[0095] In this embodiment, the glyph grid can serve as a carrier for the glyphs of characters or symbols. Thus, multiple blocks with set background colors can act as the background for the glyphs. In some embodiments, the background color can be a lighter shade. Furthermore, the background of the glyph image can have good transparency. This reduces the impact of the background color of blocks within the fonts or symbols applied to the font file on the overall visual effect of the page rendered according to the font file.

[0096] The font file provided in this embodiment can be applied to multiple pages. This facilitates adding watermark data to multiple pages. In some embodiments, the watermark data of the font file can be generated based on the user information of the content resource's creator. Thus, the watermark data can be used to represent the creator's user information and identify the text data created by that creator.

[0097] Please see Figure 8 , Figure 8 One embodiment of this application also provides a data processing apparatus, comprising: a watermark generation unit, configured to generate watermark data for identifying text data in the target page upon receiving a page data acquisition request for the target page; a construction unit, configured to construct a font file; wherein the font file includes a plurality of glyphs representing characters or symbols; at least one of the glyphs is divided into a plurality of blocks, and the background color of each block according to the arrangement order of the blocks is used to characterize the watermark data; and a response unit, configured to respond to the page data request based on the page data of the target page and the font file, wherein the font file is used to render the text data in the page data of the target page so that the rendered text data includes the watermark data.

[0098] In some implementations, the watermark generation unit may include: an acquisition module for acquiring user information; wherein the user information includes user information of the user who published the target page, and / or user information of the user who issued the page data acquisition request; and an identifier generation module for generating an identifier based on the user information, wherein the identifier serves as the watermark data.

[0099] In some implementations, the building unit may include: a grid generation module for generating a glyph grid comprising multiple blocks; a background color setting module for setting a background color for multiple blocks of the glyph grid according to the watermark data; and an adding module for adding glyphs representing text or symbols to the glyph grid after setting the background color, thereby obtaining a glyph image, wherein the glyphs representing text or symbols are determined based on the text data of the target page.

[0100] In some embodiments, the watermark data is a sequence of values ​​including a first value and / or a second value; wherein the first value is different from the second value. The background color setting unit may include: a value reading module, configured to sequentially read each value in the value sequence according to the arrangement order of each block in the glyph grid, wherein each value corresponds to one block; and a background color setting module, configured to set a background color for each block according to the value of each block, wherein blocks with a first value have a first background color, and blocks with a second value have a second background color.

[0101] Please see Figure 9 The figure shows an embodiment of this application that also provides a data recognition device, including: an acquisition unit, configured to acquire a page image of a rendered target page as described in any of the foregoing embodiments; wherein the page image includes a text region; a marker pixel determination unit, configured to determine marker pixels in the text region; wherein the text region includes the text or symbols of the marker pixels as a target region; a division unit, configured to divide the pixels of the target region into a specified grid including multiple blocks; wherein the multiple blocks of the specified grid correspond to multiple blocks of the glyph image; each block of the specified grid corresponds to multiple pixels of the target region; a value setting unit, configured to set a block value for each block according to the pixels corresponding to each block, wherein the block values ​​of the multiple blocks arranged in the order of the multiple blocks represent the watermark data; wherein, among the multiple blocks, the block value of the block including the marker pixels is a first value, and the block value of the block excluding the marker pixels is a second value; wherein the first value and the second value are different.

[0102] In some embodiments, the marker pixel determination unit may include: a grayscale processing module, configured to perform grayscale processing on the page image to obtain a grayscale image of the page image; a first processing module, configured to perform binarization processing on the page image using the background grayscale of the grayscale image of the page image as a reference to obtain a first process image; a second processing module, configured to perform binarization processing on the grayscale image using the grayscale of the text or symbols in the text region as a reference to obtain a second process image; and a comparison module, configured to use pixels with the same coordinates and different grayscale values ​​in the first process image and the second process image as the marker pixels.

[0103] In some implementations, the region determination unit may include: an acquisition module, configured to acquire the original image corresponding to the page image; wherein the text region in the original image does not contain the watermark data; and a comparison module, configured to compare the page image with the original image to determine the marker pixels in the page image; wherein the marker pixels are pixels in the page image and the original image that have the same coordinates but different pixel values.

[0104] In some implementations, the partitioning unit may include: a matching module, configured to perform a transformation operation on the target region to match the size of the target region with the size of the specified grid; and a determining module, configured to determine the correspondence between the pixels of the target region and the blocks of the specified grid based on the projection of the pixels of the target region onto the specified grid.

[0105] Please see Figure 10 , Figure 10 An embodiment of this application also provides a font file generation apparatus, comprising: a data generation unit for generating watermark data; a grid generation unit for generating a glyph grid including multiple blocks; wherein the glyph grid carries glyphs representing characters or symbols; and a setting unit for setting background colors for multiple blocks of the glyph grid according to the watermark data to obtain a font file; wherein the background color of each block according to the arrangement order of the multiple blocks is used to characterize the watermark data.

[0106] Please see Figure 11 , Figure 11 An embodiment of this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method described in any of the above embodiments.

[0107] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer, causes the computer to perform the method described in any of the above embodiments.

[0108] This application also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods described in any of the above embodiments.

[0109] It is understood that the specific examples in this document are only intended to help those skilled in the art better understand the embodiments of this application, and are not intended to limit the scope of the invention.

[0110] It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0111] It is understood that the various implementation methods described in this application can be implemented individually or in combination, and the implementation methods in this application are not limited in this respect.

[0112] Unless otherwise stated, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this application includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0113] It is understood that the processor in the embodiments of this application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by the integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0114] It is understood that the memory in the embodiments of this application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Specifically, non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0115] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0116] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.

[0117] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0118] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0119] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0120] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0121] The above description is merely a specific embodiment of this application, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this invention should be determined by the scope of the claims.

Claims

1. A data processing method, characterized by, The method comprises: generating watermark data for identifying text data of a target page upon receiving a page data acquisition request for the target page; constructing a font file; wherein the font file comprises a plurality of glyph images representing characters or symbols; at least one of the glyph images is divided into a plurality of blocks, and the background color of each block in accordance with the arrangement order of the blocks is used to represent the watermark data; responding to the page data request according to the page data of the target page and the font file, the font file being used to render the text data in the page data of the target page, so that the rendered text data comprises the watermark data.

2. The method of claim 1, wherein, The generation of the watermark data for identifying the text data of the target page comprises: obtaining user information; wherein the user information comprises user information of a user publishing the target page and / or user information of a user sending the page data acquisition request; generating an identification code according to the user information, wherein the identification code is used as the watermark data.

3. The method of claim 1, wherein, The plurality of glyph images representing characters or symbols included in the font file are obtained by the following method: generating a glyph grid comprising a plurality of blocks; setting background colors for the plurality of blocks of the glyph grid according to the watermark data; adding glyph images representing characters or symbols to the glyph grid with set background colors to obtain glyph images, wherein the glyph images representing characters or symbols are determined based on the text data of the target page.

4. The method of claim 3, wherein, The watermark data is a numerical sequence comprising a first numerical value and / or a second numerical value; wherein the first numerical value is different from the second numerical value; setting background colors for the plurality of blocks of the glyph grid according to the watermark data comprises: reading each numerical value in the numerical sequence in sequence according to the arrangement order of each block in the glyph grid, wherein each numerical value corresponds to a block; setting background colors for the plurality of blocks according to the numerical values of the plurality of blocks, wherein a block with a first numerical value has a first background color, and a block with a second numerical value has a second background color.

5. A data recognition method characterized by, The method comprises: obtaining a rendered target page image as claimed in claim 1; wherein the page image comprises a text region; determining a marker pixel in the text region; wherein the region where the character or symbol including the marker pixel in the text region is a target region; dividing the pixels of the target region into a specified grid comprising a plurality of blocks; wherein the plurality of blocks of the specified grid correspond to the plurality of blocks of the glyph image; each block of the specified grid corresponds to a plurality of pixels of the target region; setting a block value for each block according to the corresponding pixels of each block, and the block values of the plurality of blocks in accordance with the arrangement order of the plurality of blocks represent the watermark data; wherein in the plurality of blocks, the block value of the block including the marker pixel is a first value, and the block value of the block not including the marker pixel is a second value; wherein the first value and the second value are different.

6. The method of claim 5, wherein, The determination of the marker pixel in the text region comprises: performing gray processing on the page image to obtain a gray image of the page image; performing binarization processing on the page image with the background gray of the gray image of the page image as a reference to obtain a first process image; performing binarization processing on the gray image with the gray of the characters or symbols in the text region as a reference to obtain a second process image; pixels having the same coordinates and different gray values in the first process image and the second process image are taken as the mark pixels.

7. The method of claim 6, wherein, The background color of the page image is a pure color.

8. The method of claim 5, wherein, The method further includes: acquiring an original image corresponding to the page image, wherein the text region in the original image does not have the watermark data; comparing the page image with the original image to determine the mark pixels in the page image, wherein the mark pixels are pixels having the same coordinates but different pixel values in the page image and the original image.

9. The method of claim 5, wherein, The method further includes: performing a transformation operation on the target region to match the size of the target region with the size of the specified grid; determining the correspondence between the pixels of the target region and the blocks of the specified grid according to the projection of the pixels of the target region on the specified grid.

10. A font file generation method characterized by comprising: The method further includes: generating watermark data; generating a glyph grid including a plurality of blocks, wherein the glyph grid carries glyphs representing characters or symbols; setting the background color of the plurality of blocks of the glyph grid according to the watermark data to obtain a font file, wherein the background color of each block in the order of the plurality of blocks is used to represent the watermark data.

11. The method of claim 10, wherein, The watermark data is a data sequence including a first value and / or a second value, wherein the first value is different from the second value; setting the background color of the plurality of blocks of the glyph grid according to the watermark data includes: reading each value in the data sequence in the order of each block in the glyph grid, wherein each value corresponds to a block; setting the background color of each block according to the value of each block, wherein a block with a first value has a first background color and a block with a second value has a second background color.

12. A data processing apparatus, characterized by The method further includes: a watermark generation unit configured to generate watermark data for identifying text data of a target page when receiving a page data acquisition request for the target page; a construction unit configured to construct a font file, wherein the font file includes a plurality of glyph images representing characters or symbols; at least one of the glyph images is divided into a plurality of blocks, and the background color of each block in the order of the blocks is used to represent the watermark data; a response unit configured to respond to the page data request according to the page data of the target page and the font file, wherein the font file is used to render the text data in the page data of the target page, so that the rendered text data includes the watermark data.

13. A data recognition apparatus, characterized by comprising: The method further includes: an acquisition unit configured to acquire a rendered target page image according to claim 1, wherein the page image includes a text region. The marking pixel determining unit is configured to determine a marking pixel in the text region; wherein the text region includes a character or a symbol of the marking pixel as a target region; The dividing unit is configured to divide pixels of the target region into a specified grid including a plurality of blocks; wherein the plurality of blocks of the specified grid correspond to the plurality of blocks of the glyph graph; each block of the specified grid corresponds to a plurality of pixels of the target region; The value setting unit is configured to set a block value for each block according to the pixels corresponding to the each block; the block values of the plurality of blocks in the arrangement order of the plurality of blocks represent the watermark data; wherein the block value of the block including the marking pixel in the plurality of blocks is a first value, and the block value of the block not including the marking pixel is a second value; wherein the first value and the second value are different.

14. A font file generating apparatus characterized by comprising: The data generating unit is configured to generate watermark data; The grid generating unit is configured to generate a glyph grid including a plurality of blocks; wherein the glyph grid carries a glyph representing a character or a symbol; The setting unit is configured to set a background color for the plurality of blocks of the glyph grid according to the watermark data, to obtain a font file; wherein the background color of each block in the arrangement order of the plurality of blocks is used to represent the watermark data. The processor executes the computer program to implement the data processing method of any one of claims 1-4, the data recognition method of any one of claims 5-9, and the font file generation method of claim 10 or 11.

15. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The computer program is executed by the processor to implement the data processing method of any one of claims 1-4, the data recognition method of any one of claims 5-9, and the font file generation method of any one of claims 10-11.

16. A computer readable storage medium having stored thereon a computer program, characterized in that, ​

Citation Information

Patent Citations

  • Page watermark tamper-proofing method and system, electronic equipment and readable storage medium

    CN112966232A

  • Electronic watermark embedding apparatus, electronic watermark embedding method, electronic watermark extracting apparatus, electronic watermark extracting method, and data recording medium

    JP2003209816A