Watermark encryption method for files and file leakage tracing method based on watermark

By determining the watermark location in the file based on user information and browsing time, invisible watermark encryption is achieved, file leakage and traceability is solved, and file security and traceability are ensured.

CN118520476BActive Publication Date: 2024-12-17CCTEG COAL MINING RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410627219.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-12-17
Estimated Expiration
2044-05-20

AI Technical Summary

Technical Problem

In the knowledge base system in the coal field, files are photographed and spread without authorization, resulting in file leakage. The existing watermark encryption methods affect the readability of files and are prone to tampering, making it difficult to effectively trace the source of the leak.

Method used

When browsing a file, the watermark location is determined based on the file type, user information and browsing time, the target text is replaced with watermark text, and the watermark log data is generated, and the watermark log data is embedded in the file to ensure that the watermark does not affect readability and is difficult to tamper with, so as to realize the file Invisible watermark encryption and precise traceability when leaked.

Benefits of technology

The invisible watermark encryption of files is realized, which avoids watermark tampering, ensures the security and traceability of files, prevents unauthorized propagation, and improves the accuracy of leak traceability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520476B_ABST
    Figure CN118520476B_ABST
Patent Text Reader

Abstract

The present application proposes a watermark encryption method for files and a watermark-based file leakage tracing method. The watermark encryption method for files includes: determining the file to be browsed, user information and browsing time according to the file browsing request; if the file type of the file to be browsed is a text file type, determining the content information that can be accommodated on each page of the file to be browsed, and determining the watermark position of each page in the file to be browsed according to the content information, user information and browsing time; obtaining the content of the current page to be displayed in the file to be browsed, and determining the target text located at the watermark position in the current page to be displayed; replacing the target text with the watermark text corresponding to the target text, and displaying the replaced content of the current page to be displayed on the display interface, and generating the first watermark log data. The generated watermark in this scheme can be embedded in the text, which can not only avoid tampering with the watermark, but also can be accurately traced based on the watermark.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information security technology, and in particular to a watermark encryption method for a file and a watermark-based file leakage tracing method. Background Art

[0002] The knowledge base system in the coal industry stores a large number of academic documents, mainly scientific research reports and papers, as well as drawings of coal mine tunnels, support equipment and other equipment. These files are important data assets in the coal industry and need to be highly secure. However, when browsing these files in the knowledge base system, some users will take photos without authorization and illegally spread these files, causing the leakage of related files.

[0003] In the related art, in order to prevent file leakage, watermarks are used to encrypt and protect files, which can not only remind users that the files they are browsing cannot be leaked, but also can be traced back through watermarks when these files are leaked. However, most watermarks are obviously visible, which not only affects the readability of the files, but also can be easily tampered with. Summary of the invention

[0004] In order to solve the above problems, the present application provides a file watermark encryption method and a file leakage tracing method based on watermark.

[0005] According to a first aspect of the present application, a watermark encryption method for a file is provided, comprising:

[0006] In response to a file browsing request, determining a file to be browsed, user information, and browsing time according to the file browsing request;

[0007] If the file type of the to-be-browsed file is a text file type, determining content information that can be accommodated in a single page of the to-be-browsed file;

[0008] Determining the watermark position of each page of the to-be-browsed file according to the content information that can be accommodated on the single page, the user information and the browsing time;

[0009] Acquire the content of the current page to be displayed in the file to be browsed, and determine the target text located at the watermark position in the current page to be displayed;

[0010] The target text is replaced with a watermark text corresponding to the target text, and the replaced content of the current page to be displayed is displayed on a display interface, and first watermark log data is generated; wherein the first watermark log data includes identification information of the file to be browsed, the user information, and the watermark position.

[0011] According to a second aspect of the present application, a watermark-based file leakage tracing method is provided, comprising:

[0012] Acquire an image to be traced; wherein the image to be traced includes the file content that is watermark-encrypted based on the file watermark encryption method described in the first aspect above;

[0013] Determine a target file that matches the content in the image to be traced;

[0014] Compare the content of each page in the target file with the content in the image to be traced to determine the target watermark position;

[0015] From the watermark log data corresponding to the target file, according to the target watermark position, the target user information that leaked the target file is determined.

[0016] According to a third aspect of the present application, a file watermark encryption device is provided, comprising:

[0017] A first determination module, configured to respond to a file browsing request and determine a file to be browsed, user information and browsing time according to the file browsing request;

[0018] A second determination module, for determining content information that can be accommodated in a single page of the file to be browsed if the file type of the file to be browsed is a text file type;

[0019] A third determining module is used to determine the watermark position of each page of the to-be-browsed file according to the content information that can be accommodated in the single page, the user information and the browsing time;

[0020] The fourth determination module is used to obtain the content of the current page to be displayed in the to-be-browsed file, and determine the target text located at the watermark position in the current page to be displayed;

[0021] The first generating module is used to replace the target text with the watermark text corresponding to the target text, and display the replaced content of the current page to be displayed on the display interface, and generate the first watermark log data; wherein, the first watermark log data includes the identification information of the file to be browsed, the user information, and the watermark position.

[0022] According to a fourth aspect of the present application, a watermark-based file leakage tracing device is provided, comprising:

[0023] An acquisition module, used for acquiring the image to be traced; wherein the image to be traced includes the file content that is watermark-encrypted based on the watermark encryption method for the file described in the first aspect above;

[0024] A fifth determination module determines a target file that matches the content in the image to be traced;

[0025] A sixth determination module, used to compare the content of each page in the target file with the content in the image to be traced, to determine the target watermark position;

[0026] The seventh determination module is used to determine the target user information that leaked the target file according to the target watermark position from the watermark log data corresponding to the target file.

[0027] According to the fifth aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in the first aspect above is implemented, and / or the method described in the second aspect above is implemented.

[0028] According to the sixth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect above is implemented, and / or the method described in the second aspect above is implemented.

[0029] According to the technical solution of the present application, according to the file browsing request, the file to be browsed, user information and browsing time are determined. If the file type of the file to be browsed is a text file type, the content information that can be accommodated on each page of the file to be browsed is determined, and according to the content information, user information and browsing time, the watermark position of each page in the file to be browsed is determined, the content of the current page to be displayed in the file to be browsed is obtained, and the target text located at the watermark position in the current page to be displayed is determined, the target text is replaced with the watermark text corresponding to the target text, and the replaced content of the current page to be displayed is displayed on the display interface, and the first watermark log data is generated. The generated watermark in this solution can be embedded in the text, which can not only carry enough information for tracing, but also avoid tampering with the watermark. When the file is leaked, it can be accurately traced based on the watermark.

[0030] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0032] Figure 1 A flowchart of a watermark encryption method for a file provided in an embodiment of the present application;

[0033] Figure 2 A flowchart of another file watermark encryption method provided by an embodiment of the present application;

[0034] Figure 3A flowchart of another file watermark encryption method provided by an embodiment of the present application;

[0035] Figure 4 A structural block diagram of a watermark encryption device for a file provided in an embodiment of the present application;

[0036] Figure 5 A structural block diagram of a watermark-based file leakage tracing device provided in an embodiment of the present application;

[0037] Figure 6 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0039] It should be noted that the knowledge base system in the coal field stores a large number of academic documents, mainly scientific research reports and papers, as well as drawings of coal mine tunnels, support equipment and other equipment designs. These files are important data assets in the coal field and need to be extremely secure. However, when browsing these files in the knowledge base system, some users will take photos without authorization and illegally spread these files, causing the leakage of related files.

[0040] In the related art, in order to prevent file leakage, watermarks are used to encrypt and protect files, which can not only remind users that the files they are browsing cannot be leaked, but also can be traced back through watermarks when these files are leaked. However, most watermarks are obviously visible, which not only affects the readability of the files, but also can be easily tampered with.

[0041] In order to solve the above problems, the present application provides a file watermark encryption method and a file leakage tracing method based on watermark.

[0042] Figure 1 This is a flowchart of a watermark encryption method for a file provided in an embodiment of the present application. It should be noted that the watermark encryption method for a file in an embodiment of the present application can be applied to the watermark encryption device for a file in an embodiment of the present application, and the device can be configured in an electronic device. Figure 1 As shown, the method may include:

[0043] Step 101, in response to a file browsing request, determining the file to be browsed, user information and browsing time according to the file browsing request.

[0044] The file browsing request may be generated based on a browsing trigger operation of a user after the user logs into the knowledge base system. The file browsing request may carry information such as identification information of the file to be browsed, user information, and trigger time. The user information may be a user name or user identification information. According to the file browsing request, the identification information, user information, and trigger time of the file to be browsed carried in the file browsing request are obtained, and according to the identification information of the file to be browsed, the file to be browsed is determined, and the trigger time is determined as the browsing time.

[0045] It should be noted that users in the knowledge base system are configured with permissions, and the file browsing request in the embodiment of the present application refers to a file browsing request generated based on a browsing trigger operation of a user who only has browsing permissions.

[0046] Step 102: If the file type of the file to be browsed is a text file type, determine the content information that can be accommodated in a single page of the file to be browsed.

[0047] Among them, the text file type refers to a file that is mainly text, such as a word document or a PDF document. The content information that can be accommodated on a single page of the file to be browsed can be the number of lines that can be accommodated on a single page, the number of words per line, or the number of words that can be accommodated on a single page. As an example, determining the content information that can be accommodated on a single page of the file to be browsed includes: determining the number of lines that can be accommodated on a single page of the file to be browsed, and the number of characters that can be accommodated on each line. Among them, the number of lines that can be accommodated on a single page, that is, the maximum number of lines that can be accommodated on a single page, can be determined based on the size and line spacing information of the file to be browsed, and the number of words that can be accommodated on each line is the maximum number of characters that can be accommodated on each line, which can be determined based on the font size and page size.

[0048] Step 103, determining the watermark position of each page in the to-be-browsed file according to the content information that can be accommodated on a single page, user information and browsing time.

[0049] There may be one or more watermark positions on each page, and the watermark positions on each page may be the same.

[0050] In some embodiments of the present application, user information and browsing information can be encrypted based on a preset encryption algorithm to obtain encrypted values, and then the watermark position can be determined based on the content information that can be accommodated on a single page and the encrypted values.

[0051] As a possible implementation method, the user information can be hashed to obtain the user information hash value; the browsing time can be hashed to obtain the browsing time hash value; the watermark position is determined based on the user information hash value, the browsing time hash value, the number of lines that a single page can accommodate, and the number of characters that each line can accommodate.

[0052] As a possible implementation method, the implementation process of determining the watermark position according to the user information hash value, the browsing time hash value, the number of lines that a single page can accommodate and the number of characters that each line can accommodate can include: comparing the number of lines that a single page can accommodate and the number of characters that each line can accommodate, if the number of lines that a single page can accommodate is greater than or equal to the number of characters that each line can accommodate, then determining a first position value according to the number of lines that a single page can accommodate and the user information hash value; determining a second position value according to the number of characters that can be accommodated in each line and the browsing time hash value, and determining the watermark position according to the first position value and the second position value.

[0053] As another possible implementation method, the implementation process of determining the watermark position based on the user information hash value, the browsing time hash value, the number of lines that a single page can accommodate, and the number of characters that each line can accommodate may include: comparing the number of lines that a single page can accommodate and the number of characters that each line can accommodate, if the number of lines that a single page can accommodate is less than the number of characters that each line can accommodate, then determining the second position value based on the number of characters that can be accommodated per line and the user information hash value; determining the first position value based on the number of lines that a single page can accommodate and the browsing time hash value, and determining the watermark position based on the first position value and the second position value.

[0054] For example, if the user information hash value is m, the browsing time hash value is n, the number of lines that a single page can accommodate is x, and the number of characters that each line can accommodate is y, if x≥y, then the first position value a=m%x, and the second position value b=n%y; if x<y, then the first position value a=n%x, and the second position value b=m%y; the position corresponding to the bth character in the ath row of each page is determined as the watermark position.

[0055] Step 104, obtaining the content of the current page to be displayed in the file to be browsed, and determining the target text located at the watermark position in the current page to be displayed.

[0056] That is, in the content of the current page to be displayed, the text located at the watermark position in the current page to be displayed is determined and used as the target text. Based on the above example, it is equivalent to determining the bth character in the ath line in the current page to be displayed as the target text.

[0057] Step 105, replace the target text with the watermark text corresponding to the target text, display the replaced content of the current page to be displayed on the display interface, and generate first watermark log data; wherein the first watermark log data includes identification information of the file to be browsed, user information, and watermark position.

[0058] In some embodiments of the present application, the target text is replaced with a watermark text corresponding to the target text: the text type of the target text is determined; the watermark text corresponding to the target text is determined according to the text type of the target text and the target text; the target text is replaced with the watermark text corresponding to the target text. Determining the watermark text corresponding to the target text according to the text type of the target text and the target text can be performed based on a preset rule.

[0059] As a possible implementation method, if the text type of the target text is Chinese characters, the similar characters corresponding to the target text can be determined based on a preset Chinese character library and used as watermark text; if the text type of the target text is other than Chinese characters, "*" is used as the watermark text.

[0060] As another possible implementation method, if the text type of the target text is Chinese characters and is not Song font, then the corresponding watermark text is Song font Chinese characters with the same font size and text as the target text; if the target text is Chinese characters and is Song font, then the corresponding watermark text is Fangsong Chinese characters with the same font size and text as the target text; if the target text is punctuation marks and is not "," then "," is used as the corresponding watermark text; if the target text is punctuation marks and is "," then "." is used as the corresponding watermark text; if the text type of the target text is other than the above types, then "*" is used as the watermark text.

[0061] After the target text is replaced with the watermark text, the content of the current page to be displayed after the replacement is displayed on the display interface, which is equivalent to the file content displayed to the user having been encrypted by the watermark. If the user spreads the file content through unauthorized photography, the user can be traced through the watermark in the photographed image.

[0062] It should be noted that when the replaced content of the current page to be displayed is displayed on the display interface, it can be displayed in the form of a snapshot, etc. For example, the replaced content of the current page to be displayed can be converted into a picture format, and the obtained picture can be displayed.

[0063] In some embodiments of the present application, in order to facilitate tracing, first watermark log data can be generated after the replacement display is completed. The first watermark log data may include identification information of the file to be browsed, user information and watermark location information, and may also include browsing time, content information that can be accommodated on a single page, target text and watermark text corresponding to the target text and other information.

[0064] According to the watermark encryption method for files in the embodiment of the present application, according to the file browsing request, the file to be browsed, user information and browsing time are determined. If the file type of the file to be browsed is a text file type, the content information that can be accommodated on each page of the file to be browsed is determined, and according to the content information, user information and browsing time, the watermark position of each page in the file to be browsed is determined, the content of the current page to be displayed in the file to be browsed is obtained, and the target text located at the watermark position in the current page to be displayed is determined, the target text is replaced with the watermark text corresponding to the target text, and the replaced content of the current page to be displayed is displayed on the display interface, and the first watermark log data is generated. The generated watermark in this scheme can be embedded in the text, which can not only carry enough information for tracing, but also avoid tampering with the watermark. When the file is leaked, it can be accurately traced based on the watermark.

[0065] However, the documents in the knowledge base include not only text files but also a large number of drawing files, so the drawing files also need to be watermarked and encrypted.

[0066] Figure 2 This is a flow chart of another file watermark encryption method provided by the embodiment of the present application. Figure 2 As shown, based on the above embodiment, the method further includes:

[0067] Step 201 : if the file type of the file to be browsed is a drawing file type, determine the pixel size of a single page in the file to be browsed.

[0068] Step 202, determining the watermark pixel points of each page in the to-be-browsed file according to the pixel size, user information and browsing time.

[0069] There may be one or more watermark pixels on each page, and the watermark pixels on each page may be the same.

[0070] In some embodiments of the present application, user information and browsing information can be encrypted based on a preset encryption algorithm to obtain encrypted values, and then the watermark pixel points can be determined based on the pixel size and the encrypted values.

[0071] As a possible implementation method, the user information can be hashed to obtain the user information hash value; the browsing time can be hashed to obtain the browsing time hash value; the watermark pixel point is determined based on the user information hash value, the browsing time hash value, and the pixel size of a single page.

[0072] As a possible implementation method, the implementation process of determining the watermark pixel point based on the user information hash value, the browsing time hash value, and the pixel size of a single page may include: determining the length value and width value in the pixel size, comparing the length value with the width value, and if the width value is greater than or equal to the length value, determining the first position value of the pixel point based on the width value and the user information hash value; determining the second position value of the pixel point based on the length value and the browsing time hash value; and determining the watermark pixel point based on the first position value of the pixel point and the second position value of the pixel point.

[0073] As another possible implementation method, the implementation process of determining the watermark pixel point based on the user information hash value, the browsing time hash value, and the pixel size of a single page may include: determining the length value and width value in the pixel size, comparing the length value with the width value, and if the width value is smaller than the length value, determining the first position value of the pixel point based on the width value and the browsing time hash value; determining the second position value of the pixel point based on the length value and the user information hash value; and determining the watermark pixel point based on the first position value of the pixel point and the second position value of the pixel point.

[0074] For example, if the user information hash value is m, the browsing time hash value is n, the pixel size width value is x, and the pixel size length value is y, if x≥y, then the pixel point first position value a=m%x, and the pixel point second position value b=n%y; if x<y, then the pixel point first position value a=n%x, and the pixel point second position value b=m%y; the pixel point at the (a, b) position of each page is determined as the watermark pixel point.

[0075] Step 203, obtain the content of the current page to be displayed in the file to be browsed, add an invisible watermark at the watermark pixel point of the current page to be displayed, and generate second watermark log data; wherein the second watermark log data includes the identification information of the file to be browsed, user information, and watermark pixel points.

[0076] Among them, the invisible watermark can be a watermark of a special shape and is difficult to identify with the naked eye, such as a very thin line. When the invisible watermark is added to the watermark pixel point, the center point of the invisible watermark coincides with the watermark pixel point. Since the added watermark is not easy to be found by the naked eye, it does not affect the readability of the file. Among them, the pixel position of the invisible watermark can carry information for tracing.

[0077] That is to say, the file content displayed to the user for browsing is the file with an invisible watermark added. When the user leaks the file content without authorization by taking photos or other means, the user information can be traced based on the watermark in the leaked image.

[0078] In some embodiments of the present application, the second watermark log data may include information such as browsing time and pixel size in addition to identification information of the file to be browsed, user information, and watermark pixels.

[0079] According to the watermark encryption method for files in the embodiment of the present application, when the file type of the file to be browsed is a drawing file type, the pixel size of a single page in the file to be browsed is determined, and the watermark pixel point of the single page in the file to be browsed is determined based on the pixel size, user information and browsing time, the content of the current page to be displayed in the file to be browsed is obtained, and an invisible watermark is added at the watermark pixel point of the current page to be displayed, and a second watermark log data is generated. In this solution, an invisible watermark can be embedded in the drawing, and the position of the watermark can not only carry enough information for tracing, but also avoid tampering with the watermark. When the file is leaked, it can be accurately traced based on the watermark.

[0080] In order to implement the above embodiment, the present application also provides a watermark-based file leakage tracing method.

[0081] Figure 3 This is a flow chart of a watermark-based file leakage tracing method provided in an embodiment of the present application. Figure 3 As shown, the method may include the following steps:

[0082] Step 301, obtaining an image to be traced; wherein the image to be traced includes file content that has been watermarked and encrypted using the watermark encryption method for files according to the above embodiment.

[0083] That is, the image to be traced is an image leaked by a user through unauthorized photographing of the contents of a text-type file or a drawing-type file. The image to be traced may include the entire page content of the file displayed in the display interface.

[0084] Step 302: determine a target file that matches the content in the image to be traced.

[0085] In some embodiments of the present application, if the content in the image to be traced is of text type, the text content in the image to be traced is identified, and a search is performed based on the identified text content to obtain a target file that matches the content in the image to be traced. If the content in the image to be traced is of drawing type, image recognition and retrieval are performed from drawing type files in the knowledge base based on the image to be traced to obtain a target file that matches the content in the image to be traced.

[0086] Step 303 : Compare the content of each page in the target file with the content in the image to be traced to determine the target watermark position.

[0087] In some embodiments of the present application, if the target file is a text type file, the text content of each page in the target file is compared with the text content in the image to be traced, and it is determined that the text content in the image to be traced is the content of the target page in the target file. The text content in the image to be traced is then compared with the content of the target page to determine the position of inconsistent text between the two, and the position of the inconsistent text is determined as the target watermark position.

[0088] In other embodiments of the present application, if the target file is a drawing type file, the content of each page in the target file is compared with the image to be traced, and it is determined that the image to be traced is the target page content of the target file. The image to be traced is then compared with the drawing content of the target page to determine the pixel position of the invisible watermark, and the pixel position of the invisible watermark is determined as the target watermark position.

[0089] Step 304: Determine the target user information that leaked the target file from the watermark log data corresponding to the target file according to the target watermark position.

[0090] Among them, if the target file is a text type file, the watermark log data corresponding to the target file is the first watermark log data corresponding to the target file; if the target file is not a drawing type file, the watermark log data corresponding to the target file is the second watermark log data corresponding to the target file.

[0091] Since the watermark log data includes the watermark position or watermark pixel position, and user information, the target watermark log data whose watermark position or watermark pixel position is consistent with the target watermark position can be determined from the watermark log data corresponding to the target file, and the user information in the target watermark log data can be determined as the target user information of the leaked target file, thereby tracing the source of the leak.

[0092] According to the watermark-based file leakage tracing method of the embodiment of the present application, by determining the target file that matches the content in the image to be traced, the content of each page in the target file is compared with the content in the image to be traced, the target watermark position is determined, and the target user information of the leaked target file is determined according to the target watermark position from the watermark log data corresponding to the target file. In this way, based on the watermark information in the image to be traced, the user information of the leaked file can be accurately traced, thereby improving the tracing reliability.

[0093] In order to implement the above embodiment, the present application provides a watermark encryption device for a file.

[0094] Figure 4 This is a structural block diagram of a watermark encryption device for a file provided in an embodiment of the present application. Figure 4 As shown, the device comprises:

[0095] A first determination module 401 is used to respond to a file browsing request and determine the file to be browsed, user information and browsing time according to the file browsing request;

[0096] The second determination module 402 is used to determine the content information that can be accommodated in a single page of the file to be browsed if the file type of the file to be browsed is a text file type;

[0097] The third determination module 403 is used to determine the watermark position of each page of the to-be-browsed file according to the content information that can be accommodated on a single page, user information and browsing time;

[0098] The fourth determination module 404 is used to obtain the content of the current page to be displayed in the file to be browsed, and determine the target text located at the watermark position in the current page to be displayed;

[0099] The first generating module 405 is used to replace the target text with the watermark text corresponding to the target text, and display the replaced content of the current page to be displayed on the display interface, and generate the first watermark log data; wherein the first watermark log data includes the identification information of the file to be browsed, user information, and watermark position.

[0100] In some embodiments of the present application, the second determining module 402 is specifically configured to:

[0101] Determine the number of lines that can fit on a single page of the file to be browsed, and the number of characters that can fit on each line.

[0102] As a possible implementation manner, the third determining module 403 is specifically configured to:

[0103] Perform hash calculation on the user information to obtain a hash value of the user information;

[0104] Perform hash calculation on the browsing time to obtain the browsing time hash value;

[0105] The watermark position is determined according to the user information hash value, the browsing time hash value, the number of lines that can be accommodated in each page, and the number of characters that can be accommodated in each line.

[0106] In some embodiments of the present application, the first generating module 405 is specifically used to:

[0107] Determine the text type of the target text;

[0108] Determining a watermark text corresponding to the target text according to the text type of the target text and the target text;

[0109] Replace the target text with the watermark text that corresponds to the target text.

[0110] In some other embodiments of the present application, the device further includes:

[0111] An eighth determination module 406 is used to determine the pixel size of a single page in the file to be browsed if the file type of the file to be browsed is a drawing file type;

[0112] A ninth determination module 407, for determining the watermark pixel points of each page in the to-be-browsed file according to the pixel size, user information and browsing time;

[0113] The second generation module 408 is used to obtain the content of the current page to be displayed in the file to be browsed, add an invisible watermark at the watermark pixel point of the current page to be displayed, and generate second watermark log data; wherein the second watermark log data includes the identification information of the file to be browsed, user information, and watermark pixel points.

[0114] In order to implement the above embodiment, the present application also provides a watermark-based file leakage tracing device.

[0115] Figure 5 This is a structural block diagram of a watermark-based file leakage tracing device provided in an embodiment of the present application. Figure 5 As shown, the device comprises:

[0116] An acquisition module 501 is used to acquire the image to be traced; wherein the image to be traced includes the file content that is watermark-encrypted based on the watermark encryption method for the file in the above embodiment;

[0117] A fifth determination module 502 is used to determine a target file that matches the content in the image to be traced;

[0118] The sixth determination module 503 is used to compare the content of each page in the target file with the content in the image to be traced, and determine the target watermark position;

[0119] The seventh determination module 504 is used to determine the target user information that leaked the target file according to the target watermark position from the watermark log data corresponding to the target file.

[0120] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0121] Figure 6A block diagram of an electronic device provided by an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0122] like Figure 6 As shown, the electronic device includes: one or more processors 601, a memory 602, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 601 is taken as an example.

[0123] The memory 602 is the non-transitory computer-readable storage medium provided by the present application. The memory stores instructions executable by at least one processor, so that the at least one processor executes the watermark encryption method for files provided by the present application, and / or the watermark-based file leakage tracing method. The non-transitory computer-readable storage medium of the present application stores computer instructions, which are used to enable the computer to execute the watermark encryption method for files provided by the present application, and / or the watermark-based file leakage tracing method. The computer program product of the present application includes a computer program, which, when executed by the processor 601, implements the watermark encryption method for files proposed in the present application, and / or the watermark-based file leakage tracing method.

[0124] The memory 602 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the data processing method in the embodiment of the present application. The processor 601 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 602, that is, to implement the watermark encryption method of the file in the above method embodiment, and / or the file leakage tracing method based on the watermark.

[0125] The memory 602 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device processed by voice recognition, etc. In addition, the memory 602 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 602 may optionally include a memory remotely arranged relative to the processor 601, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0126] The electronic device of the data processing method may further include: an input device 603 and an output device 604. The processor 601, the memory 602, the input device 603 and the output device 604 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0127] The input device 603 can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 604 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

[0128] In order to implement the above embodiments, the present disclosure also proposes a computer-readable storage medium.

[0129] When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the watermark encryption method for the file as described above, and / or the watermark-based file leakage tracing method.

[0130] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0131] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0132] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0133] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0134] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0135] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0136] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc.

[0137] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A watermark encryption method for a file, characterized in that: include: In response to a file browsing request, determining a file to be browsed, user information, and browsing time according to the file browsing request; If the file type of the to-be-browsed file is a text file type, determining content information that can be accommodated in a single page of the to-be-browsed file; Determining the watermark position of each page of the to-be-browsed file according to the content information that can be accommodated on the single page, the user information and the browsing time; Acquire the content of the current page to be displayed in the file to be browsed, and determine the target text located at the watermark position in the current page to be displayed; The target text is replaced with a watermark text corresponding to the target text, and the replaced content of the current page to be displayed is displayed on the display interface, and first watermark log data is generated; wherein the first watermark log data includes the identification information of the file to be browsed, the user information and the watermark position; The step of determining the content information that can be contained in a single page of the file to be browsed includes: Determine the number of lines that can be accommodated in a single page of the file to be browsed, and the number of characters that can be accommodated in each line; The step of determining the watermark position of each page of the to-be-browsed text file according to the content information that can be accommodated on the single page, the user information and the browsing time includes: Performing hash calculation on the user information to obtain a user information hash value; Performing hash calculation on the browsing time to obtain a browsing time hash value; The watermark position is determined according to the user information hash value, the browsing time hash value, the number of lines that can be accommodated in each page, and the number of characters that can be accommodated in each line.

2. The method according to claim 1, characterized in that The step of replacing the target text with a watermark text corresponding to the target text comprises: Determining the text type of the target text; Determining the watermark text corresponding to the target text according to the text type of the target text and the target text; The target text is replaced by the watermark text corresponding to the target text.

3. The method according to claim 1, characterized in that: Also includes: If the file type of the to-be-browsed file is a drawing file type, determining the pixel size of a single page in the to-be-browsed file; Determine the watermark pixel points of each page of the to-be-browsed file according to the pixel size, the user information and the browsing time; The content of the current page to be displayed in the file to be browsed is obtained, and an invisible watermark is added at the watermark pixel point of the current page to be displayed, and second watermark log data is generated; wherein the second watermark log data includes the identification information of the file to be browsed, the user information and the watermark pixel point.

4. A watermark-based file leakage tracing method, characterized in that: include: Acquire an image to be traced; wherein the image to be traced includes the file content that is watermark-encrypted based on the watermark encryption method for a file according to any one of claims 1 to 3; Determine a target file that matches the content in the image to be traced; Compare the content of each page in the target file with the content in the image to be traced to determine the target watermark position; From the watermark log data corresponding to the target file, according to the target watermark position, the target user information that leaked the target file is determined.

5. A watermark encryption device for a file, characterized in that: include: A first determination module, configured to respond to a file browsing request and determine a file to be browsed, user information and browsing time according to the file browsing request; A second determination module, for determining content information that can be accommodated in a single page of the file to be browsed if the file type of the file to be browsed is a text file type; A third determining module is used to determine the watermark position of each page of the to-be-browsed file according to the content information that can be accommodated in the single page, the user information and the browsing time; The fourth determination module is used to obtain the content of the current page to be displayed in the to-be-browsed file, and determine the target text located at the watermark position in the current page to be displayed; A first generating module, configured to replace the target text with a watermark text corresponding to the target text, and display the replaced content of the current page to be displayed on a display interface, and generate first watermark log data; wherein the first watermark log data includes identification information of the file to be browsed, the user information and the watermark position; Wherein, the second determining module is specifically used to: Determine the number of lines that can be accommodated in a single page of the file to be browsed, and the number of characters that can be accommodated in each line; The third determination module is specifically used to: Performing hash calculation on the user information to obtain a user information hash value; Performing hash calculation on the browsing time to obtain a browsing time hash value; The watermark position is determined according to the user information hash value, the browsing time hash value, the number of lines that can be accommodated in each page, and the number of characters that can be accommodated in each line.

6. A watermark-based file leakage tracing device, characterized in that: include: An acquisition module, used for acquiring an image to be traced; wherein the image to be traced includes a file content that is watermark-encrypted based on the watermark encryption method for a file according to any one of claims 1 to 3; A fifth determination module, used to determine a target file matching the content in the image to be traced; A sixth determination module, used to compare the content of each page in the target file with the content in the image to be traced, to determine the target watermark position; The seventh determination module is used to determine the target user information that leaked the target file according to the target watermark position from the watermark log data corresponding to the target file.

7. An electronic device, characterized in that: The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the program, the watermark encryption method for a file described in any one of claims 1 to 3 is implemented, and / or the watermark-based file leakage tracing method described in claim 4 is implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the watermark encryption method for a file described in any one of claims 1 to 3, and / or implements the watermark-based file leakage tracing method described in claim 4.

Citation Information

Patent Citations

  • Method of embedding invisible digital watermarking into streaming media, and apparatus and system thereof

    CN103873954A

  • Watermark embedding method and device, electronic equipment and readable storage medium

    CN111680273A