Page watermark generation method, device, electronic device, storage medium and program product
By detecting the operation number in the session manager in the post-processor, generating page pictures and adding watermarks, the problem of inflexible watermark generation method in the prior art is solved, and effective security protection of page data is achieved.
Patent Information
- Application Number
- CN202510406028.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-04-02
AI Technical Summary
In the prior art, the page watermark generation method is relatively fixed and cannot effectively protect information security.
By detecting that the current page picture is generated in the post-processor when the current operation number has been deleted in the session manager and no other operation number exists, and adding a watermark after the content area is recognized, ensuring that the watermark covers the entire content area.
Improve the security of page data, ensuring that key information and sensitive information are effectively protected by watermarks when browsing and printing, enhancing the security of information.
Smart Images

Figure CN119919271B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer security technology, and in particular, to a method, device, electronic device, storage medium, and program product for generating page watermarks. Background Art
[0002] In daily software devices, in order to ensure information security, watermarks are implanted into browser page data and browser print data to prevent information leakage. However, the existing watermark generation methods are relatively fixed. Usually, watermarks are dispersed and displayed on the page at a certain density, resulting in the watermarks not playing the role of protecting information security. Summary of the Invention
[0003] The present invention provides a method, device, electronic device, storage medium, and program product for generating page watermarks, which improves the security of page data.
[0004] According to one aspect of the present invention, there is provided a method for generating a page watermark, which is applied to a post-processor. The method includes:
[0005] When it is detected that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, the current event source is called to obtain the current root element corresponding to the current event source, and the front-end page is rendered to obtain the current display page;
[0006] Generate a current page picture according to the current resolution and the current root element of the current display page;
[0007] Perform region recognition on the current page picture according to the current content interval of the current page picture to determine the current content area of the current page picture;
[0008] Perform key information recognition on the current content area to obtain current key information, and add a current page watermark at the current key information;
[0009] Detect the watermark-uncovered area of the current content area, uniformly add the current page watermark in the watermark-uncovered area, and feedback the current page picture to the front-end page so that the front-end page displays the current page picture after adding the current page watermark.
[0010] According to another aspect of the present invention, there is provided a device for generating a page watermark, which is applied to a post-processor. The device includes:
[0011] A current display page generation module, configured to, when detecting that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, call the current event source, obtain the current root element corresponding to the current event source, and render the front-end page to obtain the current display page;
[0012] A current page image generation module, configured to generate a current page image according to the current resolution and the current root element of the current display page;
[0013] A current content area recognition module, configured to perform area recognition on the current page image according to the current content interval of the current page image, and determine the current content area of the current page image;
[0014] A first current watermark addition module, configured to identify key information for the current content area to obtain current key information, and add a current page watermark at the current key information;
[0015] A second current watermark addition module, configured to detect the watermark-uncovered area of the current content area, uniformly add the current page watermark in the watermark-uncovered area, and feedback the current page image to the front-end page, so that the front-end page displays the current page image after adding the current page watermark.
[0016] According to another aspect of the present invention, there is provided an electronic device, where the electronic device includes:
[0017] At least one processor; and
[0018] A memory communicatively connected to the at least one processor; wherein,
[0019] The memory stores a computer program executable by the at least one processor, and when the computer program is executed by the at least one processor, the at least one processor is enabled to execute the page watermark generation method according to any embodiment of the present invention.
[0020] According to another aspect of the present invention, there is provided a computer-readable storage medium, where the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the page watermark generation method according to any embodiment of the present invention is implemented.
[0021] According to another aspect of the present invention, there is provided a computer program product, where the computer program product includes a computer program, and when the computer program is executed by a processor, the page watermark generation method according to any embodiment of the present invention is implemented.
[0022] In the technical solution of the embodiment of the present invention, when it is detected that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, the current event source is called to obtain the current root element corresponding to the current event source, and the front-end page is rendered to obtain the current display page. According to the current resolution of the current display page and the current root element, the current page image is generated. Through the operation number in the session manager, the monitoring of the data interaction between the front-end page and the back-end server is realized. When the data loading of a single session of the front-end page is completed, the generation of the previous display page and the current page image corresponding to the current display page is realized; by performing region recognition on the current page image, the current content area of the current page image is determined, key information recognition is performed on the current content area to obtain the current key information, and the current page watermark is added at the current key information, so that when the page operator browses and prints the browser page data, the watermark addition to the key information in the current content area is realized, and the security of the key information in the current page image is improved; by detecting the watermark-uncovered area of the current content area and evenly adding the current page watermark in the watermark-uncovered area, the current page image is fed back to the front-end page so that the front-end page displays the current page image after adding the current page watermark, realizing the watermark addition to the content of the watermark-uncovered area of the current content area, improving the security of the page data in the watermark-uncovered area of the current content area, and thus improving the security of the front-end page data when the page operator browses and prints the browser page data.
[0023] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0025] Figure 1 is a flowchart of a method for generating a page watermark according to Embodiment 1 of the present invention;
[0026] Figure 2 is a flowchart of a method for generating a page watermark according to Embodiment 2 of the present invention;
[0027] Figure 3It is a schematic structural diagram of a page watermark generation device provided in Embodiment 3 of the present invention;
[0028] Figure 4 It is a schematic structural diagram of an electronic device for implementing the page watermark generation method of the embodiments of the present invention. Detailed implementation manners
[0029] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0030] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product or equipment comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or equipment.
[0031] Embodiment 1
[0032] Figure 1 It is a flowchart of a page watermark generation method provided in Embodiment 1 of the present invention. The embodiments of the present invention are applicable to the situation of implanting watermarks in browser page data or browser print data. This method can be executed by a page watermark generation device, which can be implemented in the form of hardware and / or software, and the page watermark generation device can be configured in an electronic device carrying the page watermark generation function.
[0033] See Figure 1 The page watermark generation method shown is applied to a post-processor and includes:
[0034] S110. When it is detected that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, call the current event source, obtain the current root element corresponding to the current event source, and render the front-end page to obtain the current display page.
[0035] The session manager can be used to store the operation numbers corresponding to the page data loading operations during a single session. One session manager corresponds to one session. Each time a page is opened, it corresponds to a session, and correspondingly, a session manager is created. The same session can include multiple page data loading operations. Each page data loading operation corresponds to an operation number respectively. A single operation number is used to identify a single page data loading operation. Among them, the current operation number can be used to identify the current page data loading operation; other operation numbers can be used to identify other page data loading operations that belong to the same session as the current page data loading operation. The page data loading operation can be triggered by an operation on a certain page element of the front-end page. The same page data loading operation corresponds to the same page element of the front-end page and the same access address of the back-end server. The operation number can be used to distinguish the operation process on different page elements of the front-end page and / or the access process to different access addresses of the back-end server. The operation number can also be used to distinguish repeated page data loading operations. It can be understood that if the page operator operates on the same page element in the front-end page and accesses the same access address in the back-end server, at this time, the generated operation numbers are the same. Thus, based on the operation number, the repeated operations of the page operator can be distinguished. Optionally, the same page can have multiple data request interfaces for receiving multiple page data loading operations during the same session. The current page data loading operation can be the data loading operation triggered by an operation on a certain page element in the front-end page at the current moment. The current page data loading operation will trigger data interaction between the front-end page and the back-end server. Among them, the front-end page can be used to display the current page picture. The back-end server can be used to manage page data.
[0036] The current operation number has been deleted in the session manager, which can be understood as that the data loading process corresponding to the current page data loading operation has been completed; correspondingly, if the current operation number exists in the session manager, it can be understood as that the data loading process corresponding to the current page data loading operation has not been completed. If there are other operation numbers in the session manager where the current operation number is located, it can be understood as that the session to which the current page data loading operation belongs has not ended, that is, there is still a data loading process for other page data loading operations after the current page data loading operation, and the page data to be loaded in this session has not been loaded completely; if there are no other operation numbers in the session manager where the current operation number is located, it can be understood as that the session to which the current page data loading operation belongs has ended, that is, there is no data loading process for other page data loading operations after the current page data loading operation, and the page data to be loaded in this session has been loaded completely.
[0037] The post-processor can be used to detect whether there is an operation number in the session manager, render the front-end page, and generate the watermark of the current page. The current event source can be a DOM (Document Object Model) element that triggers the event corresponding to the current page data loading operation. The current event source can be the object directly acted on by the current page data loading operation, that is, the page element directly acted on by the current page data loading operation. Exemplarily, the page element can include a button or an input box, etc. The current event source can implement the page interaction logic by binding an event handling function. The current root element can be the starting point or the ending point of the event propagation corresponding to the current page data loading operation. It can be understood that the current root element can be the only entry of the DOM (Document Object Model) tree. Exemplarily, the current root element can be an HTML (Hyper Text Markup Language) tag of the front-end page. The current display page can be a display page rendered based on the current root element corresponding to the current event source.
[0038] Specifically, through the post-processor, when it is detected that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, the current event source that triggers the current page data loading operation can be called to obtain the current root element corresponding to the current event source. By listening to the current root element, the timing of the completion of the registered rendering can be determined, and when the timing of the completion of the registered rendering is reached, the front-end page can be rendered to obtain the current display page.
[0039] In an optional embodiment of the present invention, before detecting that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, calling the current event source, obtaining the current root element corresponding to the current event source, and rendering the front-end page to obtain the current display page, it further includes: intercepting the current page data loading operation of the front-end page through a pre-interceptor, generating the current operation number corresponding to the current page data loading operation, and storing the current operation number in the session manager; through the pre-interceptor, when it is detected that the data loading process corresponding to the current page data loading operation has been completed, deleting the current operation number corresponding to the current page data loading operation in the session manager.
[0040] The pre - interceptor can be used to intercept the page data loading operation in the interaction between the front - end page and the back - end server and process the operation number corresponding to the page data loading operation. Compared with other operations on page data, such as page data addition operation, page data deletion operation, and page data modification operation, the page data loading operation is the key operation causing data leakage in the back - end server. Therefore, using a pre - interceptor to intercept the page data loading operation and using a session manager to manage the operation number corresponding to the page data loading operation can ensure the security of the page data on the front - end page corresponding to the back - end server.
[0041] The data loading process corresponding to the current page data loading operation has been completed. It can be understood that the current page data corresponding to the current page data loading operation fed back by the back - end server to the front - end page has been detected. The current operation number in the session manager can be used to represent whether the data loading process corresponding to the current page data loading operation is completed. It can be understood that if the current operation number exists in the session manager, it indicates that the data loading process corresponding to the current page data loading operation is in progress, that is, not completed; if the current operation number does not exist in the session manager, it indicates that the current page data loading operation has not been triggered or the data loading process corresponding to the current page data loading operation has been completed.
[0042] Specifically, when, through the post - processor, it is detected that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, the current event source is called to obtain the current root element corresponding to the current event source, and before rendering the front - end page to obtain the current display page, through the pre - interceptor, the current page data loading operation of the front - end page is detected. When the current page data loading operation is detected, the current page data loading operation is intercepted, and at the same time, the current operation number corresponding to the current page data loading operation is generated and stored in the session manager. Through the pre - interceptor, when it is detected that the data loading process corresponding to the current page data loading operation has been completed, the current operation number corresponding to the current page data loading operation in the session manager can be deleted.
[0043] This solution introduces a pre - interceptor to intercept the page data loading operation in the interaction between the front - end page and the back - end server and process the operation number corresponding to the page data loading operation in the session manager. Combining the session manager to manage the operation number ensures the security of data interaction between the front - end page and the back - end server during the page watermark generation process.
[0044] S120. Generate the current page image according to the current resolution and the current root element of the current display page.
[0045] The current resolution can be used to characterize the actual number of pixels of the current display page. In fact, the current resolution is a key parameter affecting the image size of the picture on the current page. The current root element is a key parameter for determining the picture content of the picture on the current page.
[0046] Specifically, the image size of the current display page can be determined according to the current resolution of the current display page. Starting from the current root element of the current display page, all current sub-element chains corresponding to the current root element can be obtained to determine the picture content of the picture on the current page. The picture of the current page can be generated according to the image size and picture content of the picture on the current page. Among them, the current sub-element chain can refer to the parent-child element relationship chain nested layer by layer starting from the current root element. The current sub-element chain must exist attached to the current root element. The current root element is the starting point of the entire current sub-element chain. All page data loading operations need to traverse downward from the current root element. The current sub-element chain is used to organize content and implement data interaction between the front-end page and the back-end server.
[0047] S130. Perform region recognition on the picture of the current page to determine the current content area of the picture of the current page.
[0048] The current content area can be the area where the content is located in the picture of the current page. Compared with other areas in the picture of the current page, the importance of the content in the current content area is higher than that of the content in other areas.
[0049] Optionally, a preset content density can be obtained, the current content interval of the picture of the current page can be compared with the preset content density, and region recognition can be performed on the picture of the current page. When the current content interval of the picture of the current page is greater than or equal to the preset content density, the current content area of the picture of the current page can be determined. Among them, the current content interval can be used to characterize the density of each part of the content in the picture of the current page.
[0050] Optionally, OCR (Optical Character Recognition) can be used to recognize the page layout of the picture of the current page, such as the up-and-down layout or the up-and-down-and-left-and-right layout. The current content area of the picture of the current page can be determined according to the page layout of the picture of the current page. For example, in the up-and-down layout, the current content area of the picture of the current page can be the lower area of the picture of the current page; in the up-and-down-and-left-and-right layout, the current content area of the picture of the current page can be the central area of the picture of the current page.
[0051] Optionally, based on the background color of the picture of the current page, different areas of the picture of the current page can be distinguished to determine the current content area of the picture of the current page.
[0052] S140. Identify the key information in the current content area to obtain the current key information, and add the current page watermark at the position of the current key information.
[0053] The current key information can be the key information within the current content area. Exemplarily, the current key information can include numbers, reports, presentations, and results, etc. Optionally, the identified current key information can be placed in a content container for management. The current page watermark can be the page watermark added to the current page image. Optionally, the size, tilt angle, and content of the current page watermark can be preset and adjusted by the page administrator.
[0054] Specifically, content recognition can be performed on the current content area to obtain the current page content of the current content area. Optionally, a large language model can be used to extract prompt words based on the key information to semantically understand the current page content and obtain the current key information. Exemplarily, the key information extraction prompt word can be "Please identify the key information contained in this content: the current page content; such as numbers, reports, presentations, and results, etc.". Optionally, preset keywords can be predefined by technicians. Based on the preset keywords, regular recognition can be performed on the current page content to obtain the current key information. The current page watermark can be added at the position of the current key information.
[0055] In an optional embodiment of the present invention, while identifying the key information in the current content area to obtain the current key information and adding the current page watermark at the position of the current key information, it further includes: identifying the sensitive information in the current content area to obtain the current sensitive information, and adding the current page watermark at the position of the current sensitive information.
[0056] The current sensitive information can be the sensitive information within the current content area. Exemplarily, the current sensitive information can include sensitive information stipulated by laws and regulations, etc. Optionally, the identified current sensitive information can be placed in a content container for management.
[0057] Specifically, content recognition can be performed on the current content area to obtain the current page content of the current content area. Optionally, a large language model can be used to extract prompt words based on the sensitive information to semantically understand the current page content and obtain the current sensitive information. Exemplarily, the sensitive information extraction prompt word can be "Please identify the sensitive information contained in this content: the current page content; such as sensitive information stipulated by laws. ". Optionally, preset sensitive words can be predefined by technicians. Based on the preset sensitive words, regular recognition can be performed on the current page content to obtain the current sensitive information. The current page watermark can be added at the position of the current sensitive information.
[0058] This solution introduces the process of identifying sensitive information in the current content area and the process of adding a page watermark to the sensitive information, further improving the security of the page data in the current content area.
[0059] S150. Detect the watermark-uncovered area in the current content area, evenly add the current page watermark to the watermark-uncovered area, and feed the current page image back to the front-end page so that the front-end page displays the current page image after adding the current page watermark.
[0060] The watermark-uncovered area can be the area in the current content area that is not covered by the current page watermark. Correspondingly, the watermark-covered area can be the area in the current content area that is covered by the current page watermark. Comparatively speaking, the importance level of the content in the watermark-covered area of the current content area is higher than that of the content in the watermark-uncovered area of the current content area. However, adding the current page watermark to the content in the watermark-uncovered area of the current content area is also particularly important for the security of the page data.
[0061] Specifically, the watermark-uncovered area in the current content area can be detected. The current page watermark can be evenly added to the watermark-uncovered area, for example, adding the current page watermark in six equal parts. The current page image can be fed back to the front-end page so that the front-end page displays the current page image after adding the current page watermark.
[0062] In the technical solution of the embodiment of the present invention, when it is detected that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, the current event source is called to obtain the current root element corresponding to the current event source, and the front-end page is rendered to obtain the current display page. According to the current resolution of the current display page and the current root element, a current page image is generated. Through the operation number in the session manager, the monitoring of data interaction between the front-end page and the back-end server is realized. When the data loading of a single session of the front-end page is completed, the generation of the previous display page and the current page image corresponding to the current display page is realized; by performing region recognition on the current page image to determine the current content region of the current page image, performing key information recognition on the current content region to obtain the current key information, and adding the current page watermark at the current key information, the addition of the watermark to the key information in the current content region is realized when the page operator browses and prints the browser page data, improving the security of the key information in the current page image; by detecting the watermark-uncovered region of the current content region and uniformly adding the current page watermark in the watermark-uncovered region, and feeding back the current page image to the front-end page so that the front-end page displays the current page image after adding the current page watermark, the addition of the watermark to the content in the watermark-uncovered region of the current content region is realized, improving the security of the page data in the watermark-uncovered region of the current content region, thereby improving the security of the front-end page data when the page operator browses and prints the browser page data.
[0063] In an optional embodiment of the present invention, when performing region recognition on the current page image to determine the current content region of the current page image, it includes: performing region recognition on the current page image according to the current single-line font size and the current single-line font quantity of the current page image to determine the current title region of the current page image; performing region recognition on the current page image according to the current content structure and the current content interval of the current page image to determine the current menu region of the current page image; determining the other regions of the current page image except the current title region and the current menu region as the current content region of the current page image; before performing key information recognition on the current content region to obtain the current key information and adding the current page watermark at the current key information, it further includes: determining the current page watermark position of the current title region according to the current title width of the current title region and the image width of the current page image, and adding the current page watermark at the current page watermark position of the current title region; determining the current page watermark position of the current menu region according to the current menu height of the current menu region and the image height of the current page image, and adding the current page watermark at the current page watermark position of the current menu region.
[0064] The current single-line font size can be used to characterize the size of a single font in the single-line font of the current page image. The current number of single-line fonts can be the number of single-line fonts in the current page image. The current title area can be the area where the title is located in the current page image. The current content structure can be the display structure of the content in the current page image. Exemplarily, the current content structure can include hierarchical display and non-hierarchical display. The current content interval can be the display distance between the contents in the current page image. The current menu area can be the area where the menu is located in the current page image. The current title width can be the overall width of the title content in the current title area. The current menu height can be the overall height of the menu content in the current menu area.
[0065] Specifically, a preset single-line font size and a preset number of single-line fonts can be obtained. The current single-line font size and the preset single-line font size of each line of content in the current page image can be compared, and the current number of single-line fonts and the preset number of single-line fonts can be compared. The area where the single-line content with the current single-line font size greater than or equal to the preset single-line font size and the current number of single-line fonts less than or equal to the preset number of single-line fonts is located can be determined as the current title area of the current page image. Among them, the preset single-line font size can be the lower limit value of the font size of the single-line content in the preset current title area. The preset number of single-line fonts can be the upper limit value of the number of fonts of the single-line content in the preset current title area. The preset single-line font size and the preset number of single-line fonts can be preset and adjusted by technicians according to experience. Exemplarily, the preset single-line font size can be 18px; the preset number of single-line fonts can be 20.
[0066] Specifically, it can be detected whether the current content structure of the current page image is hierarchical display and whether the current content intervals are the same. When the current content structure of the current page image is hierarchical display and the current content intervals are the same, the area where the content of the current page image is located can be determined as the current menu area. The other areas of the current page image except the current title area and the current menu area can be determined as the current content area of the current page image.
[0067] Specifically, before identifying the key information in the current content area to obtain the current key information and adding the current page watermark at the current key information, the current title width of the current title area can be compared with the image width of the current page image. When the current title width is greater than or equal to the first preset ratio of the image width of the current page image, the current page watermark position of the current title area is determined to be the middle position of the current title area; when the current title width is less than the first preset ratio of the image width of the current page image, the current page watermark position of the current title area is determined to be the two ends of the current title area. The current page watermark can be added at the current page watermark position of the current title area. Among them, the first preset ratio can be a preset ratio for measuring the current page watermark position of the current title area. The first preset ratio can be preset and adjusted by technicians according to experience. Exemplarily, the first preset ratio can be 1 / 3.
[0068] Specifically, the current menu height of the current menu area can be compared with the image height of the current page image. When the current menu height is less than the second preset ratio of the image height of the current page image, the current page watermark position of the current menu area is determined to be the bisecting position of the current menu area. When the current menu height is greater than or equal to the second preset ratio of the image height of the current page image and less than the third preset ratio of the image height of the current page image, the current page watermark position of the current menu area is determined to be the quartering position of the current menu area. When the current menu height is greater than or equal to the third preset ratio of the image height of the current page image, the current page watermark position of the current menu area is determined to be the sixth - dividing position of the current menu area. The current page watermark can be added at the current page watermark position of the current menu area. Among them, the second preset ratio and the third preset ratio can be preset ratios for measuring the current page watermark position of the current menu area. The second preset ratio and the third preset ratio can be preset and adjusted by technicians according to experience. The second preset ratio is less than the third preset ratio. Exemplarily, the second preset ratio can be 1 / 3; the third preset ratio can be 2 / 3.
[0069] This solution identifies the current title area and the current menu area while identifying the current content area of the current page image, and adds the current page watermark to the current title area and the current menu area, achieving full coverage of watermarks for browser page data and browser print data, and further improving the security of browser page data and browser print data.
[0070] Optionally, after determining the current page watermark position of the current title area according to the current title width of the current title area and the image width of the current page image, and adding the current page watermark at the current page watermark position of the current title area, it further includes: identifying the login information of the current title area to obtain the current login information, and adding the current page watermark at the current login information.
[0071] The current login information can be used to represent the information of the page data adder. By detecting the current login information and adding the current page watermark at the current login information, the information security of the page data adder is improved, and thus the security of the browser page data and the browser print data is improved.
[0072] Embodiment 2
[0073] Figure 2 The figure is a flowchart of a page watermark generation method provided by Embodiment 2 of the present invention. On the basis of the above embodiments, before "detecting the watermark uncovered area of the current content area and uniformly adding the current page watermark in the watermark uncovered area", Embodiment 2 of the present invention further adds "detecting the current watermark distance between the current page watermarks in the current content area or the current overlap number between the current page watermark areas corresponding to the current page watermarks; determining the current watermark coverage rate of the current content area according to the current watermark distance between the current page watermarks in the current content area or the current overlap number between the current page watermark areas corresponding to the current page watermarks; when detecting that the current watermark coverage rate of the current content area is greater than or equal to the preset watermark coverage rate, screening the target page watermarks from the current page watermarks according to the current watermark distance between the current page watermarks in the current content area or the current overlap number between the current page watermark areas corresponding to the current page watermarks, and cropping the target page watermarks", which avoids the current page watermarks in the current content area of the current page image being too dense and affecting the browsing experience of the content of the browser page data or the browser print data, can improve the rationality of the number of page watermarks in the browser page data or the browser print data, and thus improves the comfort of the page user when browsing the browser page data or the browser print data. It should be noted that for the parts not detailed in Embodiment 2 of the present invention, reference can be made to the descriptions of other embodiments.
[0074] See Figure 2 The page watermark generation method shown is applied to a post-processor and includes:
[0075] S210. When it is detected that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, call the current event source, obtain the current root element corresponding to the current event source, and render the front-end page to obtain the current display page.
[0076] S220. Generate a current page image according to the current resolution of the current display page and the current root element.
[0077] S230. Perform region recognition on the current page image to determine the current content area of the current page image.
[0078] S240. Perform key information recognition on the current content area to obtain the current key information, and add the current page watermark at the current key information.
[0079] S250. Detect the watermark-uncovered area of the current content area, evenly add the current page watermark in the watermark-uncovered area, and feedback the current page image to the front-end page so that the front-end page displays the current page image after adding the current page watermark.
[0080] S260. Detect the current watermark distance between each current page watermark in the current content area or the current overlap number between the current page watermark areas corresponding to each current page watermark.
[0081] The current watermark distance can be the distance between each current page watermark in the current content area. The current page watermark area can be a rectangular area mapped by the current page watermark in the current content area. It can be understood that the current page watermark can have an inclination angle in the current content area. The current page watermark can be mapped in the horizontal and vertical directions of the current content area to generate a rectangular area, obtaining the current page watermark area. The current overlap number between the current page watermark areas corresponding to each current page watermark can be the number of current page watermark areas corresponding to the same position in the current content area.
[0082] Specifically, the current watermark distance between each current page watermark in the current content area can be detected. The overlap number between the current page watermark areas corresponding to each current page watermark can be detected to obtain the current overlap number between the current page watermark areas corresponding to each current page watermark.
[0083] S270. Determine the current watermark coverage rate of the current content area according to the current watermark distance between each current page watermark in the current content area or the current overlap number between the current page watermark areas corresponding to each current page watermark.
[0084] The current watermark coverage rate can characterize the maximum density of the current page watermark in the watermark-covered area of the current content area. The greater the current watermark distance between the current page watermarks, the lower the current watermark coverage rate of the current content area; the smaller the current watermark distance between the current page watermarks, the higher the current watermark coverage rate of the current content area. The greater the current overlap number between the current page watermark areas corresponding to the current page watermarks, the higher the current watermark coverage rate of the current content area; the smaller the current overlap number between the current page watermark areas corresponding to the current page watermarks, the lower the current watermark coverage rate of the current content area. There is a preset corresponding relationship between the current watermark distance between the current page watermarks and the watermark coverage rate. There is a preset corresponding relationship between the current overlap number between the current page watermark areas corresponding to the current page watermarks and the watermark coverage rate.
[0085] Specifically, the current watermark distances between the current page watermarks can be compared to determine the minimum value of the current watermark distance. According to the minimum value of the current watermark distance, the watermark coverage rate with a preset corresponding relationship to the minimum value of the current watermark distance is queried to obtain the current watermark coverage rate of the current content area. Alternatively, the current overlap numbers between the current page watermark areas corresponding to the current page watermarks can be compared to determine the maximum value of the current overlap number. According to the maximum value of the current overlap number, the watermark coverage rate with a preset corresponding relationship to the maximum value of the current overlap number is queried to obtain the current watermark coverage rate of the current content area.
[0086] S280. When it is detected that the current watermark coverage rate of the current content area is greater than or equal to the preset watermark coverage rate, target page watermarks are screened out from the current page watermarks according to the current watermark distance between the current page watermarks in the current content area or the current overlap number between the current page watermark areas corresponding to the current page watermarks, and the target page watermarks are cropped.
[0087] The preset watermark coverage rate can be the upper limit value of the preset watermark coverage rate. The preset watermark coverage rate can be set and adjusted by technicians according to experience. The target page watermark can be the current page watermark at a relatively dense watermark area. It can be understood that the target page watermark can be the current page watermark that needs to be cropped, that is, the current page watermark that needs to be removed among the current page watermarks.
[0088] Specifically, when it is detected that the current watermark coverage rate of the current content area is greater than or equal to the preset watermark coverage rate, the preset watermark distance corresponding to the preset watermark coverage rate can be queried. The current watermark distance between each current page watermark in the current content area can be compared with the preset watermark distance. Among the current page watermarks with the current watermark distance less than or equal to the preset watermark distance, the overlapping current page watermarks are selected to obtain the target page watermarks. The target page watermarks can be cropped. Or when it is detected that the current watermark coverage rate of the current content area is greater than or equal to the preset watermark coverage rate, the preset overlap number corresponding to the preset watermark coverage rate can be queried. The current overlap number between the current page watermark areas corresponding to each current page watermark in the current content area can be compared with the preset overlap number. Each current page watermark with the current overlap number greater than or equal to the preset overlap number can be determined as the target page watermark. The target page watermarks can be cropped.
[0089] The technical solution of the embodiment of the present invention introduces the detection of the current watermark distance or the current overlap number, calculates the current watermark coverage rate of the current content area, and based on the current watermark coverage rate of the current content area, filters and crops the target page watermarks, avoiding the over-density of the current page watermarks in the current content area of the current page picture, which affects the browsing experience of the content of the browser page data or the browser print data, and can improve the rationality of the number of page watermarks in the browser page data or the browser print data, thereby improving the comfort of the page user in browsing the browser page data or the browser print data.
[0090] In an optional embodiment of the present invention, after cropping the target page watermarks, it further includes: filtering out the target key information that is not covered by the current page watermarks among the current key information in the watermark coverage area of the current content area; rotating the current page watermarks according to the target key information so that the current page watermarks can cover the target key information.
[0091] The target key information can be the current key information that is not covered by the current page watermarks. In terms of the importance of the content, compared with other content in the current content area, the content of the target key information is of higher importance, but the target key information is not covered.
[0092] Specifically, after cropping the target page watermarks, it can be detected whether each current key information in the watermark coverage area of the current content area is covered by the current page watermarks, and the current key information that is not covered by the current page watermarks can be filtered out to obtain the target key information. According to the position of the target key information, the current page watermarks are rotated so that the current page watermarks can cover the target key information.
[0093] After cropping the target page watermark, in each current key information in the watermark coverage area of the current content area, the target key information not covered by the current page watermark is filtered. According to the target key information, the current page watermark is rotated so that the current page watermark can cover the target key information. On the basis of taking into account the rationality of the number of page watermarks in browser page data or browser print data, the security of key information in the current page image is further improved, thus taking into account the security of front-end page data and the rationality of the number of front-end page watermarks.
[0094] On the basis of the above embodiments, the present invention also provides a preferred embodiment. The method for generating a page watermark includes:
[0095] Step A: Intercept the current page data loading operation through a pre-interceptor, generate a current operation number corresponding to the current page data loading operation, and store the current operation number in the session manager.
[0096] Step B: When it is detected through a front-end interceptor that the data loading process corresponding to the current page data loading operation has been completed, delete the current operation number corresponding to the current page data loading operation in the session manager.
[0097] Step C: Detect through a post-processor whether there are other operation numbers in the session manager where the current operation number is located. When there are other operation numbers in the session manager where the current operation number is located, do nothing; when there are no other operation numbers in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, call the HTML element of the current event source, obtain the current root element corresponding to the current event source, register the rendering completion event, and obtain the current display page.
[0098] Step D: After the current display page is rendered, automatically trigger the watermark display mechanism through the post-processor, obtain the current resolution of the current display page and the current root element of the overall current display page, determine the image size of the current page image according to the current resolution of the current page; starting from the current root element of the current display page, obtain all current sub-element chains corresponding to the current root element, determine the image content of the current page image according to each current sub-element chain; generate the current page image according to the image size and image content of the current page image.
[0099] Step E: Use a post-processor to recognize the current page image, determine the current layout of the current page image; perform a preliminary regional division on the current page image according to the regional background colors of different regions in the current layout; for the preliminary regional division result of the current page image, perform regional recognition on the current page image according to the current single-line font size and the current number of single-line fonts of the current page image to determine the current title area of the current page image; perform regional recognition on the current page image according to the current content structure and the current content interval of the current page image to determine the current menu area of the current page image; determine the other areas of the current page image except the current title area and the current menu area as the current content area of the current page image.
[0100] Exemplarily, font recognition can be performed on the current page image. If the current single-line font size of the current page image exceeds 18px and the current number of single-line fonts does not exceed 20, it is default defined as the current title area.
[0101] Exemplarily, when it can be detected that the current page image is hierarchically displayed and the density interval distance is the same, it is default defined as the current menu area.
[0102] Exemplarily, the other areas of the current page image except the current title area and the current menu area can be determined as the current content area.
[0103] Step F: According to the current title width of the current title area and the image width of the current page image, determine the current page watermark position of the current title area, and add the current page watermark at the current page watermark position of the current title area.
[0104] Exemplarily, in the current title area, determine the current page watermark position according to the current title width. Specifically, if the current title width is greater than or equal to 1 / 3 of the image width of the current page image, add the current page watermark at the beginning and end of the title in the current title area; if the current title width is less than 1 / 3 of the image width of the current page image, add the current page watermark in the middle of the title in the current title area. Additionally, the current login information in the current title area can be recognized simultaneously, and the current page watermark is automatically added at the current login information.
[0105] Step G: According to the current menu height of the current menu area and the image height of the current page image, determine the current page watermark position of the current menu area, and add the current page watermark at the current page watermark position of the current menu area.
[0106] Exemplarily, determine the current page watermark position based on the current menu height in the current menu area and the picture height of the current page picture. Specifically, if the current menu height is less than 1 / 3 of the picture height of the current page picture, then evenly add 2 current page watermarks in the current menu area; if the current menu height is greater than or equal to 1 / 3 of the picture height of the current page picture and less than 2 / 3 of the picture height of the current page picture, then evenly add 4 current page watermarks in the current menu area; if the current menu height is greater than or equal to 2 / 3 of the picture height of the current page picture, then evenly add 6 current page watermarks in the current menu area.
[0107] Step H: Identify key information and sensitive information in the current page picture to obtain the current key information and current sensitive information; add the current page watermark at the current key information and current sensitive information; evenly add the current page watermark in the area not covered by the watermark; calculate the current watermark coverage rate of the current content area; when it is detected that the current watermark coverage rate of the current content area is greater than or equal to the preset watermark coverage rate, screen the target page watermark from each current page watermark and crop the target page watermark; among each current key information in the watermark-covered area of the current content area, screen the target key information not covered by the current page watermark; rotate the current page watermark according to the target key information so that the current page watermark can cover the target key information; feedback the current page picture to the front-end page so that the front-end page displays the current page picture after adding the current page watermark.
[0108] Exemplarily, in the current content area, the display method of the current page watermark is mainly divided into precise display and average display.
[0109] Among them, the precise display may include the following steps:
[0110] 1) By establishing a content container, perform multi-level recognition on the current page picture to obtain the current page content of the current content area.
[0111] 2) Sensitive information extraction prompt words can be adopted, and the current page content is input into a pre-trained large language model to identify the current sensitive information and put it into the content container. Among them, the sensitive information extraction prompt words can be "Please identify the sensitive information contained in this content: current page content; such as sensitive information stipulated by law."
[0112] 3) Preset keywords can be predefined by technicians in advance. Based on the preset keywords, perform regular recognition on the current page content to obtain the current key information and put it into the content container.
[0113] 4) After the recognition is completed, if there is content in the content container, then perform watermark display on the content position in the content container.
[0114] 5) Meanwhile, according to the current watermark distance between the current page watermarks in the current content area or the current overlap number between the current page watermark areas corresponding to the current page watermarks, determine the current watermark coverage rate of the current content area. When it is detected that the current watermark coverage rate of the current content area is greater than or equal to the preset watermark coverage rate, filter the target page watermarks from the current page watermarks according to the current watermark distance between the current page watermarks in the current content area or the current overlap number between the current page watermark areas corresponding to the current page watermarks, and crop the target page watermarks.
[0115] 6) After cropping the target page watermarks, filter the target key information that is not covered by the current page watermarks from each current key information in the watermark coverage area of the current content area; according to the target key information, rotate the current page watermarks so that the current page watermarks can cover the target key information.
[0116] 7) Detect the watermark-uncovered area of the current content area, and evenly add the current page watermarks in the watermark-uncovered area, such as automatically performing 6-equal-part watermark display on the current page picture.
[0117] Among them, the average display may include: if there is no content in the content container, it means that there is no key information and sensitive information in the current page picture, and the watermark display is mainly performed according to the 6-equal-part of the current page picture.
[0118] In this solution, through the pre-interceptor, intercept the page data loading operation during the interaction between the front-end page and the back-end server and process the operation number corresponding to the page data loading operation in the session manager. Combine the session manager to manage the operation number, realize the monitoring of the data interaction between the front-end page and the back-end server. When the page operator browses and prints the browser page data, add watermarks to the key information in the current content area, improve the security of the key information in the current page picture, realize the addition of watermarks to the content in the watermark-uncovered area of the current content area, improve the security of the page data in the watermark-uncovered area of the current content area, and thus improve the security of the front-end page data when the page operator browses and prints the browser page data.
[0119] Embodiment III
[0120] Figure 3The figure is a schematic structural diagram of a page watermark generation device provided in Embodiment 3 of the present invention. The embodiments of the present invention are applicable to the situation of implanting watermarks into browser page data or browser print data. The device can execute a page watermark generation method. The device can be implemented in the form of hardware and / or software, and can be configured in an electronic device with the function of generating page watermarks.
[0121] Refer to Figure 3 The page watermark generation device shown in the figure is applied to a post-processor and includes: a current display page generation module 310, a current page image generation module 320, a current content area recognition module 330, a first current watermark addition module 340, and a second current watermark addition module 350. Among them, the current display page generation module 310 is configured to, when it is detected that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, call the current event source based on the current page data loading operation corresponding to the current operation number, obtain the current root element corresponding to the current event source, and render the front-end page to obtain the current display page; the current page image generation module 320 is configured to generate a current page image according to the current resolution and the current root element of the current display page; the current content area recognition module 330 is configured to perform area recognition on the current page image to determine the current content area of the current page image; the first current watermark addition module 340 is configured to perform key information recognition on the current content area to obtain current key information, and add a current page watermark at the current key information; the second current watermark addition module 350 is configured to detect the watermark-uncovered area of the current content area, uniformly add a current page watermark in the watermark-uncovered area, and feedback the current page image to the front-end page so that the front-end page displays the current page image after adding the current page watermark.
[0122] In the technical solution of the embodiment of the present invention, when it is detected that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, the current event source is called to obtain the current root element corresponding to the current event source, and the front-end page is rendered to obtain the current display page. According to the current resolution of the current display page and the current root element, a current page image is generated. Through the operation number in the session manager, the monitoring of data interaction between the front-end page and the back-end server is realized. When the data loading of a single session of the front-end page is completed, the generation of the front display page and the current page image corresponding to the current display page is realized; by performing region recognition on the current page image, the current content region of the current page image is determined, key information recognition is performed on the current content region to obtain the current key information, and a current page watermark is added at the current key information, so that when the page operator browses and prints the browser page data, the addition of the watermark to the key information in the current content region is realized, and the security of the key information in the current page image is improved; by detecting the watermark-uncovered region of the current content region and uniformly adding the current page watermark in the watermark-uncovered region, the current page image is fed back to the front-end page so that the front-end page displays the current page image after adding the current page watermark, the addition of the watermark to the content in the watermark-uncovered region of the current content region is realized, and the security of the page data in the watermark-uncovered region of the current content region is improved, thereby improving the security of the front-end page data when the page operator browses and prints the browser page data.
[0123] In an optional embodiment of the present invention, the device further includes: a current overlap number detection module, configured to detect the current watermark distance between the current page watermarks in the current content region or the current overlap number between the current page watermark regions corresponding to the current page watermarks before detecting the watermark-uncovered region of the current content region and uniformly adding the current page watermark in the watermark-uncovered region; a current watermark coverage rate calculation module, configured to determine the current watermark coverage rate of the current content region according to the current watermark distance between the current page watermarks in the current content region or the current overlap number between the current page watermark regions corresponding to the current page watermarks; a target page watermark cropping module, configured to, when it is detected that the current watermark coverage rate of the current content region is greater than or equal to a preset watermark coverage rate, screen target page watermarks from the current page watermarks according to the current watermark distance between the current page watermarks in the current content region or the current overlap number between the current page watermark regions corresponding to the current page watermarks, and crop the target page watermarks.
[0124] In an alternative embodiment of the present invention, the apparatus further includes: a target key information screening module, configured to, after cropping the target page watermark, screen, from each of the current key information in the watermark coverage area of the current content area, target key information that is not covered by the current page watermark; and a current page watermark rotation module, configured to rotate the current page watermark according to the target key information, so that the current page watermark can cover the target key information.
[0125] In an alternative embodiment of the present invention, the apparatus further includes: a current title area recognition module, configured to, while performing area recognition on the current page picture to determine the current content area of the current page picture, perform area recognition on the current page picture according to the current single-line font size and the current single-line font quantity of the current page picture, so as to determine the current title area of the current page picture; a current menu area recognition module, configured to perform area recognition on the current page picture according to the current content structure and the current content interval of the current page picture, so as to determine the current menu area of the current page picture; a current content area recognition module, configured to determine, as the current content area of the current page picture, other areas of the current page picture except the current title area and the current menu area; a third current watermark adding module, configured to, before performing key information recognition on the current content area to obtain current key information and adding a current page watermark at the current key information, determine the current page watermark position of the current title area according to the current title width of the current title area and the picture width of the current page picture, and add a current page watermark at the current page watermark position of the current title area; and a fourth current watermark adding module, configured to determine the current page watermark position of the current menu area according to the current menu height of the current menu area and the picture height of the current page picture, and add a current page watermark at the current page watermark position of the current menu area.
[0126] In an alternative embodiment of the present invention, the apparatus further includes: a fifth current watermark adding module, configured to, while performing key information recognition on the current content area to obtain current key information and adding a current page watermark at the current key information, perform sensitive information recognition on the current content area to obtain current sensitive information, and add a current page watermark at the current sensitive information.
[0127] In an alternative embodiment of the present invention, the apparatus further includes: a pre - interceptor, which is configured to intercept the current page data loading operation of the front - end page before rendering the front - end page to obtain the current display page by calling the current event source to obtain the current root element corresponding to the current event source based on the current page data loading operation corresponding to the current operation number when it is detected that the current operation number has been deleted in the session manager and there is no other operation number in the session manager where the current operation number is located, generate the current operation number corresponding to the current page data loading operation, and store the current operation number in the session manager; the pre - interceptor is further configured to delete the current operation number corresponding to the current page data loading operation in the session manager when it is detected that the data loading process corresponding to the current page data loading operation has been completed.
[0128] The page watermark generation apparatus provided by the embodiments of the present invention can execute the page watermark generation method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.
[0129] In the technical solution of the embodiments of the present invention, the acquisition, storage, and application of the current root element corresponding to the current event source, etc., all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.
[0130] Embodiment 4
[0131] Figure 4 FIG. shows a schematic structural diagram of an electronic device 400 that can be used to implement the embodiments of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0132] Such as Figure 4As shown, the electronic device 400 includes at least one processor 401 and a memory communicatively connected to the at least one processor 401, such as a read-only memory (ROM) 402, a random access memory (RAM) 403, etc. The memory stores a computer program executable by the at least one processor. The processor 401 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 402 or the computer program loaded from the storage unit 408 into the random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 can also be stored. The processor 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0133] Multiple components in the electronic device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a magnetic disk, an optical disc, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the electronic device 400 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0134] The processor 401 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 401 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 401 executes the various methods and processes described above, such as the page watermark generation method.
[0135] In some embodiments, the page watermark generation method can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as the storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the processor 401, one or more steps of the page watermark generation method described above can be executed. Alternatively, in other embodiments, the processor 401 can be configured to execute the page watermark generation method by any other appropriate means (e.g., by means of firmware).
[0136] The various embodiments of the devices and techniques described above in this document can be implemented in digital electronic circuitry, integrated circuit devices, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable apparatus including at least one programmable processor, which can be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage device, at least one input device, and at least one output device.
[0137] The computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The computer programs can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
[0138] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution apparatus, device, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor devices, devices, or equipment, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.
[0139] To provide interaction with a user, the apparatuses and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or an LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0140] The apparatuses and techniques described herein can be implemented in a computing device including a backend component (e.g., as a data server), or a computing device including a middleware component (e.g., an application server), or a computing device including a frontend component (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the apparatuses and techniques described herein), or a computing device including any combination of such backend components, middleware components, or frontend components. The components of the device can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0141] A computing device can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The relationship between the client and the server is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system and solves the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS (Virtual Private Server) services.
[0142] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is imposed herein.
[0143] The above specific embodiments do not constitute a limitation to the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A method for generating a page watermark, characterized in that: Applied to a post-processor, the method comprises: When it is detected that the current operation number has been deleted in the session manager and no other operation number exists in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, the current event source is called, the current root element corresponding to the current event source is obtained, and the front-end page is rendered to obtain the current display page; Generate a current page image according to the current resolution and the current root element of the currently displayed page; Performing area recognition on the current page image to determine the current content area of the current page image; wherein the current content area is other areas of the current page image except the current title area and the current menu area; Performing key information identification on the current content area to obtain current key information, and adding a current page watermark at the current key information; Detect the watermark uncovered area of the current content area, and evenly add the current page watermark in the watermark uncovered area, and feed back the current page image to the front page so that the front page displays the current page image after adding the current page watermark.
2. The method according to claim 1, characterized in that Before detecting the watermark uncovered area of the current content area and uniformly adding the current page watermark in the watermark uncovered area, the method further includes: Detecting a current watermark distance between each of the current page watermarks in the current content area or a current overlap number between current page watermark areas corresponding to each of the current page watermarks; Determine the current watermark coverage of the current content area according to the current watermark distance between the current page watermarks in the current content area or the current overlap number between the current page watermark areas corresponding to the current page watermarks; When it is detected that the current watermark coverage of the current content area is greater than or equal to the preset watermark coverage, the target page watermark is filtered out from each current page watermark according to the current watermark distance between each current page watermark in the current content area or the current overlap number between the current page watermark areas corresponding to each current page watermark, and the target page watermark is cropped.
3. The method according to claim 2, characterized in that After the target page watermark is cut, the method further includes: Filtering target key information not covered by the current page watermark from each of the current key information in the watermark coverage area of the current content area; The current page watermark is rotated according to the target key information so that the current page watermark can cover the target key information.
4. The method according to claim 1, characterized in that While performing area recognition on the current page image and determining the current content area of the current page image, the method further includes: According to the current single-line font size and the current single-line font quantity of the current page image, performing area recognition on the current page image to determine the current title area of the current page image; According to the current content structure and current content interval of the current page image, performing area recognition on the current page image to determine the current menu area of the current page image; Determine other areas of the current page image except the current title area and the current menu area as the current content area of the current page image; Before identifying the key information of the current content area to obtain the current key information and adding the current page watermark at the current key information, the method further includes: Determine the current page watermark position of the current title area according to the current title width of the current title area and the picture width of the current page picture, and add the current page watermark at the current page watermark position of the current title area; The current page watermark position of the current menu area is determined according to the current menu height of the current menu area and the picture height of the current page picture, and the current page watermark is added at the current page watermark position of the current menu area.
5. The method according to claim 1, characterized in that: While identifying the key information of the current content area to obtain the current key information and adding the current page watermark at the current key information, the method further includes: Sensitive information is identified in the current content area to obtain current sensitive information, and a current page watermark is added at the current sensitive information.
6. The method according to claim 1, characterized in that When it is detected that the current operation number has been deleted in the session manager and no other operation number exists in the session manager where the current operation number is located, based on the current page data loading operation corresponding to the current operation number, the current event source is called, the current root element corresponding to the current event source is obtained, and the front-end page is rendered to obtain the current display page, before the process further includes: The current page data loading operation of the front-end page is intercepted by the front-end interceptor, a current operation number corresponding to the current page data loading operation is generated, and the current operation number is stored in the session manager; Through the front interceptor, when it is detected that the data loading process corresponding to the current page data loading operation has been completed, the current operation number corresponding to the current page data loading operation in the session manager is deleted.
7. A page watermark generation device, characterized in that: Applied to a post-processor, the device comprises: A current display page generation module is used to call the current event source based on the current page data loading operation corresponding to the current operation number, obtain the current root element corresponding to the current event source, render the front-end page, and obtain the current display page when it is detected that the current operation number has been deleted in the session manager and no other operation number exists in the session manager where the current operation number is located; A current page image generation module, used to generate a current page image according to the current resolution and current root element of the currently displayed page; A current content area identification module, used to perform area identification on the current page image and determine the current content area of the current page image; wherein the current content area is other areas of the current page image except the current title area and the current menu area; A first current watermark adding module, used for identifying key information of the current content area, obtaining current key information, and adding a current page watermark at the current key information; The second current watermark adding module is used to detect the watermark uncovered area of the current content area, and evenly add the current page watermark in the watermark uncovered area, and feed back the current page image to the front-end page so that the front-end page displays the current page image after adding the current page watermark.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the page watermark generation method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the page watermark generation method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method for generating a page watermark according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Webpage digital watermark generation and identification method and system based on particle effect
CN117972656A
Webpage watermark implanting method and device, electronic equipment and storage medium
CN119211435A