Method and device for drawing webpage with watermark based on browser rendering engine
By acquiring and synthesizing web page layers, the tamper-proof and printing functions of web page watermarks are realized based on the browser rendering engine, and the problem of lack of a web page watermark implementation method for providing printing services in the prior art is solved.
Patent Information
- Application Number
- CN202411213645.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art lacks a web page watermark implementation method that can avoid repeated development under the premise of providing printing services.
By obtaining web page drawing parameters, including watermark configuration information and web page element information, web page drawing based on the browser rendering engine, the first and second web page layers are obtained, and the target web page is synthesized according to the web page configuration parameters for display.
It realizes the tamper-proof of watermarks on the web page itself and supports web page printing, avoiding the problem of repeated development.
Smart Images

Figure CN119440692A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of web page drawing, and in particular to a method, device, computer-readable storage medium and business system for drawing a watermarked web page based on a browser rendering engine. Background Art
[0002] With the continuous development of information technology, enterprises are increasingly relying on public or internal websites to publish information and handle business. While browsers can easily access a large amount of information, there is also the risk of storing and disseminating sensitive information on web pages by taking photos, screenshots, printing, etc. Web watermarks are visible or invisible marks covering the top of web pages. These marks can be associated with specific accounts, devices, and timestamps, thereby helping to trace leaks.
[0003] The prior art mainly includes front-end implementation, server implementation and client implementation, wherein the front-end implementation is developed according to different server needs. When there are multiple websites displaying watermarks, each website needs to be adapted separately, resulting in the problem of repeated development. Since the debugging tool provided by the browser can check and edit the web page DOM tree, people with a certain technical background can use the browser debugging tool to easily tamper with, hide, and delete the web page watermark, resulting in the problem of easy tampering; the server implementation processes the web page content into a picture with a watermark, which consumes a lot of server resources and bandwidth, and has a limited scope of application. Each web page can only control the watermark content of this web page, and cannot control the watermark content of other web pages. Assuming that an enterprise employee visits website A with a web page watermark, and jumps to website B that does not support web page watermarks through website A, the content of website B is not protected by the watermark of website A, resulting in a narrow scope problem; the client implementation implements web page watermarks by creating a window, avoiding the problems of repeated development and easy tampering, but due to the separation of the web page and the watermark, there is a problem that the watermark cannot be printed.
[0004] Therefore, the prior art lacks a method for implementing webpage watermarks that can provide printing services and avoid repeated development. Summary of the invention
[0005] The main purpose of the present application is to provide a method, device, computer-readable storage medium and business system for drawing a watermarked web page based on a browser rendering engine, so as to at least solve the problem in the prior art of lacking a web page watermark implementation method that can provide printing services and avoid repeated development.
[0006] To achieve the above-mentioned purpose, according to one aspect of the present application, a method for drawing a web page with a watermark based on a browser rendering engine is provided, comprising: obtaining web page drawing parameters, wherein the web page drawing parameters at least include watermark configuration information and web page element information, wherein the watermark configuration information at least includes a watermark scope and a watermark configuration parameter, wherein the watermark scope includes a web page scope and a global scope; drawing a web page based on a layering rule based on the rendering engine according to a plurality of the web page element information to obtain a plurality of first web page layers, and drawing a web page based on the rendering engine according to the watermark configuration information to obtain a second web page layer; obtaining web page configuration parameters, wherein the web page configuration parameters at least include a first identification information, a second identification information information, third identification information and fourth identification information, wherein the first identification information is used to indicate whether a watermark configuration exists on the current web page, the second identification information is used to indicate whether a drawn layer exists on the current web page, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether a watermark scope configuration exists on the current web page; when the first identification information indicates that the watermark configuration exists on the current web page and the third identification information indicates that the web page drawing parameters of the current web page have not changed, a target web page is obtained by synthesizing the first web page layer and the second web page layer, and the target web page is displayed on a display screen.
[0007] Optionally, after obtaining the web page configuration parameters, the method further includes: when the first identification information indicates that the watermark configuration does not exist on the current web page and the second identification information indicates that the drawn layer exists on the current web page, deleting the drawn layer and changing the second identification information; when the first identification information indicates that the watermark configuration does not exist on the current web page and the second identification information indicates that the drawn layer does not exist on the current web page, synthesizing the first web page layer and the second web page layer to obtain the target web page, and displaying the target web page through a display screen.
[0008] Optionally, after obtaining the web page configuration parameters, the method further includes: when the first identification information indicates that the watermark configuration exists in the current web page, the third identification information indicates that the web page drawing parameters of the current web page have changed, and the fourth identification information indicates that a watermark scope configuration exists in the current web page and the watermark scope corresponding to the watermark scope configuration is the web page scope, updating the watermark scope corresponding to the current web page to the watermark configuration parameters of the web page scope and redrawing the second web page layer; synthesizing the redrawn second web page layer and the first web page layer to obtain the target web page, and displaying the target web page through a display screen.
[0009] Optionally, after obtaining the web page configuration parameters, the method includes: when the first identification information indicates that the watermark configuration exists in the current web page, the third identification information indicates that the web page drawing parameters of the current web page have changed, and the fourth identification information indicates that a watermark scope configuration exists in the current web page and the watermark scope corresponding to the watermark scope configuration is the global scope, updating the watermark scope corresponding to the current web page to the watermark configuration parameters of the global scope and redrawing the second web page layer; synthesizing the redrawn second web page layer and the first web page layer to obtain the target web page, and displaying the target web page through a display screen.
[0010] Optionally, before obtaining the web page configuration parameters, the method also includes: when receiving the first target signaling, creating a browser process, reading a browser configuration file based on the browser process, and obtaining fifth identification information, the first target signaling is used to request to start the browser, and the fifth identification information is used to characterize whether the current browser has the watermark configuration parameters whose watermark scope is the global scope; when the fifth flag information indicates that the watermark configuration parameters whose watermark scope is the global scope exist, updating the web page configuration parameters and the web page drawing parameters through the browser process according to the watermark configuration parameters in the configuration file; when the fifth flag information indicates that the watermark configuration parameters whose watermark scope is the global scope do not exist, updating the web page configuration parameters and the web page drawing parameters according to preset parameters.
[0011] Optionally, before obtaining the web page configuration parameters, the method further includes: in the case of receiving the second target signaling, controlling the browser process to create a web page management process; controlling the web page management process to read the META tag of the current web page, parsing the META tag to obtain sixth identification information and seventh identification information, the sixth identification information being used to characterize whether the watermark configuration information exists in the META tag, and the seventh identification information being used to characterize the watermark configuration information; in the case where the sixth identification information indicates that the watermark configuration information does not exist in the META tag, controlling the web page management process to obtain the watermark configuration information from the web page management process The watermark configuration parameters whose scope is the global scope are used to update the web page configuration parameters and the web page drawing parameters; when the sixth identification information is that the watermark configuration information exists in the META tag, the watermark scope is determined according to the seventh identification information; when the watermark scope is the global scope, an authentication operation is performed on the current web page, and when the authentication operation passes, the web page configuration parameters and the web page drawing parameters are updated according to the seventh identification information; when the watermark scope is the web page scope, the web page configuration parameters and the web page drawing parameters are updated according to the seventh identification information.
[0012] Optionally, before obtaining the web page configuration parameters, the method also includes: calling a JS interface to obtain the watermark configuration information, and determining the corresponding watermark scope according to the watermark configuration information; when the watermark scope is the global scope, performing an authentication operation on the current web page, and when the authentication operation passes, updating the web page configuration parameters and the web page drawing parameters according to the watermark configuration information; when the watermark scope is the web page scope, updating the web page configuration parameters and the web page drawing parameters according to the watermark configuration information.
[0013] According to another aspect of the present application, a device for drawing a web page with a watermark based on a browser rendering engine is provided, the device comprising: a first acquisition unit, used to acquire web page drawing parameters, the web page drawing parameters at least comprising watermark configuration information and web page element information, the watermark configuration information at least comprising a watermark scope and a watermark configuration parameter, the watermark scope comprising a web page scope and a global scope; a drawing unit, used to draw a web page based on a layering rule based on the rendering engine according to a plurality of the web page element information, to obtain a plurality of first web page layers, and to draw a web page based on the rendering engine according to the watermark configuration information to obtain a second web page layer; a second acquisition unit, used to acquire web page configuration parameters, the web page configuration parameters at least comprising a first identification information , second identification information, third identification information and fourth identification information, wherein the first identification information is used to indicate whether a watermark configuration exists on the current web page, the second identification information is used to indicate whether a drawn layer exists on the current web page, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether a watermark scope configuration exists on the current web page; a first processing unit is used to synthesize a target web page according to the first web page layer and the second web page layer when the first identification information indicates that the watermark configuration exists on the current web page and the third identification information indicates that the web page drawing parameters of the current web page have not changed, and display the target web page on a display screen.
[0014] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.
[0015] According to another aspect of the present application, a business system is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include means for executing any one of the methods described.
[0016] By applying the technical solution of the present application, in the above-mentioned method for drawing a watermarked web page based on a browser rendering engine, first, web page drawing parameters are obtained, the above-mentioned web page drawing parameters at least include watermark configuration information and web page element information, the above-mentioned watermark configuration information at least includes watermark scope and watermark configuration parameters, and the above-mentioned watermark scope includes web page scope and global scope; then, according to the above-mentioned web page element information, web page drawing is performed based on the above-mentioned rendering engine based on the layering rule to obtain multiple first web page layers, and according to the above-mentioned watermark configuration information, web page drawing is performed based on the above-mentioned rendering engine to obtain a second web page layer; then, web page configuration parameters are obtained, the above-mentioned web page configuration parameters at least include first identification information, second identification information, ... Three identification information and fourth identification information, the first identification information is used to indicate whether there is a watermark configuration on the current web page, the second identification information is used to indicate whether there is a drawn layer on the current web page, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether there is a watermark scope configuration on the current web page; finally, when the first identification information indicates that there is a watermark configuration on the current web page and the third identification information indicates that the web page drawing parameters of the current web page have not changed, the target web page is obtained by synthesizing the first web page layer and the second web page layer, and the target web page is displayed on the display screen. The present application determines the properties and configuration of the watermark and the element configuration of the web page through the web page drawing parameters, draws the web page elements and watermarks respectively based on the web page drawing parameters, and then synthesizes and displays the drawing results according to the web page configuration parameters of the target web page. This method ensures that the watermark is on the web page itself, and solves the problem in the prior art that there is a lack of a web page watermark implementation method that can provide printing services and avoid repeated development. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A hardware structure block diagram of a mobile terminal according to a method for drawing a web page with a watermark based on a browser rendering engine provided in an embodiment of the present application is shown;
[0018] Figure 2 A schematic diagram of a process of drawing a watermarked web page based on a browser rendering engine according to an embodiment of the present application is shown;
[0019] Figure 3 A schematic diagram of a process of drawing a web page using a browser rendering engine provided in an embodiment of the present application is shown;
[0020] Figure 4 A schematic diagram of a process of updating watermark configuration parameters through a browser according to an embodiment of the present application is shown;
[0021] Figure 5A schematic diagram of a process for updating watermark configuration parameters through a page META tag according to an embodiment of the present application is shown;
[0022] Figure 6 A structural block diagram of a watermarked web page drawing device based on a browser rendering engine provided according to an embodiment of the present application is shown.
[0023] The above drawings include the following reference numerals:
[0024] 102, processor; 104, memory; 106, transmission device; 108, input and output devices. DETAILED DESCRIPTION
[0025] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] Glossary:
[0029] Web watermark: A web watermark is a visible or invisible mark that covers the top of a web page. These marks can be associated with specific accounts, devices, and timestamps to help trace the source of leaks.
[0030] Rendering engine: A collection of programs in the browser client that is responsible for layering, drawing, and synthesizing web page content.
[0031] Web page layers: When drawing a web page, the browser rendering engine sets a series of layering rules based on the position, hierarchy, CSS properties and other relevant conditions of the web page elements. The web page elements are divided into multiple web page layers according to the layering rules, and each web page layer is drawn separately. There is a strict hierarchical order between web page layers.
[0032] Synthesis: The process by which the browser rendering engine draws the web page layer drawing results layer by layer to the target interface according to the hierarchical order of the web page layers. The target interface can be the screen, memory area, or GPU texture.
[0033] Watermark configuration parameters: a string describing how to draw a watermark, including watermark text, watermark starting point coordinates, watermark spacing, watermark rotation angle, watermark font size, watermark font, watermark color and other properties.
[0034] Configuration file: contains the setting parameters required for the browser to start and run.
[0035] META tag: A web page tag used to describe the properties of an HTML web page document. The standard HTML META tag has "name" and "content" attributes.
[0036] Watermark scope: The scope in which the watermark configuration takes effect, including the web page scope and the global scope.
[0037] Web page scope: The watermark configuration is only effective on the current web page.
[0038] Global scope: The watermark configuration takes effect on all web pages of the browser client.
[0039] As introduced in the background technology, the prior art lacks a method for implementing web page watermarks that can avoid repeated development under the premise of providing printing services. In order to solve the problem that the prior art lacks a method for implementing web page watermarks that can avoid repeated development under the premise of providing printing services, the embodiments of the present application provide a watermarked web page drawing method, device, computer-readable storage medium and business system based on a browser rendering engine.
[0040] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0041] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a method for drawing a web page with a watermark based on a browser rendering engine according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0042] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the display method of device information in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific examples of the network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0043] In this embodiment, a method for drawing a watermarked web page based on a browser rendering engine running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0044] Figure 2 1 is a flow chart of a method for drawing a watermarked web page based on a browser rendering engine according to an embodiment of the present application. Figure 2As shown, the method comprises the following steps:
[0045] Step S201, obtaining web page rendering parameters, the web page rendering parameters at least including watermark configuration information and web page element information, the watermark configuration information at least including watermark scope and watermark configuration parameters, the watermark scope including web page scope and global scope;
[0046] Specifically, Figure 3 As shown, when the web page drawing process is triggered, first, the page elements stored in the browser are obtained and divided into multiple web page layers, that is, the above-mentioned web page element information is obtained, and then the above-mentioned watermark configuration parameters stored in the browser and the watermark scope corresponding to each of the above-mentioned configuration parameters are obtained to obtain the above-mentioned watermark configuration information.
[0047] Step S202, drawing a web page based on the layering rule based on the rendering engine according to the plurality of web page element information to obtain a plurality of first web page layers, and drawing a web page based on the rendering engine according to the watermark configuration information to obtain a second web page layer;
[0048] Specifically, Figure 3 As shown, based on each of the above web page layers, web page drawing is performed through a rendering engine to obtain the above first web page layer, and according to the above watermark configuration information, a web page layer is drawn based on the above rendering engine to obtain the above second web page layer.
[0049] Step S203, obtaining web page configuration parameters, the web page configuration parameters at least include first identification information, second identification information, third identification information and fourth identification information, the first identification information is used to indicate whether the current web page has a watermark configuration, the second identification information is used to indicate whether the current web page has a drawn layer, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether the current web page has a watermark scope configuration;
[0050] Specifically, Figure 3As shown, before generating a web page, first obtain the third identification information, traverse the first web page layers and the second web page layers, and then obtain the first identification information when it is determined that the web page drawing parameters have not changed. When the first identification information indicates that the current web page process does not include a watermark configuration, further obtain the second identification information, and determine whether the current web page process has a drawn layer, that is, a useless layer left behind, based on the second identification information. When the first identification information indicates that the current web page process does not include a watermark configuration, obtain whether the watermark configuration parameters have changed based on the third identification information. If they have changed, determine the scope of the watermark configured for the current web page process based on the fourth identification information, and then determine the corresponding watermark as the watermark of the current web page process based on the scope.
[0051] Step S204, when the first identification information indicates that the watermark configuration exists on the current web page and the web page drawing parameters from the third identification information to the current web page have not changed, the target web page is obtained by synthesizing the first web page layer and the second web page layer, and the target web page is displayed on the display screen.
[0052] Specifically, Figure 3 As shown, one situation is that after the above-mentioned first web page layer and the above-mentioned second web page layer are drawn, the above-mentioned first identification information is that the above-mentioned watermark configuration exists in the above-mentioned current web page and the above-mentioned to third identification information is that the above-mentioned web page drawing parameters of the above-mentioned current web page have not changed, that is, during the drawing process, the above-mentioned web page element information and the above-mentioned watermark configuration information have not changed, and the above-mentioned first web page layer and the above-mentioned second web page layer obtained by drawing are synthesized to obtain the target web page and displayed.
[0053] In the above embodiment, the web page watermark is implemented based on the browser rendering engine. The watermark belongs to the rendering tree, not the web page DOM tree. The watermark and the web page content are actually combined in the rendering and drawing synthesis process to realize the tamper-proof of the watermark, and the combined watermark can be printed during the web page printing process.
[0054] Through this embodiment, first, web page drawing parameters are obtained, the web page drawing parameters at least include watermark configuration information and web page element information, the watermark configuration information at least includes watermark scope and watermark configuration parameters, the watermark scope includes web page scope and global scope; then, web page drawing is performed based on the layering rule based on the rendering engine according to the plurality of web page element information, to obtain a plurality of first web page layers, and web page drawing is performed based on the rendering engine according to the watermark configuration information to obtain a second web page layer; then, web page configuration parameters are obtained, the web page configuration parameters at least include first identification information, second identification information, third identification information and fourth identification information, and the above The first identification information is used to indicate whether there is a watermark configuration on the current web page, the second identification information is used to indicate whether there is a drawn layer on the current web page, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether there is a watermark scope configuration on the current web page; finally, when the first identification information indicates that there is a watermark configuration on the current web page and the third identification information indicates that the web page drawing parameters of the current web page have not changed, the target web page is obtained by synthesizing the first web page layer and the second web page layer, and the target web page is displayed on the display screen. The present application determines the properties and configuration of the watermark and the element configuration of the web page through the web page drawing parameters, draws the web page elements and watermarks respectively based on the web page drawing parameters, and then synthesizes and displays the drawing results according to the web page configuration parameters of the target web page. This method ensures that the watermark is on the web page itself, and solves the problem in the prior art of lacking a web page watermark implementation method that can provide printing services and avoid repeated development.
[0055] In order to ensure that the target web page is correctly synthesized, in an optional implementation manner, after obtaining the web page configuration parameters, the method further includes:
[0056] Step S301, when the first identification information indicates that the watermark configuration does not exist on the current webpage and the second identification information indicates that the drawn layer exists on the current webpage, the drawn layer is deleted and the second identification information is changed;
[0057] Specifically, in another case, Figure 3 As shown, the first identification information is that the watermark configuration does not exist in the current web page and the second identification information is that the drawn layer exists in the current web page, that is, when the watermark configuration does not exist in the current web page process, it is determined that the watermark does not need to be changed, and further check whether the current web page process has the above-mentioned drawn layer left over. If the above-mentioned drawn layer exists, delete the layer and change the second identification information to that the above-mentioned drawn layer does not exist in the current web page.
[0058] Step S302, when the first identification information indicates that the watermark configuration does not exist on the current web page and the second identification information indicates that the drawn layer does not exist on the current web page, the target web page is obtained by synthesizing the first web page layer and the second web page layer, and the target web page is displayed on the display screen.
[0059] Specifically, Figure 3 As shown, when it is determined that the watermark does not need to be changed and the current web page process does not have the above-mentioned drawn layer left over, the above-mentioned first web page layer and the above-mentioned second web page layer obtained by drawing are synthesized to obtain the target web page and display it.
[0060] In order to ensure that the target web page is correctly synthesized, in an optional implementation manner, after obtaining the web page configuration parameters, the method further includes:
[0061] Step S303, when the first identification information indicates that the watermark configuration exists on the current webpage, the third identification information indicates that the webpage drawing parameters of the current webpage have changed, and the fourth identification information indicates that the watermark scope configuration exists on the current webpage and the watermark scope corresponding to the watermark scope configuration is the webpage scope, update the watermark configuration parameters of the watermark scope corresponding to the current webpage to the webpage scope and redraw the second webpage layer;
[0062] Specifically, Figure 3 As shown, in another situation, the first identification information is that the watermark configuration exists in the current web page, the third identification information is that the web page drawing parameters of the current web page have changed, and the fourth identification information is that a watermark scope configuration exists in the current web page and the watermark scope corresponding to the watermark scope configuration is the web page scope. That is, during the drawing process, it is determined that the watermark configuration information has changed, and then the watermark scope configured for the current web page process is determined according to the fourth identification information. When the watermark scope is the web page scope, redrawing is completed according to the watermark configuration parameters stored in the current web page process.
[0063] Step S304: synthesizing the redrawn second web page layer and the first web page layer to obtain the target web page, and displaying the target web page on a display screen.
[0064] Specifically, the target webpage is obtained by synthesizing the first webpage layer and the redrawn second webpage layer, and the target webpage is displayed on a display screen.
[0065] In order to ensure that the target web page is correctly synthesized, in an optional implementation manner, after obtaining the web page configuration parameters, the method further includes:
[0066] Step S304, when the first identification information indicates that the watermark configuration exists on the current webpage, the third identification information indicates that the webpage drawing parameters of the current webpage have changed, and the fourth identification information indicates that the watermark scope configuration exists on the current webpage and the watermark scope corresponding to the watermark scope configuration is the global scope, update the watermark configuration parameters of the global scope corresponding to the current webpage and redraw the second webpage layer;
[0067] Specifically, Figure 3 As shown, in another situation, the first identification information is that the watermark configuration exists in the current web page, the third identification information is that the web page drawing parameters of the current web page have changed, and the fourth identification information is that a watermark scope configuration exists in the current web page and the watermark scope corresponding to the watermark scope configuration is the web page scope. That is, during the drawing process, it is determined that the watermark configuration information has changed, and then the watermark scope configured for the current web page process is determined according to the fourth identification information. When the watermark scope is the global scope, redrawing is completed according to the watermark configuration parameters stored in the current web page process.
[0068] Step S305 , synthesizing the redrawn second web page layer and the first web page layer to obtain the target web page, and displaying the target web page on a display screen.
[0069] Specifically, the target webpage is obtained by synthesizing the first webpage layer and the redrawn second webpage layer, and the target webpage is displayed on a display screen.
[0070] In order to complete the update of the web page drawing parameters and the web page configuration parameters, in an optional implementation, before obtaining the web page configuration parameters, the method further includes:
[0071] Step S401, when receiving the first target signaling, creating a browser process, reading a browser configuration file based on the browser process, and obtaining fifth identification information, wherein the first target signaling is used to request to start the browser, and the fifth identification information is used to indicate whether the current browser has the watermark configuration parameter whose watermark scope is the global scope;
[0072] Specifically, Figure 4As shown, one configuration method is to configure the watermark scope as a global watermark configuration parameter through a browser. Specifically, after starting the browser client, the browser client creates the above browser process, and then reads the browser configuration file through the browser process to determine whether the configuration file includes a global watermark configuration.
[0073] Step S402, when the fifth flag information indicates that the watermark configuration parameter exists and the watermark scope is the global scope, updating the web page configuration parameter and the web page drawing parameter through the browser process according to the watermark configuration parameter in the configuration file;
[0074] Specifically, when the configuration file includes the globally effective watermark configuration, the watermark configuration parameters stored in the browser are updated according to the globally effective watermark configuration.
[0075] Step S403: when the fifth flag information indicates that the watermark configuration parameter whose watermark scope is the global scope does not exist, the webpage configuration parameter and the webpage drawing parameter are updated according to preset parameters.
[0076] Specifically, when the configuration file does not include the globally effective watermark configuration, the watermark configuration parameters stored in the browser are updated according to the default values as the globally effective watermark configuration.
[0077] In order to complete the update of the web page drawing parameters and the web page configuration parameters, in an optional implementation, before obtaining the web page configuration parameters, the method further includes:
[0078] Step S501, when receiving the second target signaling, controlling the browser process to create a webpage management process;
[0079] Specifically, Figure 5 As shown, another configuration method is to configure the watermark through the page META tag. Specifically, after opening the web page, the browser process creates and supervises the web page management process.
[0080] Step S502, controlling the webpage management process to read the META tag of the current webpage, parsing the META tag to obtain sixth identification information and seventh identification information, wherein the sixth identification information is used to indicate whether the watermark configuration information exists in the META tag, and the seventh identification information is used to indicate the watermark configuration information;
[0081] Specifically, the web page management process reads whether there is a META tag on the current web page, and determines whether there is a watermark configuration based on the META tag. Specifically, the META tag includes "name" and "content" attributes, that is, the sixth identification information and the seventh identification information. When the "name" attribute character string meets specific rules (that is, consistent with the preset field), it is considered that the above META tag includes a watermark configuration.
[0082] Step S503, when the sixth identification information is that the watermark configuration information does not exist in the META tag, controlling the webpage management process to obtain the watermark configuration parameters whose watermark scope is the global scope from the webpage management process, so as to update the webpage configuration parameters and the webpage drawing parameters;
[0083] Specifically, when the above-mentioned META tag does not include the watermark configuration, in order to ensure the normal configuration of the watermark of the current web page, it is arranged in the present application that the above-mentioned global scope watermark configuration is read from the browser process through the above-mentioned web page management process, and the above-mentioned global scope watermark configuration is determined as the watermark configuration of the current web page.
[0084] Step S504, when the sixth identification information is the watermark configuration information in the META tag, determining the watermark scope according to the seventh identification information;
[0085] Specifically, when the sixth identity information includes a watermark configuration, the META tag is parsed, that is, the "content" attribute string is read and restored to the watermark configuration, and then the watermark scope of the watermark configuration carried by the META tag is determined according to the watermark configuration.
[0086] Step S505, when the watermark scope is the global scope, performing an authentication operation on the current web page, and when the authentication operation passes, updating the web page configuration parameters and the web page drawing parameters according to the seventh identification information;
[0087] Specifically, when the watermark scope of the watermark configuration is global, an authentication operation is required to determine whether the current web page has the authority to change the global scope watermark configuration, and then, if the authentication is passed, the web page configuration parameters and the web page drawing parameters are updated according to the seventh identification information.
[0088] Step S506: when the watermark scope is the web page scope, update the web page configuration parameters and the web page drawing parameters according to the seventh identification information.
[0089] Specifically, when the watermark scope of the watermark configuration is a web page scope, the watermark configuration is determined as the watermark configuration of the current web page.
[0090] In the above embodiment, for a specific web page, there may be a watermark configuration that is configured with both the web page scope and the global scope. When both exist, when the configuration is called, the web page scope is called, that is, when only the web page scope or the global scope exists, the corresponding watermark configuration is called.
[0091] It is understandable that the browser supports opening multiple web pages at the same time. Once the global scope watermark configuration is successfully set, it will be updated to all opened web pages in the browser, and the browser will also read the global scope watermark configuration for subsequent new pages. Each web page will decide how to draw the watermark based on its own web page configuration parameters (whether there is a web page scope and global scope watermark configuration).
[0092] In one embodiment, the specific implementation process of the above embodiment is:
[0093] S1: When the browser is started, read the global scope watermark configuration in the configuration file or the default configuration;
[0094] S2: Open webpage A in the browser, and webpage A does not configure a separate watermark for any scope of the page, then webpage A draws a watermark according to the global watermark configuration read from S1;
[0095] S3: When web pages B and C are opened in the browser, that is, when multiple web pages A, B and C exist in the above browser at the same time, if web page B is successfully authenticated, the global scope watermark configuration is reset, and web page C has a web page scope watermark configuration;
[0096] S4: Web pages A and B draw watermarks according to the global scope watermark configuration set by B, and web page C draws watermarks according to the web page scope watermark configuration. In order to complete the update of the web page drawing parameters and the web page configuration parameters, in an optional implementation, before obtaining the web page configuration parameters, the method further includes:
[0097] Step S507, calling the JS interface to obtain the watermark configuration information, and determining the corresponding watermark scope according to the watermark configuration information;
[0098] Specifically, in another configuration mode, the web page of the present application can set the watermark configuration by calling a JS interface (an interface based on JavaScript configuration), and then determine the scope of the JS watermark configuration.
[0099] Step S508, when the watermark scope is the global scope, performing an authentication operation on the current web page, and when the authentication operation passes, updating the web page configuration parameters and the web page drawing parameters according to the watermark configuration information;
[0100] Specifically, when the JS watermark configuration is global scope, an authentication operation is required to determine whether the current web page has the authority to change the global scope watermark configuration, and then, if the authentication is passed, the web page configuration parameters and the web page drawing parameters are updated according to the JS watermark configuration.
[0101] Step S509: when the watermark scope is the webpage scope, updating the webpage configuration parameters and the webpage drawing parameters according to the watermark configuration information.
[0102] Specifically, when the JS watermark configuration is the web page scope, the web page configuration parameters and the web page drawing parameters are updated according to the JS watermark configuration.
[0103] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the method for drawing a watermarked web page based on a browser rendering engine of the present application will be described in detail below in combination with specific embodiments.
[0104] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0105] The embodiment of the present application also provides a watermarked web page drawing device based on a browser rendering engine. It should be noted that the watermarked web page drawing device based on a browser rendering engine in the embodiment of the present application can be used to execute the watermarked web page drawing method based on a browser rendering engine provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0106] The following is an introduction to a watermarked web page drawing device based on a browser rendering engine provided in an embodiment of the present application.
[0107] Figure 6 is a structural block diagram of a watermarked web page drawing device based on a browser rendering engine according to an embodiment of the present application. Figure 6 As shown, the device comprises:
[0108] A first acquisition unit 10 is used to acquire web page rendering parameters, wherein the web page rendering parameters at least include watermark configuration information and web page element information, wherein the watermark configuration information at least includes a watermark scope and a watermark configuration parameter, wherein the watermark scope includes a web page scope and a global scope;
[0109] Specifically, Figure 3 As shown, when the web page drawing process is triggered, first, the page elements stored in the browser are obtained and divided into multiple web page layers, that is, the above-mentioned web page element information is obtained, and then the above-mentioned watermark configuration parameters stored in the browser and the watermark scope corresponding to each of the above-mentioned configuration parameters are obtained to obtain the above-mentioned watermark configuration information.
[0110] A drawing unit 20 is used to draw a web page based on the above-mentioned rendering engine based on a layering rule according to the above-mentioned multiple web page element information to obtain multiple first web page layers, and draw a web page based on the above-mentioned rendering engine according to the above-mentioned watermark configuration information to obtain a second web page layer;
[0111] Specifically, Figure 3 As shown, based on each of the above web page layers, web page drawing is performed through a rendering engine to obtain the above first web page layer, and according to the above watermark configuration information, a web page layer is drawn based on the above rendering engine to obtain the above second web page layer.
[0112] The second acquisition unit 30 is used to acquire web page configuration parameters, wherein the web page configuration parameters at least include first identification information, second identification information, third identification information and fourth identification information, wherein the first identification information is used to indicate whether a watermark configuration exists on the current web page, the second identification information is used to indicate whether a layer has been drawn on the current web page, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether a watermark scope configuration exists on the current web page;
[0113] Specifically, Figure 3As shown, before generating a web page, first obtain the third identification information, traverse the first web page layers and the second web page layers, and then obtain the first identification information when it is determined that the web page drawing parameters have not changed. When the first identification information indicates that the current web page process does not include a watermark configuration, further obtain the second identification information, and determine whether the current web page process has a drawn layer, that is, a useless layer left behind, based on the second identification information. When the first identification information indicates that the current web page process does not include a watermark configuration, obtain whether the watermark configuration parameters have changed based on the third identification information. If they have changed, determine the scope of the watermark configured for the current web page process based on the fourth identification information, and then determine the corresponding watermark as the watermark of the current web page process based on the scope.
[0114] The first processing unit 40 is used to synthesize the first web page layer and the second web page layer to obtain a target web page when the first identification information indicates that the watermark configuration exists in the current web page and the web page drawing parameters from the third identification information to the current web page have not changed, and display the target web page through a display screen.
[0115] Specifically, Figure 3 As shown, one situation is that after the above-mentioned first web page layer and the above-mentioned second web page layer are drawn, the above-mentioned first identification information is that the above-mentioned watermark configuration exists in the above-mentioned current web page and the above-mentioned to third identification information is that the above-mentioned web page drawing parameters of the above-mentioned current web page have not changed, that is, during the drawing process, the above-mentioned web page element information and the above-mentioned watermark configuration information have not changed, and the above-mentioned first web page layer and the above-mentioned second web page layer obtained by drawing are synthesized to obtain the target web page and displayed.
[0116] In the above embodiment, the web page watermark is implemented based on the browser rendering engine. The watermark belongs to the rendering tree, not the web page DOM tree. The watermark and the web page content are actually combined in the rendering and drawing synthesis process to realize the tamper-proof of the watermark, and the combined watermark can be printed during the web page printing process.
[0117] Through this embodiment, the first acquisition unit acquires web page drawing parameters, the web page drawing parameters at least include watermark configuration information and web page element information, the watermark configuration information at least includes watermark scope and watermark configuration parameters, the watermark scope includes web page scope and global scope; the drawing unit draws the web page based on the above-mentioned rendering engine based on the layering rule according to the above-mentioned multiple web page element information, obtains multiple first web page layers, draws the web page based on the above-mentioned rendering engine according to the above-mentioned watermark configuration information to obtain the second web page layer; the second acquisition unit acquires the web page configuration parameters, the above-mentioned web page configuration parameters at least include the first identification information, the second identification information, the third identification information and the fourth identification information , the first identification information is used to indicate whether there is a watermark configuration on the current web page, the second identification information is used to indicate whether there is a drawn layer on the current web page, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether there is a watermark scope configuration on the current web page; the first processing unit synthesizes the target web page according to the first web page layer and the second web page layer when the first identification information indicates that the watermark configuration exists on the current web page and the third identification information indicates that the web page drawing parameters of the current web page have not changed, and displays the target web page on the display screen. The present application determines the properties and configuration of the watermark and the element configuration of the web page through the web page drawing parameters, draws the web page elements and the watermark respectively based on the web page drawing parameters, and then synthesizes and displays the drawing results according to the web page configuration parameters of the target web page. This method ensures that the watermark is on the web page itself, and solves the problem in the prior art of lacking a web page watermark implementation method that can provide printing services and avoid repeated development.
[0118] In order to ensure that the target web page is correctly synthesized, in an optional implementation manner, the device further includes:
[0119] A second processing unit is configured to, after obtaining the webpage configuration parameters, delete the drawn layer and change the second identification information if the first identification information indicates that the watermark configuration does not exist on the current webpage and the second identification information indicates that the drawn layer exists on the current webpage;
[0120] Specifically, in another case, Figure 3As shown, the first identification information is that the watermark configuration does not exist in the current web page and the second identification information is that the drawn layer exists in the current web page, that is, when the watermark configuration does not exist in the current web page process, it is determined that the watermark does not need to be changed, and further check whether the current web page process has the above-mentioned drawn layer left over. If the above-mentioned drawn layer exists, delete the layer and change the second identification information to that the above-mentioned drawn layer does not exist in the current web page.
[0121] The third processing unit is used to synthesize the first web page layer and the second web page layer to obtain the target web page when the first identification information indicates that the watermark configuration does not exist on the current web page and the second identification information indicates that the drawn layer does not exist on the current web page, and display the target web page through a display screen.
[0122] Specifically, Figure 3 As shown, when it is determined that the watermark does not need to be changed and the current web page process does not have the above-mentioned drawn layer left over, the above-mentioned first web page layer and the above-mentioned second web page layer obtained by drawing are synthesized to obtain the target web page and display it.
[0123] In order to ensure that the target web page is correctly synthesized, in an optional implementation manner, the device further includes:
[0124] a fourth processing unit, configured to, after acquiring the webpage configuration parameters, update the watermark configuration parameters whose watermark scope corresponding to the current webpage is the webpage scope and redraw the second webpage layer when the first identification information indicates that the watermark configuration exists on the current webpage, the third identification information indicates that the webpage drawing parameters of the current webpage have changed, and the fourth identification information indicates that the watermark scope configuration exists on the current webpage and the watermark scope corresponding to the watermark scope configuration is the webpage scope;
[0125] Specifically, Figure 3 As shown, in another situation, the first identification information is that the watermark configuration exists in the current web page, the third identification information is that the web page drawing parameters of the current web page have changed, and the fourth identification information is that a watermark scope configuration exists in the current web page and the watermark scope corresponding to the watermark scope configuration is the web page scope. That is, during the drawing process, it is determined that the watermark configuration information has changed, and then the watermark scope configured for the current web page process is determined according to the fourth identification information. When the watermark scope is the web page scope, redrawing is completed according to the watermark configuration parameters stored in the current web page process.
[0126] The fifth processing unit is used to synthesize the redrawn second web page layer and the first web page layer to obtain the target web page, and display the target web page through a display screen.
[0127] Specifically, the target webpage is obtained by synthesizing the first webpage layer and the redrawn second webpage layer, and the target webpage is displayed on a display screen.
[0128] In order to ensure that the target web page is correctly synthesized, in an optional implementation manner, the device further includes:
[0129] a sixth processing unit, configured to, after acquiring the webpage configuration parameters, update the watermark configuration parameters of the watermark scope corresponding to the current webpage to the global scope and redraw the second webpage layer when the first identification information indicates that the watermark configuration exists on the current webpage, the third identification information indicates that the webpage drawing parameters of the current webpage have changed, and the fourth identification information indicates that the watermark scope configuration exists on the current webpage and the watermark scope corresponding to the watermark scope configuration is the global scope;
[0130] Specifically, Figure 3 As shown, in another situation, the first identification information is that the watermark configuration exists in the current web page, the third identification information is that the web page drawing parameters of the current web page have changed, and the fourth identification information is that a watermark scope configuration exists in the current web page and the watermark scope corresponding to the watermark scope configuration is the web page scope. That is, during the drawing process, it is determined that the watermark configuration information has changed, and then the watermark scope configured for the current web page process is determined according to the fourth identification information. When the watermark scope is the global scope, redrawing is completed according to the watermark configuration parameters stored in the current web page process.
[0131] The display unit is used to synthesize the target web page according to the redrawn second web page layer and the first web page layer, and display the target web page through a display screen.
[0132] Specifically, the target webpage is obtained by synthesizing the first webpage layer and the redrawn second webpage layer, and the target webpage is displayed on a display screen.
[0133] In order to complete the updating of the webpage drawing parameters and the webpage configuration parameters, in an optional implementation, the apparatus further includes:
[0134] A first creation unit is used for, before obtaining the webpage configuration parameters, creating a browser process in the case of receiving a first target signaling, reading a browser configuration file based on the browser process, and obtaining fifth identification information, wherein the first target signaling is used to request to start the browser, and the fifth identification information is used to indicate whether the current browser has the watermark configuration parameters whose watermark scope is the global scope;
[0135] Specifically, Figure 4 As shown, one configuration method is to configure the watermark scope as a global watermark configuration parameter through a browser. Specifically, after starting the browser client, the browser client creates the above browser process, and then reads the browser configuration file through the browser process to determine whether the configuration file includes a global watermark configuration.
[0136] A first updating unit is configured to update the web page configuration parameters and the web page drawing parameters through the browser process according to the watermark configuration parameters in the configuration file when the fifth flag information indicates that the watermark scope is the watermark configuration parameters of the global scope;
[0137] Specifically, when the configuration file includes the globally effective watermark configuration, the watermark configuration parameters stored in the browser are updated according to the globally effective watermark configuration.
[0138] The second updating unit is configured to update the webpage configuration parameters and the webpage drawing parameters according to preset parameters when the fifth flag information indicates that the watermark configuration parameters whose watermark scope is the global scope do not exist.
[0139] Specifically, when the configuration file does not include the globally effective watermark configuration, the watermark configuration parameters stored in the browser are updated according to the default values as the globally effective watermark configuration.
[0140] In order to complete the updating of the webpage drawing parameters and the webpage configuration parameters, in an optional implementation, the apparatus further includes:
[0141] A second creation unit is used to control the browser process to create a web page management process when receiving a second target signaling before acquiring the web page configuration parameters;
[0142] Specifically, Figure 5 As shown, another configuration method is to configure the watermark through the page META tag. Specifically, after opening the web page, the browser process creates and supervises the web page management process.
[0143] a parsing unit, used to control the webpage management process to read the META tag of the current webpage, and parse the META tag to obtain sixth identification information and seventh identification information, wherein the sixth identification information is used to indicate whether the watermark configuration information exists in the META tag, and the seventh identification information is used to indicate the watermark configuration information;
[0144] Specifically, the web page management process reads whether there is a META tag on the current web page, and determines whether there is a watermark configuration based on the META tag. Specifically, the META tag includes "name" and "content" attributes, that is, the sixth identification information and the seventh identification information. When the "name" attribute character string meets specific rules (that is, consistent with the preset field), it is considered that the above META tag includes a watermark configuration.
[0145] A third updating unit is used for controlling the webpage management process to obtain the watermark configuration parameters whose watermark scope is the global scope from the webpage management process when the sixth identification information is that the watermark configuration information does not exist in the META tag, so as to update the webpage configuration parameters and the webpage drawing parameters;
[0146] Specifically, when the above-mentioned META tag does not include the watermark configuration, in order to ensure the normal configuration of the watermark of the current web page, it is arranged in the present application that the above-mentioned global scope watermark configuration is read from the browser process through the above-mentioned web page management process, and the above-mentioned global scope watermark configuration is determined as the watermark configuration of the current web page.
[0147] A fourth updating unit, configured to determine the watermark scope according to the seventh identification information when the sixth identification information is that the watermark configuration information exists in the META tag;
[0148] Specifically, when the sixth identity information includes a watermark configuration, the META tag is parsed, that is, the "content" attribute string is read and restored to the watermark configuration, and then the watermark scope of the watermark configuration carried by the META tag is determined according to the watermark configuration.
[0149] a fifth updating unit, configured to perform an authentication operation on the current web page when the watermark scope is the global scope, and update the web page configuration parameters and the web page drawing parameters according to the seventh identification information when the authentication operation passes;
[0150] Specifically, when the watermark scope of the watermark configuration is global, an authentication operation is required to determine whether the current web page has the authority to change the global scope watermark configuration, and then, if the authentication is passed, the web page configuration parameters and the web page drawing parameters are updated according to the seventh identification information.
[0151] The sixth updating unit is used to update the web page configuration parameters and the web page drawing parameters according to the seventh identification information when the watermark scope is the web page scope.
[0152] Specifically, when the watermark scope of the watermark configuration is a web page scope, the watermark configuration is determined as the watermark configuration of the current web page.
[0153] In order to complete the updating of the webpage drawing parameters and the webpage configuration parameters, in an optional implementation, the apparatus further includes:
[0154] A calling unit, used for calling a JS interface to obtain the watermark configuration information before obtaining the webpage configuration parameters, and determining the corresponding watermark scope according to the watermark configuration information;
[0155] Specifically, in another configuration mode, the web page of the present application can set the watermark configuration by calling a JS interface (an interface based on JavaScript configuration), and then determine the scope of the JS watermark configuration.
[0156] a seventh updating unit, configured to perform an authentication operation on the current web page when the watermark scope is the global scope, and update the web page configuration parameters and the web page drawing parameters according to the watermark configuration information when the authentication operation passes;
[0157] Specifically, when the JS watermark configuration is global scope, an authentication operation is required to determine whether the current web page has the authority to change the global scope watermark configuration, and then, if the authentication is passed, the web page configuration parameters and the web page drawing parameters are updated according to the JS watermark configuration.
[0158] An eighth updating unit is used to update the web page configuration parameters and the web page drawing parameters according to the watermark configuration information when the watermark scope is the web page scope.
[0159] Specifically, when the JS watermark configuration is the web page scope, the web page configuration parameters and the web page drawing parameters are updated according to the JS watermark configuration.
[0160] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the method for drawing a watermarked web page based on a browser rendering engine of the present application will be described in detail below in combination with specific embodiments.
[0161] The above-mentioned watermarked web page drawing device based on the browser rendering engine includes a processor and a memory. The above-mentioned first acquisition unit, drawing unit, second acquisition unit and first processing unit are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions. The above-mentioned modules are all located in the same processor; or, the above-mentioned modules are located in different processors in any combination.
[0162] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the workload of web page development can be reduced and the web page can be printed by adjusting the kernel parameters.
[0163] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0164] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program. When the program is executed, the device where the computer-readable storage medium is located is controlled to execute the watermarked web page drawing method based on the browser rendering engine.
[0165] Specifically, the method for drawing a watermarked web page based on a browser rendering engine includes:
[0166] Step S201, obtaining web page drawing parameters, the web page drawing parameters at least include watermark configuration information and web page element information, the watermark configuration information at least includes watermark scope and watermark configuration parameters, the watermark scope includes web page scope and global scope;
[0167] Step S202, drawing a web page based on the layering rule based on the rendering engine according to the plurality of web page element information to obtain a plurality of first web page layers, and drawing a web page based on the rendering engine according to the watermark configuration information to obtain a second web page layer;
[0168] Step S203, obtaining web page configuration parameters, the web page configuration parameters at least include first identification information, second identification information, third identification information and fourth identification information, the first identification information is used to indicate whether the current web page has a watermark configuration, the second identification information is used to indicate whether the current web page has a drawn layer, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether the current web page has a watermark scope configuration;
[0169] Step S204, when the first identification information indicates that the watermark configuration exists on the current web page and the web page drawing parameters from the third identification information to the current web page have not changed, the target web page is obtained by synthesizing the first web page layer and the second web page layer, and the target web page is displayed on the display screen.
[0170] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the program executes the watermarked web page drawing method based on a browser rendering engine when running.
[0171] Specifically, the method for drawing a watermarked web page based on a browser rendering engine includes:
[0172] Step S201, obtaining web page drawing parameters, the web page drawing parameters at least include watermark configuration information and web page element information, the watermark configuration information at least includes watermark scope and watermark configuration parameters, the watermark scope includes web page scope and global scope;
[0173] Step S202, drawing a web page based on the layering rule based on the rendering engine according to the plurality of web page element information to obtain a plurality of first web page layers, and drawing a web page based on the rendering engine according to the watermark configuration information to obtain a second web page layer;
[0174] Step S203, obtaining web page configuration parameters, the web page configuration parameters at least include first identification information, second identification information, third identification information and fourth identification information, the first identification information is used to indicate whether the current web page has a watermark configuration, the second identification information is used to indicate whether the current web page has a drawn layer, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether the current web page has a watermark scope configuration;
[0175] Step S204, when the first identification information indicates that the watermark configuration exists on the current web page and the web page drawing parameters from the third identification information to the current web page have not changed, the target web page is obtained by synthesizing the first web page layer and the second web page layer, and the target web page is displayed on the display screen.
[0176] An embodiment of the present invention provides a business system, the business system includes a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:
[0177] Step S201, obtaining web page drawing parameters, the web page drawing parameters at least include watermark configuration information and web page element information, the watermark configuration information at least includes watermark scope and watermark configuration parameters, the watermark scope includes web page scope and global scope;
[0178] Step S202, drawing a web page based on the layering rule based on the rendering engine according to the plurality of web page element information to obtain a plurality of first web page layers, and drawing a web page based on the rendering engine according to the watermark configuration information to obtain a second web page layer;
[0179] Step S203, obtaining web page configuration parameters, the web page configuration parameters at least include first identification information, second identification information, third identification information and fourth identification information, the first identification information is used to indicate whether the current web page has a watermark configuration, the second identification information is used to indicate whether the current web page has a drawn layer, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether the current web page has a watermark scope configuration;
[0180] Step S204, when the first identification information indicates that the watermark configuration exists on the current web page and the web page drawing parameters from the third identification information to the current web page have not changed, the target web page is obtained by synthesizing the first web page layer and the second web page layer, and the target web page is displayed on the display screen.
[0181] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:
[0182] Step S201, obtaining web page drawing parameters, the web page drawing parameters at least include watermark configuration information and web page element information, the watermark configuration information at least includes watermark scope and watermark configuration parameters, the watermark scope includes web page scope and global scope;
[0183] Step S202, drawing a web page based on the layering rule based on the rendering engine according to the plurality of web page element information to obtain a plurality of first web page layers, and drawing a web page based on the rendering engine according to the watermark configuration information to obtain a second web page layer;
[0184] Step S203, obtaining web page configuration parameters, the web page configuration parameters at least include first identification information, second identification information, third identification information and fourth identification information, the first identification information is used to indicate whether the current web page has a watermark configuration, the second identification information is used to indicate whether the current web page has a drawn layer, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether the current web page has a watermark scope configuration;
[0185] Step S204, when the first identification information indicates that the watermark configuration exists on the current web page and the web page drawing parameters from the third identification information to the current web page have not changed, the target web page is obtained by synthesizing the first web page layer and the second web page layer, and the target web page is displayed on the display screen.
[0186] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0187] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0188] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0189] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0190] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0191] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0192] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0193] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0194] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0195] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:
[0196] 1) The method for drawing a web page with watermark based on a browser rendering engine of the present application first obtains web page drawing parameters, the web page drawing parameters at least include watermark configuration information and web page element information, the watermark configuration information at least includes watermark scope and watermark configuration parameters, the watermark scope includes web page scope and global scope; then, according to the plurality of web page element information, the web page is drawn based on the layering rule based on the rendering engine to obtain a plurality of first web page layers, and according to the watermark configuration information, the web page is drawn based on the rendering engine to obtain a second web page layer; then, the web page configuration parameters are obtained, the web page configuration parameters at least include first identification information, second identification information, third identification information The first identification information is used to indicate whether there is a watermark configuration on the current web page, the second identification information is used to indicate whether there is a drawn layer on the current web page, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether there is a watermark scope configuration on the current web page; finally, when the first identification information indicates that there is a watermark configuration on the current web page and the third identification information indicates that the web page drawing parameters of the current web page have not changed, the target web page is obtained by synthesizing the first web page layer and the second web page layer, and the target web page is displayed on the display screen. The present application determines the properties and configuration of the watermark and the element configuration of the web page through the web page drawing parameters, draws the web page elements and watermarks respectively based on the web page drawing parameters, and then synthesizes and displays the drawing results according to the web page configuration parameters of the target web page. This method ensures that the watermark is on the web page itself, and solves the problem in the prior art of lacking a web page watermark implementation method that can provide printing services and avoid repeated development.
[0197] 2) In the webpage drawing device with watermark based on the browser rendering engine of the present application, the first acquisition unit acquires webpage drawing parameters, the webpage drawing parameters at least include watermark configuration information and webpage element information, the watermark configuration information at least includes watermark scope and watermark configuration parameters, the watermark scope includes webpage scope and global scope; the drawing unit draws the webpage based on the layering rule based on the rendering engine according to the plurality of webpage element information, obtains a plurality of first webpage layers, draws the webpage based on the rendering engine according to the watermark configuration information, obtains a second webpage layer; the second acquisition unit acquires the webpage configuration parameters, the webpage configuration parameters at least include the first identification information, the second identification information, the third identification information, Identification information and fourth identification information, the first identification information is used to indicate whether there is a watermark configuration on the current web page, the second identification information is used to indicate whether there is a drawn layer on the current web page, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether there is a watermark scope configuration on the current web page; the first processing unit synthesizes the target web page according to the first web page layer and the second web page layer when the first identification information indicates that the watermark configuration exists on the current web page and the third identification information indicates that the web page drawing parameters of the current web page have not changed, and displays the target web page on the display screen. The present application determines the properties and configuration of the watermark and the element configuration of the web page through the web page drawing parameters, draws the web page elements and watermarks respectively based on the web page drawing parameters, and then synthesizes and displays the drawing results according to the web page configuration parameters of the target web page. This method ensures that the watermark is on the web page itself, and solves the problem in the prior art of lacking a web page watermark implementation method that can provide printing services and avoid repeated development.
[0198] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for drawing a watermarked web page based on a browser rendering engine, characterized in that: include: Acquire web page drawing parameters, wherein the web page drawing parameters at least include watermark configuration information and web page element information, wherein the watermark configuration information at least includes a watermark scope and a watermark configuration parameter, wherein the watermark scope includes a web page scope and a global scope; Drawing a web page based on the rendering engine based on a layering rule according to the plurality of web page element information to obtain a plurality of first web page layers, and drawing a web page based on the rendering engine according to the watermark configuration information to obtain a second web page layer; Obtaining web page configuration parameters, the web page configuration parameters at least including first identification information, second identification information, third identification information and fourth identification information, the first identification information is used to indicate whether a watermark configuration exists on the current web page, the second identification information is used to indicate whether a layer has been drawn on the current web page, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether a watermark scope configuration exists on the current web page; When the first identification information indicates that the watermark configuration exists on the current web page and the web page drawing parameters of the third identification information indicating that the current web page have not changed, the first web page layer and the second web page layer are synthesized to obtain a target web page, and the target web page is displayed on a display screen.
2. The method according to claim 1, characterized in that After obtaining the webpage configuration parameters, the method further includes: When the first identification information indicates that the watermark configuration does not exist on the current webpage and the second identification information indicates that the drawn layer exists on the current webpage, deleting the drawn layer and changing the second identification information; When the first identification information indicates that the watermark configuration does not exist on the current web page and the second identification information indicates that the drawn layer does not exist on the current web page, the target web page is obtained by synthesizing the first web page layer and the second web page layer, and the target web page is displayed on a display screen.
3. The method according to claim 1, characterized in that After obtaining the webpage configuration parameters, the method further includes: When the first identification information indicates that the watermark configuration exists in the current webpage, the third identification information indicates that the webpage drawing parameters of the current webpage have changed, and the fourth identification information indicates that the watermark scope configuration exists in the current webpage and the watermark scope corresponding to the watermark scope configuration is the webpage scope, updating the watermark configuration parameters of the watermark scope corresponding to the current webpage to be the webpage scope and redrawing the second webpage layer; The target web page is obtained by synthesizing the redrawn second web page layer and the first web page layer, and the target web page is displayed on a display screen.
4. The method according to claim 3, characterized in that After obtaining the web page configuration parameters, including: When the first identification information indicates that the watermark configuration exists in the current webpage, the third identification information indicates that the webpage drawing parameters of the current webpage have changed, and the fourth identification information indicates that the watermark scope configuration exists in the current webpage and the watermark scope corresponding to the watermark scope configuration is the global scope, updating the watermark configuration parameters of the watermark scope corresponding to the current webpage to the global scope and redrawing the second webpage layer; The target web page is obtained by synthesizing the redrawn second web page layer and the first web page layer, and the target web page is displayed on a display screen.
5. The method according to claim 1, characterized in that Before obtaining the webpage configuration parameters, the method further includes: In the case of receiving the first target signaling, creating a browser process, reading a browser configuration file based on the browser process, and obtaining fifth identification information, wherein the first target signaling is used to request to start the browser, and the fifth identification information is used to indicate whether the current browser has the watermark configuration parameter whose watermark scope is the global scope; When the fifth flag information indicates that the watermark scope is the watermark configuration parameter of the global scope, updating the webpage configuration parameter and the webpage drawing parameter through the browser process according to the watermark configuration parameter in the configuration file; When the fifth flag information indicates that the watermark configuration parameter whose watermark scope is the global scope does not exist, the webpage configuration parameter and the webpage drawing parameter are updated according to preset parameters.
6. The method according to claim 5, characterized in that Before obtaining the webpage configuration parameters, the method further includes: When receiving the second target signaling, controlling the browser process to create a webpage management process; Control the webpage management process to read the META tag of the current webpage, parse the META tag to obtain sixth identification information and seventh identification information, the sixth identification information is used to indicate whether the watermark configuration information exists in the META tag, and the seventh identification information is used to indicate the watermark configuration information; When the sixth identification information is that the watermark configuration information does not exist in the META tag, controlling the webpage management process to obtain the watermark configuration parameters whose watermark scope is the global scope from the webpage management process, so as to update the webpage configuration parameters and the webpage drawing parameters; When the sixth identification information is that the watermark configuration information exists in the META tag, determining the watermark scope according to the seventh identification information; When the watermark scope is the global scope, performing an authentication operation on the current webpage, and when the authentication operation passes, updating the webpage configuration parameters and the webpage drawing parameters according to the seventh identification information; In a case where the watermark scope is the web page scope, the web page configuration parameters and the web page drawing parameters are updated according to the seventh identification information.
7. The method according to claim 6, characterized in that Before obtaining the webpage configuration parameters, the method further includes: Call the JS interface to obtain the watermark configuration information, and determine the corresponding watermark scope according to the watermark configuration information; When the watermark scope is the global scope, performing an authentication operation on the current webpage, and when the authentication operation passes, updating the webpage configuration parameters and the webpage drawing parameters according to the watermark configuration information; In the case where the watermark scope is the web page scope, the web page configuration parameters and the web page drawing parameters are updated according to the watermark configuration information.
8. A watermarked web page drawing device based on a browser rendering engine, characterized in that: The device comprises: A first acquisition unit is used to acquire web page rendering parameters, wherein the web page rendering parameters at least include watermark configuration information and web page element information, wherein the watermark configuration information at least includes a watermark scope and a watermark configuration parameter, wherein the watermark scope includes a web page scope and a global scope; A drawing unit, configured to draw a web page based on the rendering engine and a layering rule according to the plurality of web page element information to obtain a plurality of first web page layers, and draw a web page based on the rendering engine according to the watermark configuration information to obtain a second web page layer; A second acquisition unit is used to acquire web page configuration parameters, wherein the web page configuration parameters at least include first identification information, second identification information, third identification information and fourth identification information, wherein the first identification information is used to indicate whether a watermark configuration exists on the current web page, the second identification information is used to indicate whether a layer has been drawn on the current web page, the third identification information is used to indicate whether the web page drawing parameters of the current web page have changed, and the fourth identification information is used to indicate whether a watermark scope configuration exists on the current web page; The first processing unit is used to synthesize the first web page layer and the second web page layer to obtain a target web page when the first identification information indicates that the watermark configuration exists in the current web page and the web page drawing parameters from the third identification information to the current web page have not changed, and display the target web page through a display screen.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
10. A business system, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include methods for executing any one of claims 1 to 7.