Webpage watermark adding method, terminal and server

By sending a watermark addition request to the watermark server at the terminal, the problem of low efficiency in adding web page watermarks in the existing technology is solved, and the effect of adding watermarks to the front-end web pages is achieved without publishing a new version.

CN120030252APending Publication Date: 2025-05-23HENAN QINWEI DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510081495.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-17
Publication Date
2025-05-23

AI Technical Summary

Technical Problem

The prior art is less efficient when adding watermarks to web pages and needs to release a new version, which makes the watermark unable to be added in time.

Method used

After receiving user access operations at the terminal, the access request is sent to the target website server, the first web page data is received, and the watermark addition request is sent to the watermark server, the second web page data is received, and the watermark is displayed.

Benefits of technology

You can add watermarks to the front-end web pages without publishing a new version, which avoids the problem of watermarks being unable to be added in time due to code modifications on the front-end web pages, and improves the efficiency of adding web page watermarks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120030252A_ABST
    Figure CN120030252A_ABST
Patent Text Reader

Abstract

The invention relates to a webpage watermark adding method, a terminal and a server, and the method comprises the steps: sending an access request to a target website server corresponding to a target website under the condition that an access operation of a user for the target website is received; receiving first webpage data sent by the target website server; sending a watermark adding request to a watermark server, wherein the watermark adding request is used for requesting to add a watermark on the target webpage; receiving second webpage data sent by the watermark server; and displaying the target webpage with the watermark based on the second webpage data. Therefore, the watermark can be added to the webpage at the front end through the watermark server without releasing a new version, the problem that the watermark cannot be added in time due to direct code modification on the webpage at the front end can be avoided, and the webpage watermark adding efficiency can be improved to a great extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, terminal and server for adding watermarks to a web page. Background Art

[0002] With the continuous development of the Internet, in order to prevent the content of a web page from being stolen, a watermark is usually added to the web page. In the related art, when adding a watermark to a web page, code modification is generally performed on the front-end web page.

[0003] However, when the related technology adds watermarks to web pages, if the code of the front-end web page is modified, a new version needs to be released, resulting in low efficiency of adding watermarks to web pages using the related technology. Summary of the invention

[0004] The embodiments of the present application provide a method, terminal and server for adding watermarks to web pages, which can improve the efficiency of adding watermarks to web pages.

[0005] According to a first aspect of the present disclosure, a method for adding a webpage watermark is provided, which is applied to a terminal, and the method includes:

[0006] When receiving an access operation of a user to a target website, sending an access request to a target website server corresponding to the target website;

[0007] Receiving first web page data sent by the target website server, wherein the first web page data is used to generate a target web page;

[0008] Sending a watermark adding request to a watermark server, wherein the watermark adding request is used to request adding a watermark to the target web page;

[0009] receiving second web page data sent by the watermark server, wherein the second web page data is used to generate a target web page with a watermark;

[0010] Based on the second web page data, a target web page with a watermark is displayed.

[0011] According to a second aspect of the present disclosure, a method for adding a watermark to a web page is provided, which is applied to a watermark server, and the method comprises:

[0012] receiving a watermark adding request sent by a terminal, wherein the watermark adding request is used to request adding a watermark on a target web page;

[0013] Based on the watermark adding request, second web page data is generated and sent to the terminal, where the second web page data is used to generate a target web page with a watermark.

[0014] According to a third aspect of the present disclosure, a webpage watermark adding device is provided, which is applied to a terminal, and the device includes:

[0015] An access request sending module, configured to send an access request to a target website server corresponding to the target website when receiving an access operation of the user to the target website;

[0016] A first web page data receiving module, used for receiving first web page data sent by the target website server, wherein the first web page data is used for generating a target web page;

[0017] A watermark adding request sending module, used for sending a watermark adding request to a watermark server, wherein the watermark adding request is used for requesting to add a watermark on the target web page;

[0018] A second web page data receiving module, used for receiving second web page data sent by the watermark server, wherein the second web page data is used for generating a target web page with a watermark;

[0019] The target web page display module is used to display the target web page with a watermark based on the second web page data.

[0020] According to a fourth aspect of the present disclosure, a webpage watermarking device is provided, which is applied to a watermark server, and the device includes:

[0021] A watermark adding request receiving module, used for receiving a watermark adding request sent by a terminal, wherein the watermark adding request is used for requesting to add a watermark on a target web page;

[0022] A second web page data generating module, used for generating second web page data based on the watermark adding request;

[0023] The second web page data sending module is used to send the second web page data to the terminal, where the second web page data is used to generate a target web page with a watermark.

[0024] According to a fifth aspect of the present disclosure, a terminal is provided. The terminal includes: a display for displaying a web page; at least one processor connected to the display; and a memory for storing instructions executable by the at least one processor; wherein the at least one processor is configured to execute the instructions to implement the method described in the first aspect.

[0025] According to a sixth aspect of the present disclosure, a server is provided, comprising: at least one processor and a memory for storing instructions executable by the at least one processor; wherein the at least one processor is configured to execute the instructions to implement the method as described in the second aspect.

[0026] According to a seventh aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above method of the present disclosure is implemented.

[0027] According to an eighth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the above method of the present disclosure when executed by a processor.

[0028] The webpage watermarking method, terminal and server provided by the disclosed embodiment, when receiving the user's access operation to the target website, will send an access request to the target website server corresponding to the target website, by receiving the first webpage data sent by the target website server and sending the watermark adding request to the watermark server, when receiving the second webpage data sent by the watermark server, the target webpage with the watermark can be displayed based on the second webpage data. The disclosed embodiment adds a watermark to the webpage by sending a watermark adding request to the watermark server, and can achieve the addition of watermarks to the front-end webpage without releasing a new version, which can avoid the problem of watermarks not being added in time due to code modification directly on the front-end webpage, and can greatly improve the efficiency of adding webpage watermarks. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Further details, features and advantages of the present disclosure are disclosed in the following description of exemplary embodiments in conjunction with the accompanying drawings, in which:

[0030] Figure 1 A schematic diagram of a system architecture provided for an exemplary embodiment of the present disclosure;

[0031] Figure 2 A schematic diagram of a process of adding a watermark to a page in a web page through a watermark server provided by an exemplary embodiment of the present disclosure;

[0032] Figure 3 A schematic diagram of a process of adding a watermark to a page in a web page through a watermark server provided by another exemplary embodiment of the present disclosure;

[0033] Figure 4 A schematic diagram of a method for adding a watermark to a web page provided by an exemplary embodiment of the present disclosure;

[0034] Figure 5 A schematic diagram of a method for adding a watermark to a web page provided by another exemplary embodiment of the present disclosure;

[0035] Figure 6 A schematic block diagram of functional modules of a webpage watermark adding device provided by an exemplary embodiment of the present disclosure;

[0036] Figure 7A schematic block diagram of functional modules of a webpage watermark adding device provided by another exemplary embodiment of the present disclosure;

[0037] Figure 8 A structural block diagram of a server provided for an exemplary embodiment of the present disclosure;

[0038] Fig. 9 A structural block diagram of a computer system provided for an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0039] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0040] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0041] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0042] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0043] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0044] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0045] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0046] As an optional but non-limiting implementation, in response to receiving an active request from the user, the method of sending a prompt message to the user may be, for example, a pop-up window, in which the prompt message may be presented in text. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understandable that the above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0047] In the embodiment provided by the present disclosure, by setting a watermark server, the watermark of the target page in the web page is added in the watermark server, and the complete page with the watermark added is returned to the terminal. In this way, when it is necessary to add a watermark to the web page, the watermark can be added to the front-end page without releasing a new version, which can avoid the tediousness of modifying the front-end of each page from the code level. When there is no permission to modify the page code, the watermark server injects the target MTML parameters and the watermark code containing the watermark configuration information into the HTML template, sends the obtained web page data with the watermark to the terminal, and displays the web page with the watermark on the terminal. This can avoid the problem of being unable to add watermarks due to lack of access rights when adding watermarks to web pages through proxy servers in the related art, and can greatly improve the efficiency of adding watermarks to pages in web pages.

[0048] Specifically, in the embodiments provided in the present disclosure, Figure 1 As shown, Figure 1 The system architecture diagram provided by the embodiment of the present disclosure may include a terminal 10, a watermark server 20 and a target website server 30. The terminal 10 may be located at a terminal, and the terminal 10 may include a watermark adapter script 11 sent by the target website server 30. The target website server 30 may refer to a website server corresponding to a target website that a user needs to access.

[0049] The terminal 10 is used to receive a user's access operation to a target website and send an access request to a target website server 30 corresponding to the target website. By receiving the first web page data sent by the target website server 30, a watermark adding request is sent to the watermark server 20. By receiving the second web page data sent by the watermark server 20, a target web page with a watermark is displayed.

[0050] The target website server 30 is used to receive the access request sent by the terminal 10 and send the first web page data to the terminal 10 .

[0051] The watermark server 20 is used to receive a watermark adding request sent by the terminal 10 , generate second web page data, and send the second web page data to the terminal 10 .

[0052] In the embodiment, the watermark server 20 may specifically include: a watermark template management module 21, an HTML (Hyper Text Markup Language) template management module 22, a watermark injection module 23 and a log statistics analysis module 24. Among them:

[0053] The watermark template management module 21 is used to set the style, content, z-index, position or size and other properties of the watermark. Among them, z-index is a CSS (Cascading Style Sheets) attribute used to control the stacking order of elements on the page. It determines the display order of elements on the vertical plane. Elements with higher z-index values ​​will cover elements with lower z-index values.

[0054] The HTML template management module 22 is used to provide the user with HTML template management functions, including operations such as uploading, downloading or deleting HTML templates.

[0055] The watermark injection module 23 is used to inject watermark information into the HTML text or HTML template.

[0056] The log statistics analysis module 24 is used for log recording and log data analysis.

[0057] Specifically, when the terminal 10 receives a user's browsing operation on a target website, the terminal 10 sends an access request to the target website server 30 corresponding to the target website. When the target website server 30 receives the access request, if it needs to add a watermark to the accessed web page, the target website server 30 sends the web page resource including the watermark adapter script 11 to the terminal 10.

[0058] The target website loads and runs the watermark adapter script 11, and the watermark adapter script 11 sends the user information and the target HTML page or HTML related parameters of the page that the user needs to access to the watermark server 20. The target HTML page can be an original HTML page, such as an HTML text, etc. The HTML related parameters can specifically include the ID (Identity document) of the document to be accessed or the corresponding URL (uniform resource location), etc., and the embodiment is not limited thereto. The HTML template ID can be located in the preset configuration information, and can also be included in the target HTML related parameters, and can be set as needed, and the embodiment is not limited thereto.

[0059] The watermark server 20 can add a watermark to the target HTML page according to the watermark configuration and user information, etc., and send the processed complete HTML page code to the watermark adapter script 11, which will load the returned HTML page code into the page currently to be displayed through the terminal 10.

[0060] In the embodiment, the watermark adapter script can be introduced at the bottom of the page by means of a script tag. Specifically, it can be implemented in the form of a script, and the internal implementation of the watermark adapter script 11 can be a self-executing method, that is, it runs after loading, obtains the current page HTML code and other information through document.documentElement.outerHTML, and sends a request to the watermark server 20 together with the current logged-in user information.

[0061] It should be noted that document.documentElement.outerHTML is used to get or set the properties of the serialized content of the entire HTML document. It can return a complete HTML code string containing the document, including tags and all its child elements.

[0062] After receiving the response from the watermark server 20, that is, after receiving the watermarked page code sent by the watermark server 20, the watermark adapter script 11 will modify the watermark adaptation identifier, so as to prevent the secondary watermarking of the returned HTML code. The modified HTML is reloaded through the open and write methods of the document, so as to achieve the purpose of adding dynamic watermarks to the target page to be displayed.

[0063] In the embodiment, the watermark server 20 also provides a watermark template management module 21, which can be open to business system administrators, allowing each business administrator to customize the style, content, z-index, position or size of the watermark according to the characteristics of their own business system to meet the needs of different business scenarios. Among them, the business system involved in the embodiment can be a website, which can provide certain business functions to users, and the website can include multiple web pages. For example, a user can obtain the required related content by visiting the website, such as the website can be a video website, etc., and the embodiment is not limited to this.

[0064] In the embodiment, a business system can be configured with a business administrator, and each business administrator can configure multiple watermark templates for its business system, and select one of them as the effective template, and the others as alternative templates. The business administrator can switch the effective template at any time. Among them, the supported watermark attributes may include:

[0065] Font: Supports selection of multiple fonts.

[0066] Font size: Supports selection of multiple font sizes.

[0067] Color: Allows the user to select any color.

[0068] Transparency: Use the slider or enter a value to set the transparency of the watermark.

[0069] Content configuration: Users can enter text content as watermarks, or use real-time time or the logged-in user during actual use as watermarks.

[0070] Z-index configuration: Users can set the z-index property of the watermark to control its hierarchical relationship in the page or image. Set the z-index value through the input box or slider to ensure that the watermark is displayed at the correct level.

[0071] Position configuration: Users can drag or enter specific values ​​to set the position of the watermark, including horizontal and vertical offsets. Horizontal position: Supports left alignment, center alignment, right alignment, and custom offsets. Vertical position: Supports top alignment, center alignment, bottom alignment, and custom offsets.

[0072] Size Configuration: Users can adjust the size of the watermark, including width and height. Use the slider or enter specific values ​​to adjust the width and height.

[0073] After the business administrator completes the above attribute configuration, the current configuration can be saved as a template. The system will apply the selected watermark attributes to the sample HTML and preview the effect in real time. When the user visits the target website and calls the watermark service, the watermark server 20 adds a watermark to the target web page according to the valid template set by the administrator.

[0074] In the embodiment provided by the present disclosure, the HTML template management module 22 in the watermark server 20 provides HTML template management functions, including operations such as uploading, downloading or deleting HTML templates. This function module is open to business administrators to facilitate business administrators to efficiently manage HTML templates.

[0075] (1)Upload HTML template.

[0076] Allow business administrators to upload HTML template files. Business administrators can select local HTML files through the file selector and upload them to the server. During the upload process, the HTML file is formatted to ensure that the file content is legal and error-free. If the verification passes, the template file is stored in the server database and related metadata (such as template name, upload time, and uploader name, etc.) is recorded.

[0077] (2) Online preview.

[0078] The watermark server 20 supports inserting a watermark style set by a service administrator into an uploaded HTML template, and directly viewing the HTML template containing the watermark on the display interface of the terminal 10 .

[0079] (3)HTML template deleted.

[0080] Allow users to delete HTML templates that are no longer needed. Users can select the HTML templates to be deleted from the HTML template list and remove them from the server.

[0081] When the user calls the watermark server 20, the user can pass in the parameters to be injected into the HTML template, such as the HTML template ID to be used, user information, and resource ID. The watermark server 20 generates dynamic content based on the received parameters and inserts it into the specified position in the HTML template. It also queries the watermark template of the business system, generates a watermark style, and injects it into the HTML template.

[0082] In the embodiments provided by the present disclosure, for different scenarios, the target website server 30 will return different page data when receiving the access request of the terminal 10. For example, in the first scenario, for the self-developed system, the target website server 30 can return the original HTML page, such as HTML text, to the terminal 10. In the second scenario, for non-self-developed systems without source code or modification authorization, the target website server 30 will not return the original HTML page, and generally can return HTML related parameters. Therefore, the watermark injection module 23 can provide watermark injection functions in the above two scenarios.

[0083] For the first scenario, the watermark injection module 23 can receive the complete HTML text. The watermark adapter script 11 is executed after all the service codes are executed, and sends the complete HTML text to the watermark server 20.

[0084] The watermark server 20 may provide a dedicated API interface to receive the complete HTML text sent by the watermark adapter script 11. The interface may be implemented through an HTTP POST request, and accept an HTML string as the request body.

[0085] In the embodiment, the watermark server 20 can use an HTML parsing library (such as htmlparser or Jsoup, etc.) to parse the incoming HTML text. According to the preset rules, the watermark-related JS script and CSS style are inserted into the specific position of the HTML document. The JS script is used to dynamically generate and display the watermark content, and the CSS style can select the watermark template set by the business administrator to define the appearance, position or transparency of the watermark.

[0086] The watermark server 20 can return the complete HTML with the watermark-related code injected to the client, and send it to the terminal 10 through an HTTP response for rendering. For example, it can be rendered and displayed through a browser on the terminal 10.

[0087] For the second scenario mentioned above, for some non-self-developed systems without source code or modification authorization, these systems cannot effectively integrate the watermark adapter script 11 and need to be integrated through the container system in the form of iFrame (Inline Frame, floating frame). At this time, the watermark adapter can be integrated in the container system. Due to the sandbox isolation of iFrame, the container system cannot detect the loading status of the integrated system. The complete HTML template can be preset on the watermark server 20 in advance, and a request is sent through the container system to obtain the template code with the watermark added, and the page is reloaded.

[0088] It should be noted that iFrame is an element in HTML that is used to embed another HTML document in a web page. iFrame allows developers to display the content of another web page in one web page. The content embedded in iFrame is independent of the main page content and can load different URLs. You can specify the width, height, border and other attributes of iFrame to flexibly embed various external resources, such as advertisements, videos, maps, etc. By setting the sandbox attribute, you can limit the behavior of the content embedded in iFrame and improve security.

[0089] The container system in which the iFrame runs refers to the environment that hosts and runs the iFrame content. It usually refers to the main web page or application that contains the iFrame, as well as the terminal 10 and operating system environment on which the web page or application depends. Responsible for managing the resources loaded by the iFrame, such as HTML documents, CSS style sheets, or JavaScript scripts. In other words, the iFrame is a sub-document hosted and run by the container system, which is independent of each other but interdependent. By setting CSP (Content Security Policy), Same-Origin Policy, security sandbox attributes, etc., the iFrame embedded content is isolated and restricted, thereby improving the security of the entire application. For example, by setting the sandbox attribute, you can disable behaviors such as script execution or form submission in the iFrame.

[0090] Therefore, for the above scenarios, the watermark server 20 can pre-configure HTML templates, inject HTML related parameters into the corresponding HTML templates when in use, generate a complete HTML containing a watermark, and return it to the terminal or client for reloading through the terminal 10.

[0091] Specifically, the watermark server 20 can preset multiple fixed HTML templates containing basic structures and watermark-related codes, and the templates are stored in the database of the watermark server 20. The watermark server 20 also provides an API interface, through which dynamic parameters (i.e., HTML-related parameters) to be injected into the template are received, such as user information, timestamp, or resource ID, etc. The watermark server 20 can generate dynamic content based on the received dynamic parameters and insert it into a specified position in the template (e.g., <div id="content">The resource ID may include the document ID of the target document that the user needs to browse.

[0092] The embodiment can also dynamically generate watermark code by setting a watermark template and inject it into a specified position of the HTML template, for example <div id="content">The watermark server 20 returns the complete HTML containing dynamic content and watermark to the client or terminal, and sends it back to the user terminal 10 through HTTP response and renders it, so that the user can see the page content including the watermark.

[0093] In the embodiments provided in the present disclosure, the log statistics analysis module 24 may provide log recording and log data analysis functions.

[0094] (1) Log records.

[0095] Each time a watermark is added, the system records the following information:

[0096] Target address: The URL of the web page or image to which the watermark is added.

[0097] Applicant: The user ID or user name that initiates the watermark adding request.

[0098] Watermark content: Specific watermark text content.

[0099] Watermark style: The style template ID of the watermark.

[0100] Occurrence time: The specific time when the operation occurs.

[0101] In the embodiment, the log information is stored in a database of the watermark server 20 .

[0102] (2)Log data analysis.

[0103] Operation count: Count the total number of times watermarks are added within a specific time period to help evaluate the frequency of system usage.

[0104] User behavior analysis: Analyze the operation frequency of different users, identify active users, analyze the operation frequency of different users, identify active users, analyze the operation distribution of different users, and evaluate the team's workload and efficiency.

[0105] Time trend: Displays the changing trend of watermarking operations by day, week, month, etc. to help identify peak and trough periods.

[0106] Target address distribution: Count the number of times watermarks are added to different target addresses to help identify key protection objects and weak links.

[0107] The embodiment provides a function of recording watermarking operation logs and performing data analysis, and can record information such as target address, applicant, watermark content, watermark style, and occurrence time. It can support operation count, user behavior analysis, time trend analysis, and content trend analysis, so that the watermarking process can be fully monitored and optimized. Through detailed data recording and analysis capabilities, the transparency of system usage can be improved, which helps to discover potential problems and optimize them.

[0108] Based on the above embodiments, in the embodiments provided in the present disclosure, Figure 2 As shown, for the first scenario above, when adding a watermark to a page in a webpage through a watermark server in the embodiment of the present disclosure, the following steps may be specifically included:

[0109] Step S20: the terminal receives a user access operation.

[0110] For example, a user enters the URL of a target website or clicks a link of a target website on a terminal to access the target website.

[0111] Step S21: The terminal sends an access request to the target website server.

[0112] When the terminal receives the user's access operation to the target website, it will send an access request to the target website server.

[0113] Step S22: the target website server returns resources such as HTML text and watermark adapter script to the terminal.

[0114] Step S23: the terminal loads the service code and executes the watermark adapter script.

[0115] Example can be used <script>标签的方式,在页面最底部引入水印适配器脚本,确保水印适配器脚本是最后一个执行的脚本,以便获取完整的业务页面。

[0116] 步骤S24,终端判断目标页面是否已经适配。

[0117] 实施例中,用户通过终端访问目标业务系统,发起请求。终端接收到请求后进行HTML解析、CSS解析和JavaScript执行,JavaScript执行到水印适配器时,适配器会先判断该页面是否已经进行过适配。

[0118] 在目标页面已经适配的情况下,执行步骤S25,否则执行步骤S26。

[0119] 步骤S25,终端完成目标页面的加载。

[0120] 如果已经进行了适配,则直接加载页面。

[0121] 步骤S26,终端向水印服务器发送HTML文本和用户信息。

[0122] 如果还未进行水印适配,水印适配器脚本可以通过document对象下的documentElement的outerHTML属性获取到当前页面(即目标页面)HTML代码,把页面代码与用户信息发送至水印服务器。水印服务器在收到适配器脚本的请求后,会根据用户信息进行判断并结合目标业务系统的水印配置对水印适配请求进行处理。

[0123] 步骤S27,水印服务器在HTML文本中添加水印信息,并向终端返回完整的HTML。

[0124] 处理完毕后,水印服务器会将带了适配标识和适配后的页面代码响应给适配器脚本。

[0125] 实施例中,水印适配器脚本接收到水印服务器的响应后,会缓存适配标识,然后通过执行document对象的open与write方法对修改后的HTML进行重新加载。

[0126] 终端重新渲染执行到适配器脚本时,从缓存中获取到适配标识后,在判断到该页面已经进行过水印适配,则完成对页面的加载。页面会直接渲染完毕,完成动态水印添加。

[0127] 本公开提供的实施例,可以降低集成工作量及集成难度,即无需在业务系统中进行水印脚本的开发或深度集成,只需少量代码集成水印适配器,即可完成动态生成水印的功能。并且还可以进一步提上水印管理的灵活性,通过在代码中深度集成普通水印脚本时,往往水印样式和类型会受到脚本的限制,通过水印适配器动态添加水印的方式,结合水印配置模块进行对水印的管理和配置,可以提供灵活多样的水印模板和样式供用户选择。

[0128] 基于上述实施例,针对上述第二种场景,如图3所示,本公开实施例通过水印服务器对网页中的页面添加水印时,具体可以包括以下步骤:

[0129] 步骤S31,用户在通过终端访问目标资源时,终端向目标资源所在的目标网站服务器发送访问请求。其中,该目标资源可以为用户需要访问的某个文档或者相关数据等。

[0130] 步骤S32,目标网站服务器向终端返回包括水印适配器脚本、HTML模板ID和资源ID等在内的网页信息。

[0131] 步骤S33,终端解析该网页信息并执行水印适配器脚本,并携带用户信息、HTML模板ID和资源ID等向水印服务器发起请求。例如,可以通过终端中的浏览器对网页信息进行解析并执行水印适配器脚本。

[0132] 步骤S34,通过水印服务器预先配置HTML模板。

[0133] 水印服务器可以预先配置多个或者多种HTML模板,各HTML模板可以分别对应一种HTML模板标识。

[0134] 步骤S35,水印服务器将水印代码和资源ID等参数注入HTML模板,生成完整的HTML代码。

[0135] 水印服务器接收请求,并根据HTML模板ID读取对应的HTML模板,并传入资源ID等参数,并根据预先配置的水印模板,注入水印代码到HTML模板中。返回完整的HTML代码给终端,终端通过渲染接收到的完整的HTML代码,完成动态水印添加。

[0136] 本公开提供的是实施例,相比相关技术,用户从终端获取目标网站的资源时,通过终端直接与目标网站服务器进行交互,可以解决相关技术中通过使用代理服务器时没有目标访问地址权限带来的无法获取网页内容的问题。

[0137] 需要说明的是,本公开实施例中涉及到的网页和页面,可以理解为相同或者近似的概念。

[0138] 基于上述实施例,本公开实施例还提供了一种网页水印添加方法,如图4所示,该方法可以应用于终端,该方法可以包括如下步骤:

[0139] 在步骤S410中,在接收到用户针对目标网站的访问操作的情况下,向目标网站对应的目标网站服务器发送访问请求。

[0140] 实施例中,用户可以在终端中的浏览器中输入需要访问的目标网站的网址信息,或者通过点击目标网站的跳转链接等方式,访问目标网站。终端在获取用户对目标网站的访问操作时,会向目标网站对应的目标网站服务器发送访问请求。

[0141] 如果是自研系统或水印服务器具有页面代码修改的权限,目标网站服务器可以向终端返回HTML原始页面,例如HTML文本。而如果是非自研无源码或无修改授权的系统,目标网站服务器一般不会返回HTML原始页面,但可以返回HTML相关参数。HTML相关参数具体可以包括需要访问文档的ID或对应的URL等,实施例不限于此。其中,自研系统可以理解为具有HTML文本获取权限等相关的网站,或者可以理解为水印服务器具有修改页面代码的权限。

[0142] 在步骤S420中,接收目标网站服务器发送的第一网页数据。

[0143] 其中,该第一网页数据用于生成目标网页。

[0144] 实施例中,该第一网页数据可以包括HTML原始页面,例如HTML文本;或者该第一网页数据可以包括HTML相关参数。

[0145] 在步骤S430中,向水印服务器发送水印添加请求。

[0146] 其中,该水印添加请求用于请求在目标网页上添加水印。

[0147] 实施例中,终端判断用户访问的网页是否需要添加水印,如果需要添加水印,终端会向水印服务器发送水印添加请求。例如,如果该第一网页数据包括HTML文本,可以向水印服务器发送包括该HTML文本的水印添加请求;而如果该第一网页数据包括目标HTML参数,如文档的跳转等,可以向水印服务器发送包括该目标HTML参数的水印添加请求。否则,如果不需要添加水印,终端直接加载第一网页数据,显示用户访问的网页内容。

[0148] 具体的,如果需要在网页中添加水印,实施例可以在网页中页面的底部引入水印适配器组件,该水印适配器组件可以具体为水印适配器脚本,这样通过执行水印适配器脚本,可以确定该网页需要添加水印,并向水印服务器发送水印添加请求。

[0149] 在步骤S440中,接收水印服务器发送的第二网页数据,显示带有水印的目标网页。

[0150] 实施例中,水印服务器通过接收终端发送的向水印服务器发送水印添加请求,如果向水印服务器发送水印添加请求包括HTML文本,可以通过修改HTML文本的代码,基于水印配置信息执行水印添加操作,生成第二网页数据。而如果向水印服务器发送水印添加请求包括HTML相关参数,即目标HTML相关参数,可以通过预设的HTML模板,在预设的HTML模板中注入水印代码,生成第二网页数据。这样终端通过接收水印服务器发送的第二网页数据,并加载该第二网页数据,可以显示带有水印的目标网页。其中,可以基于用户信息和水印模板生成水印代码,该用户信息可以是和用户相关的信息,例如用户名称或者用户的操作时间等信息,实施例不限于此。另外,该水印模板可以是用户预先设定的,比如水印的大小、颜色或者透明度等。

[0151] 本公开实施例提供的网页水印添加方法,在接收到用户针对目标网站的访问操作的情况下,向目标网站对应的目标网站服务器发送访问请求;接收目标网站服务器发送的第一网页数据;通过向水印服务器发送水印添加请求,该水印添加请求用于请求在目标网页上添加水印。并接收水印服务器发送的第二网页数据,基于第二网页数据,显示带有水印的目标网页。这样无需发布新的版本就可以通过水印服务器对业务系统的前端网页添加水印,能够避免直接在业务系统的前端网页进行代码修改带来的无法及时添加水印的问题,并且还可以避免在没有网页访问权限时通过代理服务器无法对网页添加水印的问题,进而可以在很大程度上提高网页水印的添加效率。

[0152] 基于上述实施例,在本公开提供的又一实施例中,上述第一网页数据可以包括水印适配器脚本,第一网页数据还包括目标HTML文本或目标HTML参数;上述步骤S430具体还可以包括以下步骤:

[0153] 步骤S431,获取水印配置信息,并基于目标HTML文本或目标HTML参数,以及所述水印配置信息,生成水印添加请求。

[0154] 实施例中,在所述第一网页数据包括目标HTML参数的情况下,该水印配置信息可以包括HTML模板的模板标识,另外还可以包括水印内容和水印样式,实施例不限于此。以便水印服务器可以通过该模板标识获取对应的HTML模板,通过将目标HTML参数等注入到HTML模板中,实现添加水印的目的。

[0155] 或者,实施例中,在所述第一网页数据包括目标HTML文本的情况下,该水印配置信息可以包括水印内容和水印样式,但不包含HTML模板的模板标识。

[0156] 实施例中,水印配置信息还可以包括用户预先配置的相关信息,例如可以包括需要显示的水印内容,该水印配置信息可以包括用户信息或者当前时间的时间戳等内容。如果该水印配置信息包括用户信息,那么添加水印后的网页会将该用户信息作为水印添加到网页中,如果该水印配置信息还包括当前时间的时间戳,那么添加水印后的网页会包含用户信息和当前时间的时间戳的水印。

[0157] 实施例中,可以生成包含目标HTML文本或目标HTML参数,以及水印配置信息的水印添加请求。

[0158] 步骤S432,通过水印适配器脚本向水印服务器水印添加请求。

[0159] 实施例中,水印适配器脚本,可以使用<script>标签的方式,在第一网页数据的页面最底部引入水印适配器脚本,确保水印适配器是最后一个执行的脚本,以便获取完整的业务页面。

[0160] 实施例中,对于一些安全性较高的网站,通常需要在网页上添加水印,这时目标网站服务器会在HTML文本或者HTML相关参数中添加水印适配器脚本,得到第一网页数据,这样终端在对接收到的第一网页数据解析过程中,如果第一网页数据中包含水印适配器脚本,通过执行该水印适配器脚本,会向水印服务器发送水印添加请求,实现通过水印服务器对网页添加水印的目的。

[0161] 基于上述实施例,在本公开提供的又一实施例中,在接收到水印服务器发送的第二网页数据的情况下,可以将第二网页数据的第一水印适配标识修改为第二水印适配标识;其中,第一水印适配标识表示网页数据未包含水印信息,第二水印适配标识表示网页数据已包含水印信息。

[0162] 实施例中,在接收到水印服务器的响应后,即接收到水印服务器发送的添加水印后的页面代码后,水印适配器脚本会修改水印适配标识,这样可以防止对返回后的页面即HTML代码进行二次水印添加。示例性的,可以用"0”表示未添加水印信息,用户"1”表示已添加水印信息,实施例不限于此。

[0163] 基于上述实施例,在本公开提供的又一实施例中,该方法还可以包括以下步骤:

[0164] 在步骤S450中,获取第二网页数据中的水印适配标识。

[0165] 基于水印适配标识,在确定第二网页数据包含水印信息的情况下,执步骤S440。

[0166] 或者,基于水印适配标识,在确定第二网页数据未包含水印信息的情况下,执行步骤S430。

[0167] 实施例中,终端在同一时间段内可能会获取到多个网页数据,为了确定接收到的网页数据是否已经包含水印信息,可以通过网页对应的水印适配标识进行判断。这样可以在通过水印适配标识,在确定接收到的网页数据中包含水印信息时,可以加载该网页数据;而如果接收到的网页数据中不包含水印信息,还需要通过水印服务器进行添加水印处理。例如,水印适配标识可以通过"0”或"1”表示,可以用"0”表示未添加水印信息,用户"1”表示已添加水印信息,这样可以及时确定接收到的第二网页数据是否已经包含水印信息。

[0168] 在本公开提供的实施例中,上述第一网页数据包括目标HTML文本或目标HTML参数。例如,对于自研系统,目标网站服务器可以向终端返回HTML原始页面,例如HTML文本。而对于非自研无源码或无修改授权的系统,目标网站服务器一般不会返回HTML原始页面,但可以返回HTML相关参数。

[0169] 实施例中,在第一网页数据包括目标HTML文本时,水印配置信息可以包括用户的用户信息。这样便于水印服务器通过修改目标HTML文本的代码,通过用户信息进行水印添加,以生成第二网页数据。

[0170] 在第一网页数据包括目标HTML参数时,水印配置信息包括HTML模板标识和用户的用户信息。这样水印服务器可以根据模板标识确定出目标HTML模板,基于用户信息和水印模板生成水印代码,并向目标HTML模板中注入水印代码和目标HTML参数,以生成第二网页数据。

[0171] 基于上述实施例,在本公开提供的又一实施例中,如图5所示,还提供一种网页水印添加方法,该方法可以应用于水印服务器,该方法可以包括以下步骤:

[0172] 在步骤S510中,接收终端发送的水印添加请求。

[0173] 其中,该水印添加请求用于请求在目标网页上添加水印。

[0174] 实施例中,该水印添加请求可以包括目标HTML参数或者目标HTML文本,以及水印配置信息。该水印配置信息可以包括用户信息,或者包括一些用户设定的相关信息等。

[0175] 例如,在水印添加请求包括目标HTML文本时,水印配置信息可以包括用户的用户信息。在水印添加请求包括目标HTML参数时,水印配置信息包括HTML模板的模板标识和用户的用户信息。该目标HTML参数可以包括用户要访问的文档ID或者文档的URL等,实施例不限于此。

[0176] 在步骤S520中,基于水印添加请求,生成第二网页数据,并向终端发送第二网页数据。

[0177] 其中,第二网页数据用于生成带有水印的目标网页。

[0178] 实施例中,水印服务器可以根据接收到的水印添加请求添加水印,这样可以得到第二网页数据,水印服务器通过向终端发送该第二网页数据,这样终端可以加载该第二网页数据,可以实现向用户显示包含水印的网页内容。通过水印服务器对网页添加水印,可以避免通过直接在业务系统的前端网页进行代码修改带来的水印无法及时添加的问题,并且还可以避免因使用代理服务器带来的没有网页访问权限的问题,进而可以在很大程度上提高网页水印的添加效率。

[0179] 基于上述实施例,在本公开提供的又一实施例中,水印添加请求包括水印配置信息和目标HTML参数,水印配置信息包括模板标识;上述步骤S520具体还可以包括以下步骤:

[0180] 步骤S521,基于模板标识获取预设HTML模板。

[0181] 步骤S522,基于目标HTML参数、水印配置信息和预设HTML模板,生成第二网页数据。

[0182] 实施例中,水印服务器可以预先配置多个或者多种HTML模板,这样可以通过模板标识确定出目标HTML模板,并通过水印配置信息在目标HTML模板中添加水印信息,以及将目标HTML参数添加到目标HTML模板,得到第二网页数据。

[0183] 具体的,实施例中,水印配置信息还可以包括用户信息,这样可以获取预设水印模板,并基于预设水印模板和用户信息生成水印代码。将水印代码注入到预设HTML模板的预设位置,并通过水印服务器中的目标接口将目标HTML参数注入到预设HTML模板,得到第二网页数据。

[0184] 实施例中,可以基于用户信息和水印模板生成水印代码,并根据HTML模板的模板ID读取对应的目标HTML模板,并传入目标HTML参数等参数,并根据预先配置的水印模板,注入水印代码到目标HTML模板中。通过返回完整的HTML代码给终端中的浏览器,浏览器通过渲染接收到的完整的HTML代码,完成在网页中动态添加水印的效果。

[0185] 基于上述实施例,在本公开提供的又一实施例中,水印添加请求包括目标HTML文本和水印配置信息;上述步骤S520具体还可以包括以下步骤:

[0186] 步骤S523,获取预设水印模板,并基于预设水印模板和水印配置信息生成水印代码。

[0187] 步骤S524,将水印代码注入到目标HTML文本,得到第二网页数据。

[0188] 实施例中,可以通过预设水印模板和水印配置信息,获得水印代码。这样水印服务器可以修改目标HTML文本的代码,将水印代码注入到目标HTML文本,生成第二网页数据。

[0189] 本公开提供的实施例中,在水印服务器具有修改页面代码的权限的情况下,可以通过修改页面代码来添加水印;而如果水印服务器没有修改页面代码的权限,可以通过预先设置的HTML模板,比如将目标HTML文本和水印配置信息注入到该HTML模板中,将得到的包含水印信息的HTML发送给终端进行渲染显示,实现在页面中添加水印的目的。

[0190] 在采用对应各个功能划分各个功能模块的情况下,本公开实施例提供了一种网页水印添加装置,该网页水印添加装置可以位终端。图6为本公开一示例性实施例提供的网页水印添加装置的功能模块示意性框图。如图6所示,该网页水印添加装置包括:

[0191] 访问请求发送模块101,用于在接收到用户针对目标网站的访问操作的情况下,向所述目标网站对应的目标网站服务器发送访问请求;

[0192] 第一网页数据接收模块102,用于接收所述目标网站服务器发送的第一网页数据,所述第一网页数据用于生成目标网页;

[0193] 水印添加请求发送模块103,用于向水印服务器发送水印添加请求,所述水印添加请求用于请求在所述目标网页上添加水印;

[0194] 第二网页数据接收模块104,用于接收所述水印服务器发送的第二网页数据,所述第二网页数据用于生成带有水印的目标网页;

[0195] 目标网页显示模块105,用于基于所述第二网页数据,显示带有水印的目标网页。

[0196] 在本公开提供的又一实施例中,所述第一网页数据包括水印适配器脚本;所述水印添加请求发送模块,具体用于:

[0197] 获取水印配置信息,并基于所述目标HTML文本或所述目标HTML参数,以及所述水印配置信息,生成水印添加请求;

[0198] 通过所述水印适配器脚本向水印服务器发送所述水印添加请求。

[0199] 在本公开提供的又一实施例中,在所述第一网页数据包括目标HTML参数的情况下,所述水印配置信息包括HTML模板的模板标识;

[0200] 或者,在所述第一网页数据包括目标HTML文本的情况下,所述水印配置信息包括水印内容和水印样式。

[0201] 在本公开提供的又一实施例中,所述装置还包括:

[0202] 水印适配标识修改模块,用于在接收到所述水印服务器发送的第二网页数据的情况下,将所述第二网页数据的第一水印适配标识修改为第二水印适配标识;其中,所述第一水印适配标识表示网页数据未包含水印信息,所述第二水印适配标识表示网页数据已包含水印信息。

[0203] 本公开实施例提供的网页水印添加装置,在接收到用户针对目标网站的访问操作的情况下,向目标网站对应的目标网站服务器发送访问请求;接收目标网站服务器发送的第一网页数据;向水印服务器发送水印添加请求,水印添加请求用于请求在目标网页上添加水印;接收水印服务器发送的第二网页数据;基于第二网页数据,显示带有水印的目标网页。这样无需发布新的版本就可以通过水印服务器对业务系统的前端网页添加水印,能够避免直接在业务系统的前端网页进行代码修改带来的水印无法及时修改的问题,并且还可以避免在没有网页访问权限时通过代理服务器无法对网页添加水印的问题,进而可以在很大程度上提高网页水印的添加效率。

[0204] 在采用对应各个功能划分各个功能模块的情况下,本公开实施例提供了一种网页水印添加装置,该网页水印添加装置可以位于水印服务器。图7为本公开一示例性实施例提供的网页水印添加装置的功能模块示意性框图。如图7所示,该网页水印添加装置包括:

[0205] 水印添加请求接收模块201,用于接收终端发送的水印添加请求,所述水印添加请求用于请求在目标网页上添加水印;

[0206] 第二网页数据生成模块202,用于基于所述水印添加请求,生成第二网页数据;

[0207] 第二网页数据发送模块203,用于向所述终端发送所述第二网页数据,所述第二网页数据用于生成带有水印的目标网页。

[0208] 在本公开提供的又一实施例中,所述第一网页数据包括目标HTML参数,所述水印配置信息包括水印添加请求包括水印配置信息和模板标识;所述第二网页数据生成模块,具体用于:

[0209] 基于所述模板标识获取预设HTML模板;

[0210] 基于所述目标HTML参数、所述水印配置信息和所述预设HTML模板,生成第二网页数据。

[0211] 在本公开提供的又一实施例中,所述水印配置信息还包括用户信息;所述第二网页数据生成模块,具体还用于:

[0212] 获取预设水印模板,并基于所述预设水印模板和所述用户信息生成水印代码;

[0213] 将所述水印代码注入到所述预设HTML模板的预设位置,并通过所述水印服务器中的目标接口将所述目标HTML参数注入到所述预设HTML模板,得到第二网页数据。

[0214] 在本公开提供的又一实施例中,所述水印添加请求包括目标HTML文本和水印配置信息;所述第二网页数据生成模块,具体还用于:

[0215] 获取预设水印模板,并基于所述预设水印模板和所述水印配置信息生成水印代码;

[0216] 将所述水印代码注入到所述目标HTML文本,得到第二网页数据。

[0217] 实施例中,水印服务器可以根据接收到的水印添加请求,在目标网页上添加水印,这样可以得到第二网页数据,通过向终端发送该第二网页数据,终端可以显示带有水印的目标网页。这样无需发布新的版本就可以通过水印服务器对前端的网页添加水印,能够避免直接在前端网页进行代码修改带来的水印无法及时添加的问题,并且还可以避免在没有网页访问权限时通过代理服务器无法对网页添加水印的问题,进而可以在很大程度上提高网页水印的添加效率。

[0218] 本公开实施例还提供一种终端,包括:显示器和至少一个处理器;其中,该显示器用于显示网页,该至少一个处理器与该显示器连接;该终端还包括用于存储所述至少一个处理器可执行指令的存储器,该至少一个处理器被配置为执行所述指令,可以实现上述实施例中终端侧的网页水印添加方法。

[0219] 本公开实施例还提供一种服务器,包括:至少一个处理器;用于存储所述至少一个处理器可执行指令的存储器;其中,该服务器具体可以包括上述水印服务器,所述至少一个处理器被配置为执行所述指令,可以实现上述水印服务器侧的网页水印添加方法。

[0220] 图8为本公开一示例性实施例提供的服务器的结构示意图。如图8所示,该服务器1800包括至少一个处理器1801以及耦接至处理器1801的存储器1802,该处理器1801可以执行本公开实施例公开的上述方法中的相应步骤。

[0221] 上述处理器1801还可以称为中央处理单元(central processing unit,CPU),其可以是一种集成电路芯片,具有信号的处理能力。本公开实施例公开的上述方法中的各步骤可以通过处理器1801中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1801可以是通用处理器、数字信号处理器(digital signal processing,DSP)、ASIC(Application Specific Integrated Circuit,专用集成电路)、现成可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本公开实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储器1802中,例如随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质。处理器1801读取存储器1802中的信息,结合其硬件完成上述方法的步骤。

[0222] 另外,根据本公开的各种操作 / 处理在通过软件和 / 或固件实现的情况下,可从存储介质或网络向具有专用硬件结构的计算机系统,例如图9所示的计算机系统1900安装构成该软件的程序,该计算机系统在安装有各种程序时,能够执行各种功能,包括诸如前文所述的功能等等。图9为本公开一示例性实施例提供的计算机系统的结构框图。

[0223] 计算机系统1900旨在表示各种形式的数字电子的计算机设备,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和 / 或者要求的本公开的实现。

[0224] 如图9所示,计算机系统1900包括计算单元1901,该计算单元1901可以根据存储在只读存储器(ROM)1902中的计算机程序或者从存储单元1908加载到随机存取存储器(RAM)1903中的计算机程序,来执行各种适当的动作和处理。在RAM 1903中,还可存储计算机系统1900操作所需的各种程序和数据。计算单元1901、ROM 1902以及RAM 1903通过总线1904彼此相连。输入 / 输出(I / O)接口1905也连接至总线1904。

[0225] 计算机系统1900中的多个部件连接至I / O接口1905,包括:输入单元1906、输出单元1907、存储单元1908以及通信单元1909。输入单元1906可以是能向计算机系统1900输入信息的任何类型的设备,输入单元1906可以接收输入的数字或字符信息,以及产生与服务器的用户设置和 / 或功能控制有关的键信号输入。输出单元1907可以是能呈现信息的任何类型的设备,并且可以包括但不限于显示器、扬声器、视频 / 音频输出终端、振动器和 / 或打印机。存储单元1908可以包括但不限于磁盘、光盘。通信单元1909允许计算机系统1900通过网络诸如因特网的与其他设备交换信息 / 数据,并且可以包括但不限于调制解调器、网卡、红外通信设备、无线通信收发机和 / 或芯片组,例如蓝牙TM设备、WiFi设备、WiMax设备、蜂窝通信设备和 / 或类似物。

[0226] 计算单元1901可以是各种具有处理和计算能力的通用和 / 或专用处理组件。计算单元1901的一些示例包括但不限于中央处理单元(CPU)、图形处理单元(GPU)、各种专用的人工智能(AI)计算芯片、各种运行机器学习模型算法的计算单元、数字信号处理器(DSP)、以及任何适当的处理器、控制器、微控制器等。计算单元1901执行上文所描述的各个方法和处理。例如,在一些实施例中,本公开实施例公开的上述方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元1908。在一些实施例中,计算机程序的部分或者全部可以经由ROM 1902和 / 或通信单元1909而被载入和 / 或安装到服务器上。在一些实施例中,计算单元1901可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行本公开实施例公开的上述方法。

[0227] 本公开实施例还提供一种计算机可读存储介质,其中,当所述计算机可读存储介质中的指令由上述终端或服务器的处理器执行时,使得所述上述终端或服务器能够分别执行本公开实施例公开的上述方法。

[0228] 本公开实施例中的计算机可读存储介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。上述计算机可读存储介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。更具体的,上述计算机可读存储介质可以包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。

[0229] 上述计算机可读介质可以是上述终端或服务器中所包含的;也可以是单独存在,而未装配入上述终端或服务器中。

[0230] 本公开实施例还提供一种计算机程序产品,包括计算机程序,其中,所述计算机程序被处理器执行时实现本公开实施例公开的上述方法。

[0231] 在本公开的实施例中,可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言,诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言,诸如"C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络(包括局域网(LAN)或广域网(WAN))连接到用户计算机,或者,可以连接到外部计算机。

[0232] 附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和 / 或流程图中的每个方框、以及框图和 / 或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。

[0233] 描述于本公开实施例中所涉及到的模块、部件或单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块、部件或单元的名称在某种情况下并不构成对该模块、部件或单元本身的限定。

[0234] 本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示例性的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。

[0235] 以上描述仅为本公开的一些实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。

[0236] 虽然已经通过示例对本公开的一些特定实施例进行了详细说明,但是本领域的技术人员应该理解,以上示例仅是为了进行说明,而不是为了限制本公开的范围。本领域的技术人员应该理解,可在不脱离本公开的范围和精神的情况下,对以上实施例进行修改。本公开的范围由所附权利要求来限定。< / script>

Claims

1. A method for adding watermarks to a web page, characterized in that: Applied to a terminal, the method comprises: When receiving an access operation of a user to a target website, sending an access request to a target website server corresponding to the target website; Receiving first web page data sent by the target website server, wherein the first web page data is used to generate a target web page; Sending a watermark adding request to a watermark server, wherein the watermark adding request is used to request adding a watermark to the target web page; receiving second web page data sent by the watermark server, wherein the second web page data is used to generate a target web page with a watermark; Based on the second web page data, a target web page with a watermark is displayed.

2. The method according to claim 1, characterized in that The first web page data includes a watermark adapter script, and the first web page data also includes a target HTML text or a target HTML parameter; sending a watermark adding request to the watermark server includes: Acquire watermark configuration information sent by the user, and generate a watermark adding request based on the target HTML text or the target HTML parameter and the watermark configuration information; The watermark adding request is sent to the watermark server through the watermark adapter script.

3. The method according to claim 2, characterized in that In the case where the first web page data includes a target HTML parameter, the watermark configuration information includes a template identifier of an HTML template; Alternatively, in the case where the first web page data includes target HTML text, the watermark configuration information includes watermark content and watermark style.

4. The method according to claim 1, characterized in that: The method further comprises: The first watermark adaptation identifier of the second web page data is modified to a second watermark adaptation identifier; wherein the first watermark adaptation identifier indicates that the web page data does not contain watermark information, and the second watermark adaptation identifier indicates that the web page data already contains watermark information.

5. A method for adding watermarks to a web page, characterized in that: Applied to a watermark server, the method comprises: receiving a watermark adding request sent by a terminal, wherein the watermark adding request is used to request adding a watermark to a target web page; Based on the watermark adding request, second web page data is generated and sent to the terminal, where the second web page data is used to generate a target web page with a watermark.

6. The method according to claim 5, characterized in that The watermark adding request includes watermark configuration information and target HTML parameters, and the watermark configuration information includes a template identifier; and generating second web page data based on the watermark adding request includes: Acquire a preset HTML template based on the template identifier; Based on the target HTML parameters, the watermark configuration information and the preset HTML template, second webpage data is generated.

7. The method according to claim 6, characterized in that The watermark configuration information also includes user information; the generating of the second webpage data based on the target HTML parameter, the watermark configuration information and the preset HTML template includes: Obtaining a preset watermark template, and generating a watermark code based on the preset watermark template and the user information; The watermark code is injected into a preset position of the preset HTML template, and the target HTML parameter is injected into the preset HTML template through a target interface in the watermark server to obtain second web page data.

8. The method according to claim 5, characterized in that The watermark adding request includes a target HTML text and watermark configuration information; and the generating the second webpage data based on the watermark adding request includes: Obtaining a preset watermark template, and generating a watermark code based on the preset watermark template and the watermark configuration information; The watermark code is injected into the target HTML text to obtain second web page data.

9. A terminal, characterized in that: include: A display, for displaying web pages; at least one processor connected to the display; a memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method as claimed in any one of claims 1 to 4.

10. A server, characterized in that: include: at least one processor; a memory for storing the at least one processor-executable instruction; The at least one processor is configured to execute the instructions to implement the method as described in any one of claims 5-8.