CN113326462A - H5 page watermarking method, server, computer equipment and storage medium - Google Patents

H5 page watermarking method, server, computer equipment and storage medium Download PDF

Info

Publication number
CN113326462A
CN113326462A CN202110726227.4A CN202110726227A CN113326462A CN 113326462 A CN113326462 A CN 113326462A CN 202110726227 A CN202110726227 A CN 202110726227A CN 113326462 A CN113326462 A CN 113326462A
Authority
CN
China
Prior art keywords
watermark
page
target
server
watermarking
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110726227.4A
Other languages
Chinese (zh)
Other versions
CN113326462B (en
Inventor
朱志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Lian Intellectual Property Service Center
Shenzhen Merit Creation Network Technology Co ltd
Original Assignee
Ping An Puhui Enterprise Management Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202110726227.4A priority Critical patent/CN113326462B/en
Publication of CN113326462A publication Critical patent/CN113326462A/en
Application granted granted Critical
Publication of CN113326462B publication Critical patent/CN113326462B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/10Protecting distributed programs or content, e.g. vending or licensing of copyrighted material ; Digital rights management [DRM]
    • G06F21/16Program or content traceability, e.g. by watermarking
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the application belongs to the technical field of H5 pages, and relates to a watermark adding method for an H5 page, which comprises the following steps: the method comprises the steps that when a server receiving terminal monitors sharing operation of a user on a target H5 page, a sent indication message is triggered; the server side responds to the indication message and determines a preset first watermark; the server adds the first watermark in the target H5 page, so that when the target H5 page is rendered by a browser, the first watermark is displayed in the target H5 page. The application also provides a server, a computer device and a storage medium.

Description

H5 page watermarking method, server, computer equipment and storage medium
Technical Field
The present application relates to the technical field of H5 pages, and in particular, to a watermark adding method for an H5 page, a server, a computer device, and a storage medium.
Background
The sharing function is a common function of various kinds of APPs at present, and for example, the sharing function can share pictures, share H5 page links, share videos and other network resources.
However, in some scenarios, unlimited sharing of network resources may cause some information security problems. For example, a user uploads an identification card for rental or loan use through the H5 page of an APP. At this time, if another user opens the page and shares the page, the sharing behavior may cause the identity information of the previous user to be acquired by another person for other purposes, thereby bringing about the problem of information security.
Therefore, how to reduce the information security problem that may exist in the process of sharing H5 pages is a technical problem that is yet to be solved at present.
Disclosure of Invention
An object of the embodiment of the present application is to provide a watermarking method for an H5 page, a server, a computer device, and a storage medium, so as to solve a possible information security problem in a process of sharing an H5 page.
In order to solve the above technical problem, an embodiment of the present application provides a method for adding a watermark to an H5 page, which adopts the following technical solutions:
a watermarking method of an H5 page can include the following steps:
the method comprises the steps that when a server receiving terminal monitors sharing operation of a user on a target H5 page, a sent indication message is triggered;
the server responds to the indication message and determines a preset first watermark;
the server adds the first watermark in the target H5 page so that the first watermark is displayed in the target H5 page when the target H5 page is rendered by a browser.
In some possible implementations of the application embodiment, the step of adding, by the server, the first watermark in the target H5 page may include:
the server adds the first watermark in the target H5 page by using the JS injection method.
In some possible implementations of the application embodiment, the step of adding, by the server, the first watermark in the target H5 page by using the JS injection method may include:
the server splices the first watermark and a preset watermark pattern code to generate a JS code, and the JS code is used for displaying the first watermark in the target H5 page when being rendered by a browser;
the server determines the HTML file of the target H5 page, and traverses the content body of the HTML file;
the server adds the JS code to the content body as a new tag content.
In some possible implementations of the application embodiment, the step of determining, by the server in response to the indication message, the preset first watermark may include:
the server responds to the indication message, acquires the identification information of the user or the target H5 page owner, and takes the identification information as the first watermark.
In some possible implementation manners of the application embodiment, after the step of triggering the sent indication message when the server acquiring terminal responds to the user to perform the sharing operation on the target H5 page, the method for adding the watermark to the H5 page may further include:
the server determining whether the user has the right to add the watermark;
the step of the server adding the first watermark in the target H5 page may include:
the server adds the first watermark in the target H5 page when determining that the user has the right to add the watermark;
the watermarking method for the H5 page further comprises the following steps:
the server does not add the first watermark in the target H5 page upon determining that the user does not have the right to add a watermark.
In some possible implementations of the application embodiment, after the step of determining, by the server, the preset first watermark in response to the indication message, the watermarking method for the H5 page may further include:
the server detects whether a second watermark exists in the target H5 page;
the step of the server adding the first watermark in the target H5 page may include:
if the second watermark can be included, the server firstly removes the second watermark and adds the first watermark in the target H5 page, or the server directly adds the first watermark at a position where the second watermark is offset by a preset distance;
if the second watermark cannot be included, the server adds the first watermark in the target H5 page.
In some possible implementations of the application embodiment, after the step of displaying the first watermark in the target H5 page when the server adds the first watermark in the target H5 page so that the target H5 page is rendered by a browser, the watermarking method for the H5 page may further include:
and the server performs timing after the first watermark is added, and removes the first watermark in the target H5 page after a preset time length is exceeded.
In order to solve the above technical problem, an embodiment of the present application further provides a server, which adopts the following technical solutions:
a server, may comprise:
the receiving module is used for sending an indication message to the server when monitoring the sharing operation of the user on the target H5 page;
a determining module, configured to determine a preset first watermark in response to the indication message;
and the watermark adding module is used for adding the first watermark in the target H5 page so that the first watermark is displayed in the target H5 page when the target H5 page is rendered by a browser.
In some possible implementations of the embodiment of the present application, the watermarking module is specifically configured to add the first watermark in the target H5 page by using a JS injection method.
In some possible implementation manners of the embodiment of the present application, the watermarking module includes:
a splicing unit, configured to splice the first watermark and a preset watermark pattern code to generate a JS code, where the JS code is used to display the first watermark in the target H5 page when rendered by a browser;
the query unit is used for determining the HTML file of the target H5 page and traversing the content body of the HTML file;
and the editing unit is used for adding the JS code as a new label content to the content body.
In some possible implementation manners of the embodiment of the present application, the determining module is specifically configured to, in response to the indication message, acquire identification information of the user or the owner of the target H5 page, and use the identification information as the first watermark.
In some possible implementation manners of the embodiment of the present application, the server further includes:
the authority judging module is used for determining whether the user has the authority of adding the watermark;
the watermark adding module is specifically configured to add the first watermark to the target H5 page when it is determined that the user has the right to add a watermark;
the server further comprises:
and the processing module is further used for not adding the first watermark in the target H5 page when the user is determined not to have the right of adding the watermark.
In some possible implementation manners of the embodiment of the present application, the server further includes:
the watermark detection module is used for detecting whether a second watermark exists in the target H5 page;
the watermark adding module is specifically configured to, if the second watermark can be included, remove the second watermark first, and add the first watermark to the target H5 page, or directly add the first watermark to a position where the second watermark is offset by a preset distance; if the second watermark cannot be included, the first watermark is added to the target H5 page. In some possible implementation manners of the embodiment of the present application, the server further includes:
and the watermark deleting module is used for timing after the first watermark is added, and removing the first watermark in the target H5 page after the preset time length is exceeded.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
a computer device may comprise a memory having stored therein computer readable instructions which, when executed by a processor, implement the steps of the watermarking method of H5 pages as described above.
In order to solve the above technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
a computer readable storage medium, characterized in that the computer readable storage medium has stored thereon computer readable instructions which, when executed by a processor, implement the steps of the watermarking method of the H5 page as described above.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
in the embodiment of the application, after the obtaining terminal triggers the sent indication message when responding to the sharing operation of the user on the target H5 page, the server may determine the preset first watermark in response to the indication message. Then, the server adds the first watermark in the target H5 page, so that the first watermark is displayed in the target H5 page when the target H5 page is rendered by a browser. Because the first watermark is added into the target H5 page as the identification information of the target H5 page, when the target H5 page is rendered by a browser, the first watermark can be displayed in the target H5 page, and the traceability of the target H5 page is realized, so that compared with the unlimited sharing operation in the prior art, the information security problem caused by sharing the target H5 page can be effectively reduced.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow diagram of one embodiment of a method of watermarking H5 pages according to the application;
FIG. 3 is a flow chart of yet another embodiment of a method of watermarking H5 pages according to the present application;
FIG. 4 is a schematic diagram of one embodiment of a server 400, according to the present application;
FIG. 5 is a block diagram of one embodiment of a computer device 500 according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various communication terminal applications installed thereon, such as a web browser application, a shopping application, a search application, an instant messaging tool, a mailbox terminal, social platform software, and the like.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, 103.
It should be noted that the watermarking method for the H5 page provided in the embodiment of the present application is generally performed by a server/terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continuing reference to FIG. 2, a flowchart of one embodiment of a watermarking method of the H5 page according to the present application is shown. The watermarking method of the H5 page comprises the following steps:
in step S210, the server receiving terminal triggers a sent instruction message when monitoring the sharing operation of the user on the target H5 page.
In this embodiment, the terminal may be a terminal device 101, 102, or 103 in the architecture shown in fig. 1, and the operation of sharing, or forwarding, the target H5 page refers to an operation of forwarding or sharing, or the like, a link of the target H5 page after the user clicks a sharing or forwarding button after opening the target H5 web page. The target H5 page can be a preset specific page, and when the terminal responds to the user to share the target H5 page, the terminal triggers to send an indication message to the server for storing the target H5 page source file, wherein the indication message can include the link address information of the target H5 page.
In step S220, the server determines a preset first watermark in response to the indication message.
In this embodiment of the application, the first watermark may be a preset text watermark or a preset picture watermark.
In some possible implementation manners of the embodiment of the present application, to improve the security of page sharing of the target H5, the first watermark may be identification information of an owner of the target H5 page or identification information of a current user. The process of obtaining the identification information may include: and inquiring to acquire the identity information of the user or the owner of the target H5 page from a preset inquiry interface, and extracting the identity information of the user from the identity information, wherein the identity information can be a user name, a user ID and the like.
In step S230, the server adds the first watermark in the target H5 page, so that when the target H5 page is rendered by the browser, the first watermark is displayed in the target H5 page.
In the embodiment of the application, after the first watermark is acquired, link address information in the indication message may be queried, the target H5 page is determined, and then the first watermark is added to a predetermined position of the target H5 page according to a preset watermark adding rule to serve as identification information of the target H5 page, so that the first watermark may be displayed in the target H5 page when the target H5 page is rendered by a browser. In the watermark adding rule, information such as adding position, transparency and color of the watermark can be indicated.
In some possible implementations of the embodiment of the present application, the step of adding the first watermark to the target H5 page includes: and adding a first watermark in the target H5 page by adopting a JS injection method.
Specifically, the first watermark may be added by adopting a JS injection method for the source file of the target H5 page.
In some possible implementations of the embodiment of the present application, the step of adding the first watermark in the target H5 page by using the JS injection method includes: the server splices the first watermark and a preset watermark pattern code to generate a JS code, and the JS code is used for displaying the first watermark in a target H5 page when being rendered by the browser; the server determines an HTML file of a target H5 page and traverses the content body of the HTML file; the server adds the JS code to the content body as a new tag content.
Specifically, the method for adding the first watermark by JS injection may include: after the first watermark is obtained, the first watermark is spliced with a preset watermark pattern code to generate a JS code comprising the first watermark. If the first watermark is a character, the section of character is directly added into the watermark pattern code, and if the first watermark is a picture, the resource address of the picture is added into the watermark pattern code. After the JS code is generated, the HTML file of the target H5 page may be queried and determined by using the link address information included in the indication message, and then the HTML file is traversed to the body of the content of the HTML file, and the JS code is embedded in the target H5 page by using a new child node under the body, or new child tag content. In this way, the shared target H5 page is integrated with the watermark, and when the link of the shared target H5 page is opened by other users, the first watermark can be seen through browser rendering. The watermark pattern code may set information such as the content and pattern of the watermark to be displayed. For example, the specific content of the watermark pattern code may include the following: watermark content to be displayed, transparency, gradient, size, etc.
Further, adding a JS code to the content body of the HTML file may include: the body attribute of the document object is obtained when the document object, namely the HTML file, of the webpage view (webview) is taken, and then the tag content of the JS code is added into the body as a child node by using an addChild tool.
In some possible implementation manners of the embodiment of the present application, in step S210, after the step of triggering the sent instruction message when the obtaining terminal responds that the user performs the sharing operation on the target H5 page, the method for adding a watermark to an H5 page further includes: it is determined whether the user has the right to add the watermark. Step S230, adding a first watermark in the target H5 page, so that when the target H5 page is rendered by a browser, the first watermark is displayed in the target H5 page, and the method comprises the following steps: and if the need is determined, acquiring a preset first watermark. And after determining whether the user has the right to add the watermark, the watermarking method for the H5 page further comprises the following steps: the server does not add the first watermark in the target H5 page upon determining that the user does not have the right to add a watermark.
Specifically, when it is determined that the user performs the sharing operation on the target H5 page, it may be further determined whether the target H5 page needs to be watermarked, and then the preset first watermark is acquired. Specifically, two user types may be set: the method comprises the steps of having a first type of user with the watermarking authority and a second type of user without the watermarking authority, and therefore determining whether the target H5 page needs to be watermarked or not by judging the type of the current user. The first type of user may be the creator of the target H5 page or a user with modification rights, or a specific user who is set to join, while the second type of user is other users with read-only rights only. The corresponding relationship between the user identifier and the user type may be set in the system, for example, a list of user names having the watermarking right to the target H5 page is saved, and the user type of the current user is determined according to the corresponding relationship.
With reference to the above description, through setting of the authority, the addition of the watermark in the target H5 page by the non-authorized user can be avoided, and the information security problem that may be brought by the target H5 page due to the addition of the watermark of the non-authorized user is avoided. For example, a certain applicant uploads personal identity information on a resume page of a certain recruitment APP, the account of the applicant is a first type of user, and other accounts are second type of users. And when the users with other accounts open the resume page of the applicant and share the resume page, the watermarks set by the applicant are added according to judgment and determination, and the watermarks of the users do not need to be added according to judgment and determination.
In some possible implementations of the embodiment of the present application, in the foregoing steps, after the adding of the first watermark to the target H5 page is completed, the method for adding a watermark to an H5 page may further include: and after the preset time length is exceeded, removing the first watermark in the target H5 page. Specifically, a tag name or an element name corresponding to the first watermark may be recorded, and when the first watermark is deleted, the tag name or the element name may be used to query a JS code corresponding to the first watermark under the body node of the HTML file of the H5 page, and delete the JS code, so that the first watermark may be deleted.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
in the embodiment of the application, after the acquisition terminal triggers the sent indication message when responding to the sharing operation of the user on the target H5 page, the acquisition terminal may determine the preset first watermark in response to the indication message. Then, the first watermark is added in the target H5 page, so that when the target H5 page is rendered by a browser, the first watermark is displayed in the target H5 page. Because the first watermark is added into the target H5 page as the identification information of the target H5 page, when the target H5 page is rendered by a browser, the first watermark can be displayed in the target H5 page, and the traceability of the target H5 page is realized, so that compared with the unlimited sharing operation in the prior art, the information security problem caused by sharing the target H5 page can be effectively reduced.
In some possible implementations of the embodiment of the present application, referring to fig. 3 in particular, a schematic diagram of another embodiment of a watermarking method for an H5 page according to the embodiment of the present application is shown. In step S220, after determining the preset first watermark in response to the indication message, the method for adding a watermark to the H5 page further includes:
in step S310, the server detects whether the second watermark already exists in the target H5 page.
Specifically, in some cases, if the target H5 page already has a watermark, in order to avoid overlapping of watermarks due to subsequent adding of watermarks, it may be detected whether a second watermark already exists in the target H5 page after the first watermark is obtained. Where the watermarks may each be preset to have a particular identity, it is determined whether the second watermark is already present in the target H5 page by querying whether the identity is present in the file of the target H5 page. For example, for the JS injection mode, the first watermark of the target H5 page may be set, the name corresponding to the sub-tag under the body attribute of the HTML source file is watermark01, the second watermark of the target H5 page is watermark02, and so on. And if the query shows that the identifier of the watermark exists in the file of the target H5 page, determining that the second watermark exists, otherwise, determining that the second watermark does not exist.
In step S230, the server adds a first watermark to the target H5 page, so that when the target H5 page is rendered by the browser, the first watermark is displayed in the target H5 page, which includes:
step S331, if the second watermark is included, the server firstly removes the second watermark and adds the first watermark in the target H5 page, or the server directly adds the first watermark at the position where the second watermark deviates the preset distance;
in step S332, if the second watermark is not included, the server adds the first watermark to the target H5 page.
Specifically, when the presence of the second watermark is detected, a method of replacing the watermark may be adopted, that is, the second watermark is removed first, and then the first watermark is added. And during specific replacement, replacing the watermark content in the second watermark code with the watermark content of the first watermark. Or, the position of the watermark may be changed, that is, the first watermark may be added at a position where the second watermark is offset by a preset distance, so as to avoid overlapping the watermarks. At this time, if the content of the first watermark needs to be added, then under the body node, a tag name different from the tag of the second watermark is taken as the identifier of the first watermark, and the JS code of the first watermark is added, so that the adding position of the watermark in the JS code of the first watermark needs to be different from the position of the second watermark in order to avoid overlapping of the first watermark and the second watermark.
In some possible implementations, the step of determining whether the user has the right to add the watermark, which is performed in the previous embodiment section, may be further performed when the presence of the second watermark is detected. When the authority of adding the watermark is determined, the second watermark is removed, and the first watermark is added into the target H5 page, or the first watermark is directly added at the position of the second watermark offset by the preset distance; and when the watermark adding authority is determined not to exist, stopping the operation of adding the first watermark. Through the setting, on one hand, tampering of a second watermark by a non-authorized user can be avoided, and on the other hand, the problem of display disorder caused by excessive watermarks of the target H5 page due to the fact that the first watermark is added on the basis of the second watermark can also be avoided.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
by detecting whether a second watermark exists in the target H5 page or not, if the second watermark is included, the second watermark is removed first, and the first watermark is added to the target H5 page, or the first watermark is directly added to the position of the second watermark offset by a preset distance, and if the second watermark is not included, the first watermark is added to the target H5 page. The problem of watermark overlapping caused by adding a watermark when the target H5 page is shared is avoided.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 4, as an implementation of the method shown in fig. 2 or fig. 3, the present application provides an embodiment of a server, and as shown in fig. 4, a server 400 according to the embodiment includes:
a receiving module 410, configured to receive an indication message that is triggered and sent when a terminal monitors a sharing operation of a user on a target H5 page;
a determining module 420, configured to determine a preset first watermark in response to the indication message;
a watermark adding module 430, configured to add the first watermark in the target H5 page, so that the first watermark is displayed in the target H5 page when the target H5 page is rendered by a browser.
In some possible implementations of the embodiment of the present application, the watermarking module 430 is specifically configured to add the first watermark to the target H5 page by using the JS injection method.
In some possible implementations of the embodiment of the present application, the watermarking module 430 includes:
a splicing unit, configured to splice the first watermark and a preset watermark pattern code to generate a JS code, where the JS code is used to display the first watermark in the target H5 page when rendered by a browser;
the query unit is used for determining the HTML file of the target H5 page and traversing the content body of the HTML file;
and the editing unit is used for adding the JS code as a new label content to the content body.
In some possible implementations of the embodiment of the present application, the determining module 420 is specifically configured to, in response to the indication message, acquire identification information of the user or the owner of the target H5 page, and use the identification information as the first watermark.
In some possible implementations of the embodiment of the present application, the server 400 further includes:
the authority judging module is used for determining whether the user has the authority of adding the watermark;
a watermark adding module 430, configured to, when it is determined that the user has the right to add a watermark, add the first watermark to the target H5 page;
the server 400 further includes:
and the processing module is further used for not adding the first watermark in the target H5 page when the user is determined not to have the right of adding the watermark.
In some possible implementations of the embodiment of the present application, the server 400 further includes:
the watermark detection module is used for detecting whether a second watermark exists in the target H5 page;
a watermark adding module 430, configured to, if the second watermark may be included, remove the second watermark first, and add the first watermark to the target H5 page, or directly add the first watermark to a position where the second watermark is offset by a preset distance; if the second watermark cannot be included, the first watermark is added to the target H5 page.
In some possible implementations of the embodiment of the present application, the server 400 further includes:
and the watermark deleting module is used for timing after the first watermark is added, and removing the first watermark in the target H5 page after the preset time length is exceeded.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
in this embodiment, after the server 400 triggers the sent instruction message when the acquisition terminal responds that the user performs the sharing operation on the target H5 page, the server 400 may determine the preset first watermark in response to the instruction message. Thereafter, the server 400 adds the first watermark in the target H5 page so that the first watermark is displayed in the target H5 page when the target H5 page is rendered by a browser. Because the first watermark is added into the target H5 page as the identification information of the target H5 page, when the target H5 page is rendered by a browser, the first watermark can be displayed in the target H5 page, and the traceability of the target H5 page is realized, so that compared with the unlimited sharing operation in the prior art, the information security problem caused by sharing the target H5 page can be effectively reduced.
In order to solve the technical problem, an embodiment of the present application further provides a computer device. Referring to fig. 5, fig. 5 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 500 includes a memory 510, a processor 520, and a network interface 530 communicatively coupled to each other via a system bus. It is noted that only the computer device 500 having the components 510 and 530 is shown, but it is understood that not all of the shown components are required and that more or fewer components can alternatively be implemented. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch panel or voice control equipment and the like.
The memory 510 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 510 may be an internal storage unit of the computer device 500, such as a hard disk or a memory of the computer device 500. In other embodiments, the memory 510 may also be an external storage device of the computer device 500, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 500. Of course, the memory 510 may also include both internal and external memory units of the computer device 500. In this embodiment, the memory 510 is generally used for storing computer readable instructions of an operating system and various types of application software installed on the computer device 500, such as a watermarking method of H5 page. The memory 510 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 520 may be a Central Processing Unit (CPU), a controller, a microcontroller, a microprocessor, or other data Processing chip in some embodiments. The processor 520 is generally used to control the overall operation of the computer device 500. In this embodiment, the processor 520 is configured to execute computer readable instructions stored in the memory 510 or process data, for example, execute computer readable instructions of the watermarking method for the H5 page.
The network interface 530 may include a wireless network interface or a wired network interface, and the network interface 530 is generally used to establish a communication connection between the computer device 500 and other electronic devices.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
in the embodiment of the application, after the obtaining terminal triggers the sent indication message when responding to the sharing operation of the user on the target H5 page, the server may determine the preset first watermark in response to the indication message. Then, the server adds the first watermark in the target H5 page, so that the first watermark is displayed in the target H5 page when the target H5 page is rendered by a browser. Because the first watermark is added into the target H5 page as the identification information of the target H5 page, when the target H5 page is rendered by a browser, the first watermark can be displayed in the target H5 page, and the traceability of the target H5 page is realized, so that compared with the unlimited sharing operation in the prior art, the information security problem caused by sharing the target H5 page can be effectively reduced.
The present application further provides another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the watermarking method of the H5 page as described above.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
in the embodiment of the application, after the obtaining terminal triggers the sent indication message when responding to the sharing operation of the user on the target H5 page, the server may determine the preset first watermark in response to the indication message. Then, the server adds the first watermark in the target H5 page, so that the first watermark is displayed in the target H5 page when the target H5 page is rendered by a browser. Because the first watermark is added into the target H5 page as the identification information of the target H5 page, when the target H5 page is rendered by a browser, the first watermark can be displayed in the target H5 page, and the traceability of the target H5 page is realized, so that compared with the unlimited sharing operation in the prior art, the information security problem caused by sharing the target H5 page can be effectively reduced.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.

Claims (10)

1. A watermarking method for H5 pages is characterized by comprising the following steps:
the method comprises the steps that when a server receiving terminal monitors sharing operation of a user on a target H5 page, a sent indication message is triggered;
the server responds to the indication message and determines a preset first watermark;
the server adds the first watermark in the target H5 page so that the first watermark is displayed in the target H5 page when the target H5 page is rendered by a browser.
2. The method for watermarking H5 pages according to claim 1, wherein the step of the server watermarking the first watermark in the target H5 page comprises:
and the server adds the first watermark in the target H5 page by adopting a JS injection method.
3. The method for watermarking the H5 page according to claim 2, wherein the step of the server watermarking the first watermark in the target H5 page by using JS injection comprises:
the server splices the first watermark and a preset watermark pattern code to generate a JS code, and the JS code is used for displaying the first watermark in the target H5 page when being rendered by a browser;
the server determines an HTML file of the target H5 page and traverses the content body of the HTML file;
and the server adds the JS code as a new tag content to the content body.
4. The watermarking method for the H5 page according to any one of claims 1-3, wherein the step of the server responding to the indication message to determine the preset first watermark includes:
and the server responds to the indication message, acquires the identity identification information of the user or the target H5 page owner, and takes the identity identification information as the first watermark.
5. The method for watermarking the H5 page according to any one of claims 1-3, wherein after the step of triggering the sent indication message when the server acquisition terminal responds to the user to share the target H5 page, the method for watermarking the H5 page further comprises:
the server determining whether the user has the right to add the watermark;
the step of adding, by the server, the first watermark in the target H5 page includes:
the server adds the first watermark in the target H5 page when determining that the user has the right to add the watermark;
the watermarking method for the H5 page further comprises the following steps:
the server does not add the first watermark in the target H5 page upon determining that the user does not have the right to add a watermark.
6. The watermarking method of the H5 page according to claim 2 or 3, wherein after the step of the server determining a preset first watermark in response to the indication message, the watermarking method of the H5 page further comprises:
the server detects whether a second watermark already exists in the target H5 page;
the step of adding, by the server, the first watermark in the target H5 page includes:
if the second watermark is included, the server firstly removes the second watermark and adds the first watermark in the target H5 page, or the server directly adds the first watermark at the position where the second watermark deviates a preset distance;
and if the second watermark is not included, the server adds the first watermark in the target H5 page.
7. The method for watermarking the H5 page according to claim 1, wherein the server adds the first watermark in the target H5 page so that when the target H5 page is rendered by a browser, the method for watermarking the H5 page further comprises, after the step of displaying the first watermark in the target H5 page:
and the server performs timing after the first watermark is added, and removes the first watermark in the target H5 page after the preset time length is exceeded.
8. A server, comprising:
the receiving module is used for triggering the sent indication message when the terminal monitors the sharing operation of the user on the target H5 page;
a determining module, configured to determine a preset first watermark in response to the indication message;
a watermark adding module, configured to add the first watermark in the target H5 page, so that when the target H5 page is rendered by a browser, the first watermark is displayed in the target H5 page.
9. A computer device comprising a memory having stored therein computer readable instructions which, when executed by a processor, implement the steps of the method of watermarking H5 pages as defined in any one of claims 1 to 7.
10. A computer readable storage medium, having stored thereon computer readable instructions which, when executed by a processor, carry out the steps of the method of watermarking H5 pages according to any one of claims 1 to 7.
CN202110726227.4A 2021-06-29 2021-06-29 H5 page watermarking method, server, computer equipment and storage medium Active CN113326462B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110726227.4A CN113326462B (en) 2021-06-29 2021-06-29 H5 page watermarking method, server, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110726227.4A CN113326462B (en) 2021-06-29 2021-06-29 H5 page watermarking method, server, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113326462A true CN113326462A (en) 2021-08-31
CN113326462B CN113326462B (en) 2024-01-16

Family

ID=77425149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110726227.4A Active CN113326462B (en) 2021-06-29 2021-06-29 H5 page watermarking method, server, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113326462B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170334234A1 (en) * 2016-05-19 2017-11-23 Atlanta DTH, Inc. System and Method for Identifying the Source of Counterfeit Copies of Multimedia Works Using Layered Simple Digital Watermarks
US10127247B1 (en) * 2017-09-11 2018-11-13 American Express Travel Related Services Company, Inc. Linking digital images with related records
CN111488559A (en) * 2020-04-10 2020-08-04 腾讯科技(深圳)有限公司 Webpage watermark generation method and device, computer equipment and storage medium
CN111698237A (en) * 2020-06-05 2020-09-22 浙江华途信息安全技术股份有限公司 Method and system for adding watermark to WEB page
CN111931135A (en) * 2020-08-27 2020-11-13 北京明朝万达科技股份有限公司 Method and device for adding watermark
CN112434328A (en) * 2019-08-26 2021-03-02 钉钉控股(开曼)有限公司 Message forwarding method, mail forwarding method and electronic equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170334234A1 (en) * 2016-05-19 2017-11-23 Atlanta DTH, Inc. System and Method for Identifying the Source of Counterfeit Copies of Multimedia Works Using Layered Simple Digital Watermarks
US10127247B1 (en) * 2017-09-11 2018-11-13 American Express Travel Related Services Company, Inc. Linking digital images with related records
CN112434328A (en) * 2019-08-26 2021-03-02 钉钉控股(开曼)有限公司 Message forwarding method, mail forwarding method and electronic equipment
CN111488559A (en) * 2020-04-10 2020-08-04 腾讯科技(深圳)有限公司 Webpage watermark generation method and device, computer equipment and storage medium
CN111698237A (en) * 2020-06-05 2020-09-22 浙江华途信息安全技术股份有限公司 Method and system for adding watermark to WEB page
CN111931135A (en) * 2020-08-27 2020-11-13 北京明朝万达科技股份有限公司 Method and device for adding watermark

Also Published As

Publication number Publication date
CN113326462B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
CN111414334A (en) File fragment uploading method, device, equipment and storage medium based on cloud technology
CN108073828B (en) Webpage tamper-proofing method, device and system
US20140222947A1 (en) Method and apparatus for browsings webpages, and storage medium
CN103051733B (en) Data downloading method, terminal and system
WO2014186489A2 (en) Enhanced links in curation and collaboration applications
CN104243273A (en) Method and device for displaying information on instant messaging client and information display system
CN110471709B (en) Method, device, medium and electronic equipment for accelerating webpage opening speed
WO2023093673A1 (en) Information processing method, apparatus and system, and storage medium
US11080322B2 (en) Search methods, servers, and systems
CN113452579B (en) H5 page loading method and device, computer equipment and storage medium
CN112631910A (en) Front-end testing method and device, computer equipment and storage medium
CN105808307B (en) Page display method and device
CN112183045A (en) Online document processing method and device and electronic equipment
CN111381819B (en) List creation method and device, electronic equipment and computer-readable storage medium
CN111797297B (en) Page data processing method and device, computer equipment and storage medium
CN112187622B (en) Instant message display method and device and server
CN112860662A (en) Data blood relationship establishing method and device, computer equipment and storage medium
CN112416496A (en) Page display method and device and storage medium
CN113326462B (en) H5 page watermarking method, server, computer equipment and storage medium
CN113283759B (en) Account risk portrait updating method, device, equipment and storage medium
CN116304403A (en) Webpage access method and device, computer equipment and storage medium
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
CN115203672A (en) Information access control method and device, computer equipment and medium
CN114090066A (en) User interface card view generation method and device, computer equipment and medium
CN110704157B (en) Application starting method, related device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20231214

Address after: 518000 A210A, Floor 2, Shanshui Building, Nanshan Yungu Innovation Industrial Park, No. 4093, Liuxian Avenue, Pingshan Community, Taoyuan Street, Nanshan District, Shenzhen, Guangdong Province

Applicant after: Shenzhen Merit Creation Network Technology Co.,Ltd.

Address before: 518000 Room 202, block B, aerospace micromotor building, No.7, Langshan No.2 Road, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: Shenzhen LIAN intellectual property service center

Effective date of registration: 20231214

Address after: 518000 Room 202, block B, aerospace micromotor building, No.7, Langshan No.2 Road, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen LIAN intellectual property service center

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: PING AN PUHUI ENTERPRISE MANAGEMENT Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant