Watermark generation method, device and equipment

By classifying and performing multimodal analysis on the images in the file, accurately locating the location of sensitive information and adding watermarks, the problem of inaccurate watermark addition in the existing technology is solved, and effective protection of sensitive information in the file is achieved.

CN120654218APending Publication Date: 2025-09-16INSPUR TIANYUAN COMM INFORMATION SYST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510505735.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

The existing method of adding watermarks to documents can easily result in some key documents not being covered by the watermark or key content being obscured, making it difficult to effectively ensure document security.

Method used

By classifying and performing multimodal analysis on the images in the processed files, the location of sensitive information can be accurately located, and watermarks can be added based on the location information to ensure that the watermark covers the sensitive information while avoiding blocking important content.

Benefits of technology

It improves the accuracy of watermark addition, ensures that sensitive information is effectively covered, and enhances the security and integrity of files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120654218A_ABST
    Figure CN120654218A_ABST
Patent Text Reader

Abstract

The invention provides a watermark generation method, device and equipment, and relates to the technical field of watermark processing, and the method comprises the steps: matching the category information of each picture in a to-be-processed file with preset sensitive category information, and determining a to-be-processed picture in the to-be-processed file according to a matching result; performing multi-modal analysis according to the category information of the to-be-processed picture and the image information and the text information of the to-be-processed picture to obtain position information of sensitive information in the to-be-processed picture; and performing watermark generation on the to-be-processed file according to the position information to obtain a target file. According to the method and the device, important information is prevented from being shielded while it is ensured that sensitive information, needing to be protected, of the file can be covered when the watermark is generated, so that the accuracy of adding the watermark to the file is improved, and the safety of the file is better guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of watermark processing, and in particular to a watermark generation method, device and equipment. Background Art

[0002] Some documents often contain sensitive information, such as technical specifications, price details, and business strategies. Leakage of sensitive information can lead to risks such as unfair competition and the disclosure of trade secrets. Therefore, effectively generating watermarks for documents to protect their security is a critical issue that the industry urgently needs to address.

[0003] At present, in the process of adding watermarks to files, batch watermarking is usually adopted. However, this method can easily result in some key documents in the file not being covered by the watermark, or some key content being blocked, resulting in poor accuracy of watermark addition and difficulty in effectively ensuring the security of the file. Summary of the Invention

[0004] The present invention provides a watermark generation method, device and equipment to solve the defects in the prior art.

[0005] The present invention provides a watermark generation method, comprising: Matching the category information of each image in the to-be-processed file with the preset sensitive category information, and determining the to-be-processed image in the to-be-processed file based on the matching result; Performing multimodal analysis based on the category information of the image to be processed, as well as the image information and text information of the image to be processed, to obtain location information of sensitive information in the image to be processed; According to the location information, a watermark is generated for the file to be processed to obtain a target file.

[0006] According to a watermark generation method provided by the present invention, generating a watermark for the to-be-processed file according to the location information to obtain a target file includes: Obtain the watermark to be added corresponding to the image to be processed; According to the position information, the watermark to be added is superimposed on the image to be processed to obtain a target image; Replacing the image to be processed in the file to be processed with the target image to obtain an updated file to be processed; The target file is obtained according to the updated file to be processed.

[0007] According to a watermark generation method provided by the present invention, obtaining the watermark to be added corresponding to the image to be processed includes: Obtaining a target watermark template from a watermark template library according to the generation time of the file to be processed and the category information of the image to be processed; According to the distribution density and location information of the sensitive information in the image to be processed, the target watermark template is updated to obtain a target watermark; Sending the target watermark to the client; receiving user input information returned by the client; the user input information includes selection information for indicating that the target watermark is selected, or editing information for instructing to edit the target watermark; In the case where it is determined that the user input information includes the editing information, the target watermark is edited according to the watermark editing parameters in the editing information to obtain the watermark to be added.

[0008] According to a watermark generation method provided by the present invention, obtaining a target watermark template from a watermark template library according to the generation time of the to-be-processed file and the category information of the to-be-processed image includes: Determining at least one candidate watermark template in the watermark template library according to the generation time of the file to be processed; The target watermark template is determined from the at least one candidate watermark template according to the category information of the image to be processed.

[0009] According to a watermark generation method provided by the present invention, the target watermark template is updated according to the distribution density and location information of the sensitive information in the image to be processed to obtain the target watermark, including: adjusting a display intensity parameter of the target watermark template according to the distribution density to obtain a first watermark; According to the position information, the size parameters of the first watermark are adjusted to obtain the target watermark.

[0010] According to a watermark generation method provided by the present invention, obtaining the target file according to the updated file to be processed includes: Based on a preset format, converting the updated file to be processed to obtain a candidate file; According to the file format of the to-be-processed file, the candidate file is converted into a format to obtain the target file.

[0011] According to a watermark generation method provided by the present invention, performing multimodal analysis based on category information of the image to be processed, as well as image information and text information of the image to be processed to obtain location information of sensitive information in the image to be processed includes: Generate sensitive information prompt words according to the category information of the image to be processed; According to the sensitive information prompt words, the multimodal large model is guided to perform feature extraction on the image information and text information of the image to be processed respectively, to obtain the image features corresponding to the image information and the semantic features corresponding to the text information, and multimodal analysis is performed based on the image features and the semantic features to obtain the location information.

[0012] According to a watermark generation method provided by the present invention, the preset sensitive category information includes at least one of an identity certification category, a professional title certificate category, and a business license category.

[0013] The present invention also provides a watermark generation device, comprising: a matching unit, configured to match the category information of each image in the to-be-processed file with preset sensitive category information, and determine the to-be-processed image in the to-be-processed file based on the matching result; an identification unit, configured to perform multimodal analysis based on category information of the image to be processed, and image information and text information of the image to be processed, to obtain location information of sensitive information in the image to be processed; The generating unit is used to generate a watermark for the file to be processed according to the position information to obtain a target file.

[0014] The present invention also provides an electronic device, 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, any of the above-mentioned watermark generation methods is implemented.

[0015] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which implements any of the above-mentioned watermark generation methods when executed by a processor.

[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned watermark generation methods.

[0017] The watermark generation method, device and equipment provided by the present invention classify each image in the to-be-processed file and perform multimodal sensitive information analysis to quickly and accurately locate the position information of the sensitive information that needs to be protected in the to-be-processed file, so as to accurately add the watermark to the sensitive information that needs to be protected in the to-be-processed file. This ensures that the watermark can cover the sensitive information that needs to be protected in the file while avoiding blocking important information, thereby improving the accuracy of the file when adding the watermark, and thus better ensuring the security of the file. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 This is one of the flow charts of the watermark generation method provided by the present invention.

[0020] Figure 2 It is a structural diagram of the watermark generation system provided by the present invention.

[0021] Figure 3 This is the second flow chart of the watermark generation method provided by the present invention.

[0022] Figure 4 This is the third flow chart of the watermark generation method provided by the present invention.

[0023] Figure 5 It is a structural diagram of the watermark generation device provided by the present invention.

[0024] Figure 6 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0025] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0026] Some documents often contain sensitive information, such as bid documents submitted by suppliers. However, this information can easily be leaked due to negligence on the part of the purchaser. For example, security vulnerabilities in corporate intranets can make them vulnerable to hackers who steal sensitive information such as documents. Alternatively, employees might mistakenly send files to the wrong recipients while processing them. Furthermore, file leaks can occur in public places like print shops. To address this, watermarking is being used to protect the security of documents.

[0027] Currently, batch watermarking is commonly used in document watermarking. However, this method can leave some key documents missing or obscuring key content, resulting in poor watermark accuracy and difficulty effectively ensuring document security. Therefore, how to quickly and accurately add watermarks to the content that needs to be protected is an urgent problem that needs to be solved.

[0028] In this regard, the present application provides a watermark generation method, which can accurately add the watermark to the sensitive information that needs to be protected in the file, thereby ensuring that the watermark can cover the sensitive information that needs to be protected in the file while avoiding blocking important information, thereby improving the accuracy of the file when adding the watermark, effectively avoiding the problem of traditional watermark adding methods covering a large amount of key information in the document, and thus better ensuring the security of the file.

[0029] Figure 1 This is a flow chart of the watermark generation method provided by the present invention. The method can be performed by a watermark generation system; this system can be an electronic device, a component within an electronic device, an integrated circuit, or a chip; and the electronic device can be either a mobile electronic device or a non-mobile electronic device. For example, a mobile electronic device can be a mobile phone, tablet computer, laptop computer, PDA, or personal digital assistant, while a non-mobile electronic device can be a server, network attached storage, or personal computer, etc., although this invention does not specifically limit this.

[0030] Figure 2 This is a schematic diagram of the structure of the watermark generation system provided by the present invention. Figure 2 As shown, the watermark generation system includes an application layer, a service layer, and a model layer, so that the watermark generation of the file is realized through the collaboration of the application layer, the service layer, and the model layer. Among them, the model layer is used to store the various artificial intelligence algorithm models required to be called in the watermark generation process, including but not limited to multimodal large models, image classification models, and optical character recognition models. This embodiment does not specifically limit this. The service layer is used to store various functional modules required to be called in the watermark generation process, including but not limited to a document parsing module for document parsing, a watermark generation module for watermark generation, and a document synthesis module for document synthesis. This embodiment does not specifically limit this. The application layer is mainly used to provide users with front-end operation ports, such as providing users with a document upload port for document uploading, a watermark editing port for watermark editing, and a document download port for document downloading, etc. This embodiment does not specifically limit this.

[0031] In addition, the method provided in this embodiment can be applied to watermark generation scenarios of various documents, such as bidding documents and contract documents. To simplify the description, the following description will be specifically expanded using bidding documents as an example.

[0032] like Figure 1 As shown, the method includes step 110 , step 120 and step 130 .

[0033] Step 110 , matching the category information of each image in the to-be-processed file with the preset sensitive category information, and determining the to-be-processed image in the to-be-processed file based on the matching result.

[0034] The "file to be processed" herein is a file for which a watermark is to be generated. The file may be input by a user through a document upload port. The user input may be input through a command line interface, a graphical interface, touch input, a drop-down selection input, etc., and this embodiment does not specifically limit this.

[0035] Optionally, when a watermark needs to be generated for a file to be processed, the file to be processed may be parsed according to the original format of the file to be processed, so as to parse and obtain all images from the file to be processed.

[0036] Figure 3 This is the second flow chart of the watermark generation method provided by the present invention; Figure 3 As shown, when the original format of the file to be processed is the ".docx" format, the file to be processed can be first converted from the ".docx" format to the ".rar" format to obtain a compressed file, and then decompressed from the compressed file to obtain a document content folder (that is, a folder for storing the main content of the file to be processed, also called a "word" folder) and a media folder (that is, a folder for storing pictures, audio and video embedded in the file to be processed, also called a "media" folder); then, all pictures in the file to be processed are filtered from the media folder.

[0037] Subsequently, the image classification model (such as residual network, convolutional network, etc.) in the model layer is called to classify each picture in the to-be-processed file to extract the category information of each picture, and the category information of each picture is matched one by one with each preset sensitive category information to determine whether there is a picture in the to-be-processed file whose category information matches any preset sensitive category information. If so, it indicates that the matched picture is an image containing sensitive information, that is, the image that needs to be watermarked. At this time, the matched picture can be used as the to-be-processed picture in the to-be-processed file, so that the watermark can be added to the to-be-processed picture in a targeted manner later, thereby ensuring that the watermark can cover all sensitive information that needs to be protected in the file when it is generated, while avoiding blocking important information, thereby improving the accuracy of watermark generation.

[0038] The preset sensitive category information here is the category information of the predetermined image containing sensitive information. In one possible implementation, the preset sensitive category information includes at least one of the identity proof category, professional title certificate category, and business license category. This embodiment does not specifically limit this; accordingly, the preset sensitive pictures include at least one of the identity proof category pictures (such as ID card pictures, work permit pictures, etc.), professional title certificate category pictures (such as professional title qualification certificate pictures, industry certification certificate pictures, etc.) and business license category pictures (such as business license pictures).

[0039] Step 120 : Perform multimodal analysis based on the category information of the image to be processed, as well as the image information and text information of the image to be processed, to obtain location information of sensitive information in the image to be processed.

[0040] Optionally, after obtaining the image to be processed, a multimodal sensitive information analysis can be performed in combination with the category information of the image to be processed, as well as the image information and text information of the image to be processed to obtain the location information of the sensitive information in the image to be processed.

[0041] The sensitive information analysis here can be to load and obtain the corresponding sensitive information set based on the category information of the image to be processed, and then generate sensitive information prompt words based on the sensitive information set, so as to guide the multimodal large model in the model layer through the sensitive information prompt words, and perform multimodal sensitive information analysis on the image information and text information of the image to be processed, thereby obtaining the location information of the sensitive information in the image to be processed; or, based on the category information of the image to be processed, select a specific analysis model that can perform sensitive information analysis on such images, and based on the selected specific analysis model, perform multimodal sensitive information analysis on the image information and text information of the image to be processed, so as to obtain the location information of the sensitive information in the image to be processed, etc. The specific selection can be adaptively made according to the application scenario of the file to be processed to improve the adaptability of the sensitive information analysis.

[0042] The multimodal large model is a deep learning model that can simultaneously process and learn multiple modal information (such as image information and text information). By integrating data features of different modalities, it can achieve comprehensive perception and analysis of complex scenes.

[0043] Step 130: Generate a watermark for the file to be processed according to the location information to obtain a target file.

[0044] Optionally, after obtaining the location information of sensitive information in the image to be processed, the watermark adding position of the image to be processed can be determined based on the location information, and the watermark to be added can be embedded and updated to the watermark adding position of the image to be processed to obtain the target image containing the watermark mark to be added, and the file to be processed can be updated based on this target image to generate a target file with a watermark mark.

[0045] The watermark to be added here is the watermark that needs to be added to the image to be processed. It can be input by the user through the watermark editing port according to actual needs, or it can be adaptively generated by the system based on multiple parameters such as the generation time of the file to be processed, the category information of the image to be processed, and the distribution density and location information of sensitive information in the image to be processed. This embodiment does not make specific limitations on this.

[0046] The method provided in this embodiment classifies each image in the file to be processed and performs multimodal sensitive information analysis to quickly and accurately locate the position information of the sensitive information that needs to be protected in the file to be processed, so as to accurately add the watermark to the sensitive information that needs to be protected in the file to be processed. This ensures that when the watermark is generated, it can cover the sensitive information of the file that needs to be protected while avoiding blocking important information, thereby improving the accuracy of the file when adding the watermark, and thus better ensuring the security of the file.

[0047] In some embodiments, step 130 specifically includes: Step 131, obtaining the watermark to be added corresponding to the image to be processed; Step 132: superimposing the watermark to be added onto the image to be processed according to the position information to obtain a target image; Step 133: Replace the image to be processed in the file to be processed with the target image to obtain an updated file to be processed; Step 134: Obtain the target file according to the updated file to be processed.

[0048] like Figure 3 As shown, in the process of generating the target file, specifically, the watermark to be added corresponding to the image to be processed can be obtained first; the watermark to be added is the watermark required to be added to the image to be processed, which can be input by the user through the watermark editing port according to actual needs, or can be adaptively generated by the system according to multiple parameters such as the generation time of the file to be processed, the category information of the image to be processed, and the distribution density and location information of sensitive information in the image to be processed. This embodiment does not make specific limitations on this.

[0049] Next, the watermark adding position of the image to be processed is determined based on the position information obtained by analyzing the sensitive information of the image to be processed, so as to accurately superimpose the watermark to be added to the watermark adding position of the image to be processed to obtain the target image containing the watermark mark to be added.

[0050] Then, the image to be processed in the file to be processed is replaced with the target image containing the watermark to be added, and the updated file to be processed is re-integrated according to the integration method corresponding to the parsing method of the file to be processed to obtain the target file with the watermark.

[0051] The method provided in this embodiment obtains the watermark to be added corresponding to the image to be processed, accurately superimposes the watermark according to the location information of the sensitive information, then updates the image and integrates the file, and finally generates a target file containing the watermark mark, thereby achieving effective identification and protection of sensitive information while ensuring the integrity and availability of file integration.

[0052] In some embodiments, step 131 specifically includes: Obtaining a target watermark template from a watermark template library according to the generation time of the file to be processed and the category information of the image to be processed; According to the distribution density and location information of the sensitive information in the image to be processed, the target watermark template is updated to obtain a target watermark; Sending the target watermark to the client; receiving user input information returned by the client; the user input information includes selection information for indicating that the target watermark is selected, or editing information for instructing to edit the target watermark; In the case where it is determined that the user input information includes the editing information, the target watermark is edited according to the watermark editing parameters in the editing information to obtain the watermark to be added.

[0053] Optionally, in the process of determining the watermark to be added, the generation time of the file to be processed and the category information of the image to be processed may be combined to perform watermark template matching in the watermark template library to obtain a watermark template that matches both the generation time of the file to be processed and the category information of the image to be processed as the target watermark template. The specific matching implementation method includes combining and encoding the generation time of the file to be processed and the category information of the image to be processed to obtain a corresponding coding identifier, and matching the coding identifier with the coding identifier corresponding to each watermark template in the watermark template library to obtain the target watermark template; or first matching the watermark template based on a parameter in the generation time of the file to be processed and the category information of the image to be processed to obtain a corresponding watermark template set, and then, based on the watermark template set, matching the watermark template again based on another parameter in the generation time of the file to be processed and the category information of the image to be processed to obtain the target watermark template, etc. This embodiment does not specifically limit this.

[0054] After obtaining the target watermark template, the target watermark template can be further adjusted and optimized according to the distribution density and location information of the sensitive information in the image to be processed to generate a target watermark suitable for the image to be processed.

[0055] After obtaining the target watermark, the target watermark can be sent to the client so that the user can view and determine whether the target watermark meets their needs, thereby increasing the user's control over the watermark adding process and ensuring that the watermark added to the processed file meets the user's needs. If the target watermark is determined to meet their needs, the user can return user input information including selection information indicating that the target watermark is selected through the client. If the target watermark is determined not to meet their needs, the user can return user input information including editing information indicating that the target watermark is edited through the client.

[0056] When it is determined that the user input information returned by the client includes selected information, the target watermark can be directly determined as the watermark to be added; when it is determined that the user input information includes editing information, the target watermark is edited according to the watermark editing parameters in the editing information to obtain the watermark to be added, so that the watermark to be added meets the user's specific needs, thereby improving the applicability and user satisfaction of the watermark.

[0057] The method provided in this embodiment selects a watermark template by combining generation time and image category information, and dynamically updates the watermark according to the distribution characteristics of sensitive information, while allowing users to interactively edit it. This achieves high flexibility and intelligence in watermark addition, ensures accurate identification and protection of sensitive information, and improves user experience.

[0058] In some embodiments, obtaining a target watermark template from a watermark template library according to the generation time of the to-be-processed file and the category information of the to-be-processed image includes: Determining at least one candidate watermark template in the watermark template library according to the generation time of the file to be processed; The target watermark template is determined from the at least one candidate watermark template according to the category information of the image to be processed.

[0059] Optionally, when determining the target watermark template, it can be specifically firstly based on the correlation between the generation time of the file to be processed and the watermark template, at least one candidate watermark template is obtained by association in the watermark template library; then, based on the correlation between the category information of the image to be processed and the watermark template, the target watermark template is obtained by association from at least one candidate watermark template, thereby selecting the watermark template through a hierarchical search method, which not only improves the efficiency and accuracy of watermark template selection, but also improves the user experience and the adaptability of template matching.

[0060] In some embodiments, updating the target watermark template according to the distribution density and location information of the sensitive information in the image to be processed to obtain the target watermark includes: adjusting a display intensity parameter of the target watermark template according to the distribution density to obtain a first watermark; According to the position information, the size parameters of the first watermark are adjusted to obtain the target watermark.

[0061] Optionally, in the process of determining the target watermark, the display intensity parameters of the target watermark template can be adjusted according to the distribution density of the sensitive information to obtain the first watermark, so as to ensure the visibility and adaptability of the watermark in different density areas; for example, if the distribution density of the sensitive information is high, the display intensity of the target watermark template can be enhanced to better block the sensitive information through a stronger watermark display intensity; and if the distribution density of the sensitive information is low, the display intensity of the target watermark template can be appropriately reduced.

[0062] Then, based on the location of the sensitive information, the size parameters of the first watermark are adjusted to obtain the target watermark, further ensuring that the watermark accurately covers the location of the sensitive information while maintaining the overall aesthetics and information integrity of the image. For example, if the sensitive information is located in the center of the image and the area is large, the size of the first watermark can be appropriately enlarged to ensure that it can fully cover the sensitive information. If the sensitive information is located in the edge of the image and the area is small, the size of the first watermark can be appropriately reduced to prevent the watermark from exceeding the image boundary or affecting other important content of the image.

[0063] The method provided in this embodiment dynamically adjusts the display intensity and size of the watermark by combining the distribution density and location information of sensitive information, thereby achieving accuracy and adaptability in watermark addition, effectively protecting sensitive information, and improving user experience and the visual effect of the file.

[0064] In some embodiments, step 134 specifically includes: Based on a preset format, converting the updated file to be processed to obtain a candidate file; According to the file format of the to-be-processed file, the candidate file is converted into a format to obtain the target file.

[0065] The preset format here is the format converted during the parsing process of the file to be processed. For example, Figure 3 As shown, if the ".docx" format is converted to the ".rar" format during the parsing process of the to-be-processed file, the corresponding preset format is the ".rar" format. Accordingly, after the to-be-processed image in the to-be-processed file is modified to include the target image to be watermarked, the updated "media" folder and "word" folder can be recompressed into the ".rar" format to obtain a candidate file. After the file format of the candidate file is modified to the ".docx" format, the document synthesis can be completed, thereby obtaining a target file with the same format as the to-be-processed file, complete content, and a valid watermark.

[0066] In some embodiments, step 120 specifically includes: Generate sensitive information prompt words according to the category information of the image to be processed; According to the sensitive information prompt words, the multimodal large model is guided to perform feature extraction on the image information and text information of the image to be processed respectively, to obtain the image features corresponding to the image information and the semantic features corresponding to the text information, and multimodal analysis is performed based on the image features and the semantic features to obtain the location information.

[0067] Optionally, during the sensitive information analysis process, the corresponding sensitive information set can be loaded from the sensitive information library based on the category information of the image to be processed, and then sensitive information prompt words can be generated based on the sensitive information set to guide the multimodal large model to perform feature extraction on the image information and text information of the image to be processed according to the sensitive information prompt words, so as to extract image features and semantic features associated with the sensitive information in the sensitive information set, and fuse the extracted image features and semantic features through multimodal feature alignment and interaction mechanism to obtain fused features, and perform sensitive information analysis based on the fused features to obtain the location information of the sensitive information in the image to be processed.

[0068] The text information can be recognized by calling the optical character recognition algorithm in the model layer.

[0069] The method provided in this embodiment generates sensitive information prompt words by combining image category information and uses a multimodal large model for feature extraction and fusion analysis. It can more accurately identify and locate sensitive information in images, effectively improving the accuracy and efficiency of sensitive information detection.

[0070] Figure 4 This is the third flow chart of the watermark generation method provided by the present invention, such as Figure 4 As shown, the complete process of the watermark generation method provided by the present invention includes: First, obtain the file to be processed that needs to be watermarked and uploaded by the user; Next, set the category information of the image to be watermarked (that is, the preset sensitive image); Next, the file to be processed is parsed to obtain all images in the file to be processed, and each image is classified and matched with the category information of the preset sensitive images to obtain the image to be processed in the file to be processed; Next, a multimodal sensitive information analysis is performed on the image to be processed to obtain the location information of the sensitive information in the image to be processed; Then, according to the position information, a watermark is added to the image to be processed, and the image to be processed is replaced with the target image with the watermark added, so as to generate a target file with the watermark added according to the update result; Finally, the target file with the watermark added is output and the watermark adding position information is fed back.

[0071] The watermark generation device provided by the present invention is described below. The watermark generation device described below and the watermark generation method described above can be referenced to each other.

[0072] Figure 5 Schematic diagram of the structure of the watermark generation device provided by the present invention; Figure 5 As shown, the device includes: The matching unit 510 is used to match the category information of each image in the file to be processed with the preset sensitive category information, and determine the image to be processed in the file to be processed based on the matching result; The identification unit 520 is configured to perform multimodal analysis based on the category information of the image to be processed, as well as the image information and text information of the image to be processed, to obtain location information of sensitive information in the image to be processed; The generating unit 530 is configured to generate a watermark for the file to be processed according to the location information to obtain a target file.

[0073] The device provided in this embodiment classifies each image in the file to be processed and performs multimodal sensitive information analysis to quickly and accurately locate the position information of the sensitive information that needs to be protected in the file to be processed, so as to accurately add the watermark to the sensitive information that needs to be protected in the file to be processed. This ensures that when the watermark is generated, it can cover the sensitive information that needs to be protected in the file while avoiding blocking important information, thereby improving the accuracy of the file when adding the watermark, and thus better ensuring the security of the file.

[0074] The device provided by the present invention is used to execute the above-mentioned method embodiments. Please refer to the above-mentioned embodiments for the specific processes and detailed contents, which will not be repeated here.

[0075] Figure 6 An example of a physical structure diagram of an electronic device is shown below. Figure 6 As shown, the electronic device may include: a processor 610, a communications interface 620, a memory 630, and a communications bus 640, wherein the processor 610, the communications interface 620, and the memory 630 communicate with each other via the communications bus 640. The processor 610 may invoke logic instructions in the memory 630 to execute a watermark generation method, which includes: matching the category information of each image in a to-be-processed file with preset sensitive category information, and determining the to-be-processed image in the to-be-processed file based on the matching result; performing multimodal analysis based on the category information of the to-be-processed image, as well as the image information and text information of the to-be-processed image, to obtain location information of sensitive information in the to-be-processed image; and generating a watermark for the to-be-processed file based on the location information to obtain a target file.

[0076] Furthermore, the logic instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion 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 for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0077] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the watermark generation method provided by the above methods, which includes: matching the category information of each picture in the file to be processed with preset sensitive category information, and determining the picture to be processed in the file to be processed based on the matching result; performing multimodal analysis based on the category information of the picture to be processed, as well as the image information and text information of the picture to be processed to obtain the location information of the sensitive information in the picture to be processed; and generating a watermark for the file to be processed based on the location information to obtain the target file.

[0078] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the watermark generation method provided by the above-mentioned methods, the method comprising: matching the category information of each picture in the file to be processed with preset sensitive category information, and determining the picture to be processed in the file to be processed based on the matching result; performing multimodal analysis based on the category information of the picture to be processed, as well as the image information and text information of the picture to be processed, to obtain the location information of the sensitive information in the picture to be processed; and generating a watermark for the file to be processed based on the location information to obtain the target file.

[0079] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0080] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A watermark generation method, characterized in that: include: Matching the category information of each image in the to-be-processed file with the preset sensitive category information, and determining the to-be-processed image in the to-be-processed file based on the matching result; Performing multimodal analysis based on the category information of the image to be processed, as well as the image information and text information of the image to be processed, to obtain location information of sensitive information in the image to be processed; According to the location information, a watermark is generated for the file to be processed to obtain a target file.

2. The watermark generation method according to claim 1, characterized in that: Generating a watermark for the file to be processed according to the location information to obtain a target file includes: Obtain the watermark to be added corresponding to the image to be processed; According to the position information, the watermark to be added is superimposed on the image to be processed to obtain a target image; Replacing the image to be processed in the file to be processed with the target image to obtain an updated file to be processed; The target file is obtained according to the updated file to be processed.

3. The watermark generation method according to claim 2, characterized in that: The step of obtaining the watermark to be added corresponding to the image to be processed includes: Obtaining a target watermark template from a watermark template library according to the generation time of the file to be processed and the category information of the image to be processed; According to the distribution density and location information of the sensitive information in the image to be processed, the target watermark template is updated to obtain a target watermark; Sending the target watermark to the client; receiving user input information returned by the client; the user input information includes selection information for indicating that the target watermark is selected, or editing information for instructing to edit the target watermark; In the case where it is determined that the user input information includes the editing information, the target watermark is edited according to the watermark editing parameters in the editing information to obtain the watermark to be added.

4. The watermark generation method according to claim 3, characterized in that: The step of obtaining a target watermark template from a watermark template library according to the generation time of the file to be processed and the category information of the image to be processed includes: Determining at least one candidate watermark template in the watermark template library according to the generation time of the file to be processed; The target watermark template is determined from the at least one candidate watermark template according to the category information of the image to be processed.

5. The watermark generation method according to claim 3, characterized in that: The updating of the target watermark template according to the distribution density and location information of the sensitive information in the image to be processed to obtain the target watermark includes: adjusting a display intensity parameter of the target watermark template according to the distribution density to obtain a first watermark; According to the position information, the size parameters of the first watermark are adjusted to obtain the target watermark.

6. The watermark generation method according to claim 2, characterized in that: The step of obtaining the target file according to the updated file to be processed includes: Based on a preset format, converting the updated file to be processed to obtain a candidate file; According to the file format of the to-be-processed file, the candidate file is converted into a format to obtain the target file.

7. The watermark generation method according to any one of claims 1 to 6, characterized in that: The performing of multimodal analysis based on the category information of the image to be processed, and the image information and text information of the image to be processed to obtain the location information of the sensitive information in the image to be processed includes: Generate sensitive information prompt words according to the category information of the image to be processed; According to the sensitive information prompt words, the multimodal large model is guided to perform feature extraction on the image information and text information of the image to be processed respectively, to obtain the image features corresponding to the image information and the semantic features corresponding to the text information, and multimodal analysis is performed based on the image features and the semantic features to obtain the location information.

8. The watermark generation method according to any one of claims 1 to 6, characterized in that: The preset sensitive category information includes at least one of the identity certification category, professional title certificate category, and business license category.

9. A watermark generating device, characterized in that: include: A matching unit, configured to match the category information of each image in the to-be-processed file with preset sensitive category information, and determine the to-be-processed image in the to-be-processed file based on the matching result; an identification unit, configured to perform multimodal analysis based on category information of the image to be processed, and image information and text information of the image to be processed, to obtain location information of sensitive information in the image to be processed; The generating unit is used to generate a watermark for the file to be processed according to the position information to obtain a target file.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the watermark generation method according to any one of claims 1 to 8 is implemented.