CN113326462B - 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
CN113326462B
CN113326462B CN202110726227.4A CN202110726227A CN113326462B CN 113326462 B CN113326462 B CN 113326462B CN 202110726227 A CN202110726227 A CN 202110726227A CN 113326462 B CN113326462 B CN 113326462B
Authority
CN
China
Prior art keywords
watermark
page
target
server
indication message
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.)
Active
Application number
CN202110726227.4A
Other languages
Chinese (zh)
Other versions
CN113326462A (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
Shenzhen Merit Creation Network Technology 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 Shenzhen Merit Creation Network Technology Co ltd filed Critical Shenzhen Merit Creation Network Technology 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

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 of an H5 page, which comprises the following steps: the server receives an indication message which is triggered to be sent when the terminal monitors the sharing operation of the user on the target H5 page; the server side responds to the indication message and determines a preset first watermark; and 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. The application also provides a server, computer equipment and a storage medium.

Description

H5 page watermarking method, server, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of H5 pages, and in particular, to a watermark adding method, a server, a computer device, and a storage medium for an H5 page.
Background
The sharing function is a common function of various APP at present, for example, can share pictures, share H5 page links, share video and other network resources.
However, in some scenarios, unrestricted sharing of network resources may pose some information security issues. For example, a user uploads an identification card for rental or loan use through an H5 page of an APP. If another user opens the page and shares the page, the sharing action may cause the identity information of the previous user to be acquired by other people for other purposes, thereby causing information security problem.
From the above, how to reduce the information security problem possibly existing in the process of sharing the H5 page is a technical problem yet to be solved at present.
Disclosure of Invention
The embodiment of the application aims to provide a watermark adding method, a server, computer equipment and a storage medium of an H5 page, so as to solve the possible information security problem in the sharing process of the H5 page.
In order to solve the above technical problems, the embodiments of the present application provide a watermark adding method for an H5 page, which adopts the following technical scheme:
the watermarking method of the H5 page can comprise the following steps:
the server receives an indication message which is triggered to be sent when the terminal monitors the sharing operation of the user on the target H5 page;
the server responds to the indication message to determine 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 the browser.
In some possible implementations of the application embodiments, the step of adding the first watermark to the target H5 page by the server may include:
the server adds the first watermark in the target H5 page by adopting a JS injection method.
In some possible implementations of the application embodiment, the step of adding the first watermark to the target H5 page by the server using JS injection method may include:
the server splices the first watermark with a preset watermark pattern code to generate a section of 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;
the server adds the JS code to the content body as a new tag content.
In some possible implementations of the application embodiments, the step of determining, by the server, the preset first watermark in response to the indication message may include:
and the server responds to the indication message to acquire the identity information of the user or the target H5 page owner, and takes the identity information as the first watermark.
In some possible implementations of the application embodiment, after the step of triggering the sent indication message when the server obtains the terminal in response to the user performing the sharing operation on the target H5 page, the watermarking method of the H5 page may further include:
The server determines whether the user has the right to add the watermark;
the step of adding the first watermark to the target H5 page by the server may include:
when the server determines that the user has the right of adding the watermark, adding the first watermark in the target H5 page;
the watermarking method of the H5 page can further comprise the following steps:
the server does not add the first watermark in the target H5 page when it determines that the user does not have the right to add the watermark.
In some possible implementations of the application embodiments, after the step of determining the preset first watermark by the server in response to the indication message, the watermarking method of the H5 page may further include:
the server detects whether a second watermark exists in the target H5 page;
the step of adding the first watermark to the target H5 page by the server 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 the position of the second watermark offset by a preset distance;
if the second watermark cannot be included, the server adds the first watermark to the target H5 page.
In some possible implementations of the application embodiments, the server adds the first watermark to the target H5 page, so that when the target H5 page is rendered by the browser, after the step of displaying the first watermark in the target H5 page, the watermark adding method of the H5 page may further include:
and after the first watermark is added, the server counts time, and after the preset time length is exceeded, the first watermark in the target H5 page is removed.
In order to solve the above technical problems, the embodiments of the present application further provide a server, which adopts the following technical schemes:
a server may include:
the receiving module is used for sending an indication message to the server when the sharing operation of the user on the target H5 page is monitored;
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 embodiments of the present application, the watermark adding module is specifically configured to add the first watermark to the target H5 page by using a JS injection method.
In some possible implementations of the embodiments of the present application, the watermarking module includes:
the splicing unit is used for splicing the first watermark with a preset watermark pattern code to generate a section of 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 query unit is used for determining an 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 tag content to the content body.
In some possible implementations of the embodiments of the present application, the determining module is specifically configured to obtain, in response to the indication message, 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 embodiments of the present application, the server further includes:
the permission judging module is used for determining whether the user has the permission of adding the watermark;
the watermark adding module is specifically configured to add the first watermark in the target H5 page when it is determined that the user has the right to add the watermark;
the server further includes:
and the processing module is also used for not adding the first watermark in the target H5 page when the user is determined to not have the right of adding the watermark.
In some possible implementations of the embodiments 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 or not;
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 at a position where the second watermark deviates from 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 embodiments 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 problems, the embodiments of the present application further provide a computer device, which adopts the following technical schemes:
a computer device may include a memory having stored therein computer readable instructions which when executed by the processor implement the steps of the watermarking method of H5 pages as described above.
In order to solve the above technical problems, embodiments of the present application further provide a computer readable storage medium, which adopts the following technical solutions:
a computer readable storage medium having stored thereon computer readable instructions which when executed by a processor perform the steps of a method of watermarking an H5 page as described above.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
in this embodiment of the present application, after the terminal triggers the sent indication message when the terminal responds to the user to perform the sharing operation on the target H5 page, the server may determine the preset first watermark in response to the indication message. And 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 the browser. As the first watermark is added in the target H5 page and is used as the identification information of the target H5 page, when the target H5 page is rendered by the browser, the first watermark can be displayed in the target H5 page, so that traceability of the target H5 page is realized, and compared with unlimited sharing operation in the prior art, the information security problem caused by sharing the target H5 page can be effectively reduced.
Drawings
For a clearer description of the solution in the present application, a brief description will be given below of the drawings that are needed in the description of the embodiments of the present application, it being obvious that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained from these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is an exemplary system architecture diagram in which the present application may be applied;
FIG. 2 is a flow chart of one embodiment of a watermarking method for an H5 page according to the present application;
FIG. 3 is a flow chart of yet another embodiment of a watermarking method for 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 schematic structural 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 applications herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "comprising" and "having" and any variations thereof in the description and claims of the present application and in the description of the figures above are intended to cover non-exclusive inclusions. The terms first, second and the like in the description and in the claims or in the above-described figures, are used for distinguishing between different objects and not necessarily for describing a sequential or chronological order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present application. The appearances of such phrases 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. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
In order to better understand the technical solutions of the present application, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings.
As shown in fig. 1, a system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, among others.
The user may interact with the server 105 via the network 104 using the terminal devices 101, 102, 103 to receive or send messages or the like. Various communication terminal applications, such as a web browser application, a shopping class application, a search class application, an instant messaging tool, a mailbox terminal, social platform software, and the like, may be installed on the terminal devices 101, 102, 103.
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, electronic book readers, MP3 players (Moving Picture ExpertsGroup Audio Layer III, dynamic video expert compression standard audio plane 3), MP4 (Moving PictureExperts Group Audio Layer IV, dynamic video expert compression standard audio plane 4) players, laptop and 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 of the H5 page provided in the embodiments of the present application is generally executed 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 continued reference to fig. 2, a flow chart of one embodiment of a watermarking method for an 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 receives an indication message triggered to be sent when the terminal monitors the sharing operation of the user on the target H5 page.
In this embodiment of the present application, the terminal may be terminal devices 101, 102 or 103 in the architecture shown in fig. 1, and the sharing operation, or forwarding operation, of the target H5 page refers to operations such as forwarding or sharing performed on a link of the target H5 page after a user clicks a sharing or forwarding button after opening the target H5 page. The target H5 page may be a specific page set in advance, and when the terminal responds to the user to share the target H5 page, the terminal triggers to send an indication message to a server storing the source file of the target H5 page, where the indication message may include 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 present application, the first watermark may be a preset text watermark or a picture watermark.
In some possible implementations of the embodiments of the present application, to improve the security of sharing of the target H5 page, the first watermark may be the identity information of the owner of the target H5 page or the identity information of the current user. The process of obtaining the identification information may include: and inquiring and acquiring 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 to the target H5 page, so that the first watermark is displayed in the target H5 page when the target H5 page is rendered by the browser.
In this embodiment of the present application, after the first watermark is obtained, the link address information in the indication message may be queried to determine the target H5 page, and then, according to a preset watermark adding rule, the first watermark is added at a predetermined position of the target H5 page, which is used as identification information of the target H5 page, so that when the target H5 page is rendered by the browser, the first watermark may be displayed in the target H5 page. In the watermark adding rule, information such as adding position, transparency, color and the like of the watermark can be indicated.
In some possible implementations of the embodiments 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, a method of JS injection may be adopted for the source file of the target H5 page, and the first watermark may be added.
In some possible implementations of the embodiments of the present application, the step of adding the first watermark to the target H5 page by using the JS injection method includes: the server splices the first watermark with a preset watermark pattern code to generate a section of JS code, and the JS code is used for displaying the first watermark in a target H5 page when being rendered by a 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 through JS injection may include: after the first watermark is acquired, the first watermark and a preset watermark pattern code are spliced to generate a section of JS code comprising the first watermark. If the first watermark is a text, the text 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 into the target H5 page as a new child node or new child tag content under the body. Thus, the shared target H5 page integrates the watermark, and other users can see the first watermark through browser rendering when opening the link of the shared target H5 page. The watermark pattern code may be set with information such as content and pattern of the watermark to be displayed. For example, specific content of the watermark pattern code may include the following: watermark content to be displayed, transparency, inclination, size, etc.
Further, adding the JS code to the content body of the HTML file may include: in a document object, i.e., an HTML file, taken to a web view, the body attribute of the document object is acquired, and then the tag content of the JS code is added to the body as a child node using an addChild tool.
In some possible implementations of the embodiments of the present application, in step S210, after the step of triggering the sent indication message when the 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 further includes: it is determined whether the user has the right to add the watermark. Step S230, adding the 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, including: and if the requirement is determined, acquiring a preset first watermark. And after determining whether the user has the right to add the watermark, the watermarking method of the H5 page further comprises the following steps: and when the server determines that the user does not have the right of watermarking, the first watermark is not added in the target H5 page.
Specifically, when determining 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 added with a watermark, and then a preset first watermark is obtained. Specifically, two user types may be set: a first type of user with watermarking rights and a second type of user without watermarking rights, thereby determining whether the target H5 page requires watermarking by determining the type of the current user. The first type of user can be the creator of the target H5 page or the user with the modification authority or the specific user with the setting joining, and the second type of user is the other user with the read-only authority. The corresponding relation between the user identifier and the user type can be set in the system, for example, a user name list with watermark adding authority to the target H5 page is saved, and the user type of the current user is determined according to the corresponding relation.
By referring to the description, by setting the authority, the watermark in the target H5 page can be prevented from being added by the non-authority user, and the information security problem possibly caused by adding the watermark of the non-authority user into the target H5 page is avoided. For example, a recruiter uploads personal identity information on a resume page of a recruitment APP, the account number of the recruiter is a first type user, and the other account numbers are second type users. When the resume page of the recruiter is opened and shared, the watermark set by the recruiter is added through judgment and determination, and when the resume page of the recruiter is opened and shared by a user of other accounts, the watermark of the user is not required to be added through judgment and determination.
In some possible implementations of the embodiments of the present application, in the foregoing step, after the target H5 page addition completes the first watermark, the method for adding a watermark to the 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, when the first watermark is deleted, the JS code corresponding to the first watermark under the HTML file body node of the H5 page may be queried by using the tag name or the element name, and deleting the code segment may be implemented to delete the first watermark.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
in this embodiment of the present application, after the terminal triggers the sent indication message when the terminal responds to the sharing operation performed on the target H5 page by the user, the preset first watermark may be determined in response to the indication message. And then 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. As the first watermark is added in the target H5 page and is used as the identification information of the target H5 page, when the target H5 page is rendered by the browser, the first watermark can be displayed in the target H5 page, so that traceability of the target H5 page is realized, and compared with 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 embodiments of the present application, referring specifically to fig. 3, a further embodiment of a watermarking method for an H5 page according to the embodiments of the present application is shown. Wherein, in step S220, after determining the preset first watermark in response to the indication message, the watermarking method of the H5 page further includes:
In step S310, the server detects whether a second watermark is already present in the target H5 page.
Specifically, in some cases, if the target H5 page already has a watermark, in order to avoid the watermark overlapping caused by the subsequent re-adding of the watermark, it may be detected whether the target H5 page already has a second watermark after the first watermark is obtained. The watermark may be preset to have a specific identifier, and whether the target H5 page already has the second watermark is determined by querying whether the identifier exists in the file of the target H5 page. For example, for the JS injection mode, a first watermark of the target H5 page may be set, where the name corresponding to the sub-tag under the body attribute of the HTML source file is watermark01, and a second watermark of the target H5 page, where the sub-tag name is watermark02, and so on. If the fact that the mark of the 'watermark' exists in the file of the target H5 page is inquired, the second watermark is determined to exist, otherwise, the second watermark is determined not to exist.
Step S230, the server adds a 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, including:
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 of the second watermark offset by 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 existence of the second watermark is detected, a method for replacing the watermark may be adopted, that is, the second watermark is removed first, and then the first watermark is added. And in the specific replacement, replacing the watermark content in the second watermark code with the watermark content of the first watermark. Alternatively, the watermark position may be changed, that is, the first watermark may be added at a position offset by a predetermined distance from the second watermark, so as to avoid watermark overlapping. At this time, if the content of the first watermark needs to be added, a tag name different from the tag of the second watermark may be taken as the identifier of the first watermark under the body node, and the JS code of the first watermark is added.
In some possible implementations, the step of determining whether the user has the right to add the watermark performed in the previous embodiment section may be further performed upon detecting the presence of the second watermark. When the permission of adding the watermark is determined, the second watermark is removed, and the first watermark is added in the target H5 page, or the first watermark is directly added at the position of the second watermark offset by a preset distance; when it is determined that the watermarking right does not exist, the operation of adding the first watermark is stopped. By the setting, on one hand, the tampering of a non-authority user to the second watermark can be avoided, and on the other hand, the problem of display confusion of a target H5 page caused by excessive watermarks because the first watermark is added on the basis of the second watermark can be avoided.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
and if the second watermark is not included, the first watermark is added in the target H5 page. The problem of watermark overlapping possibly caused by watermark adding during sharing of the target H5 page is avoided.
The subject application is operational with numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet 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.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by computer readable instructions stored in a computer readable storage medium that, when executed, may comprise the steps of the embodiments of the methods described above. The storage medium may be a nonvolatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (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, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
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, as shown in fig. 4, a server 400 according to this embodiment includes:
the receiving module 410 is configured to trigger a sent indication message when the receiving terminal monitors a sharing operation of the user on the target H5 page;
a determining module 420, configured to determine a preset first watermark in response to the indication message;
the watermark adding module 430 is configured to add the first watermark to the target H5 page, so that the first watermark is displayed in the target H5 page when the target H5 page is rendered by the browser.
In some possible implementations of the embodiments of the present application, the watermark adding module 430 is specifically configured to add the first watermark to the target H5 page by using a JS injection method.
In some possible implementations of embodiments of the present application, the watermarking module 430 includes:
the splicing unit is used for splicing the first watermark with a preset watermark pattern code to generate a section of 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 query unit is used for determining an 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 tag content to the content body.
In some possible implementations of the embodiments of the present application, the determining module 420 is specifically configured to obtain, in response to the indication message, identification information of the user or the owner of the target H5 page, where the identification information is used as the first watermark.
In some possible implementations of embodiments of the present application, the server 400 further includes:
the permission judging module is used for determining whether the user has the permission of adding the watermark;
the watermark adding module 430 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 the watermark;
the server 400 further includes:
and the processing module is also used for not adding the first watermark in the target H5 page when the user is determined to not have the right of adding the watermark.
In some possible implementations of embodiments 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 or not;
the watermark adding module 430 is specifically 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 at a position where the second watermark deviates from 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 embodiments 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 has the following main beneficial effects:
in this embodiment of the present application, after the server 400 triggers the sent indication message when the terminal responds to the user to perform the sharing operation on the target H5 page, the server 400 may determine the preset first watermark in response to the indication message. Then, the server 400 adds the first watermark to the target H5 page, so that the first watermark is displayed in the target H5 page when the target H5 page is rendered by the browser. As the first watermark is added in the target H5 page and is used as the identification information of the target H5 page, when the target H5 page is rendered by the browser, the first watermark can be displayed in the target H5 page, so that traceability of the target H5 page is realized, and compared with 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 problems, the embodiment of the application also provides computer equipment. Referring specifically to fig. 5, fig. 5 is a basic structural block diagram 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 should be noted that only computer device 500 having components 510-530 is shown in the figures, but it should be understood that not all of the illustrated components need be implemented, and that more or fewer components may be implemented instead. It will be appreciated by those skilled in the art that the computer device herein is a device capable of automatically performing numerical calculations and/or information processing in accordance with predetermined or stored instructions, the hardware of which includes, but is not limited to, microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASICs), programmable gate arrays (fields-Programmable Gate Array, FPGAs), digital processors (Digital Signal Processor, DSPs), embedded devices, etc.
The computer equipment can be a desktop computer, a notebook computer, a palm computer, a cloud server and other computing equipment. The computer equipment can perform man-machine interaction with a user through a keyboard, a mouse, a remote controller, a touch pad or voice control equipment and the like.
The memory 510 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, 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 Card (Flash Card) or the like, which are provided on the computer device 500. Of course, the memory 510 may also include both internal storage units and external storage devices of the computer device 500. In this embodiment, the memory 510 is typically used to store an operating system installed on the computer device 500 and various application software, such as computer readable instructions of a watermarking method of H5 pages. In addition, the memory 510 may 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 (Central Processing Unit, CPU), controller, microcontroller, 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, such as computer readable instructions for executing the watermarking method of the H5 page.
The network interface 530 may include a wireless network interface or a wired network interface, the network interface 530 typically being 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 has the following main beneficial effects:
in this embodiment of the present application, after the terminal triggers the sent indication message when the terminal responds to the user to perform the sharing operation on the target H5 page, the server may determine the preset first watermark in response to the indication message. And 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 the browser. As the first watermark is added in the target H5 page and is used as the identification information of the target H5 page, when the target H5 page is rendered by the browser, the first watermark can be displayed in the target H5 page, so that traceability of the target H5 page is realized, and compared with 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 also provides another embodiment, namely, 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 H5 pages as described above.
Compared with the prior art, the embodiment of the application has the following main beneficial effects:
in this embodiment of the present application, after the terminal triggers the sent indication message when the terminal responds to the user to perform the sharing operation on the target H5 page, the server may determine the preset first watermark in response to the indication message. And 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 the browser. As the first watermark is added in the target H5 page and is used as the identification information of the target H5 page, when the target H5 page is rendered by the browser, the first watermark can be displayed in the target H5 page, so that traceability of the target H5 page is realized, and compared with unlimited sharing operation in the prior art, the information security problem caused by sharing the target H5 page can be effectively reduced.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
It is apparent that the embodiments described above are only some embodiments of the present application, but not all embodiments, the preferred embodiments of the present application are given in the drawings, but not limiting the patent scope of the present application. This application may be embodied in many different forms, but rather, embodiments are provided in order to provide a more thorough understanding of the present disclosure. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that modifications may be made to the embodiments described in the foregoing, or equivalents may be substituted for elements thereof. All equivalent structures made by the specification and the drawings of the application are directly or indirectly applied to other related technical fields, and are also within the protection scope of the application.

Claims (10)

1. A method for watermarking an H5 page, comprising the steps of:
the server receives an indication message which is triggered to be sent when the terminal monitors the sharing operation of the user on the target H5 page;
the server responds to the indication message to determine 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;
wherein after the step of determining the preset first watermark by the server in response to the indication message, the method comprises the following steps:
the server detects whether a second watermark exists in the target H5 page or not;
the step of adding the first watermark to the target H5 page by the server includes:
if the second watermark is included, the server firstly clears the second watermark and adds the first watermark to the target H5 page;
wherein the step of adding the first watermark to the target H5 page by the server includes:
after the first watermark is acquired, splicing the first watermark with a preset watermark pattern code to generate a section of JS code comprising the first watermark;
If the first watermark is a word, the word 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 JS codes are generated, the HTML file of the target H5 page is queried and determined by utilizing the link address information included in the indication message, the HTML file is further traversed to a content body of the HTML file, and a new child node under the JS codes body is buried in the target H5 page.
2. The H5 page watermarking method according to claim 1, wherein the step of adding the first watermark to the target H5 page by the server comprises:
and the server adds the first watermark in the target H5 page by adopting a JS injection method.
3. The H5 page watermarking method according to claim 2, wherein the step of adding the first watermark to the target H5 page by the server using JS injection method includes:
the server splices the first watermark with a preset watermark pattern code to generate a section of 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;
the server adds the JS code as a new tag content to the content body.
4. A method of watermarking an H5 page according to any of claims 1 to 3, wherein the step of the server determining a pre-set first watermark in response to the indication message comprises:
and the server responds to the indication message to acquire the identity information of the user or the target H5 page owner, and takes the identity information as the first watermark.
5. The method for watermarking an H5 page according to any one of claims 1 to 3, wherein after the step of triggering the sent indication message when the server obtains the terminal to perform the sharing operation on the target H5 page in response to the user, the method for watermarking an H5 page further comprises:
the server determines whether the user has the right to add the watermark;
the step of adding the first watermark to the target H5 page by the server includes:
the server adding the first watermark in the target H5 page when determining that the user has the right to add the watermark
The watermarking method of the H5 page further comprises the following steps:
and when the server determines that the user does not have the right of watermarking, the first watermark is not added in the target H5 page.
6. A method of watermarking an 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 method of watermarking an H5 page further comprises:
the server detects whether a second watermark exists in the target H5 page or not;
the step of adding the first watermark to the target H5 page by the server includes:
if the second watermark is included, the server firstly removes the second watermark and adds the first watermark to the target H5 page, or the server directly adds the first watermark at the position of the second watermark offset by a preset distance;
and if the second watermark is not included, the server adds the first watermark in the target H5 page.
7. The H5 page watermarking method according to claim 1, wherein the server adds the first watermark in the target H5 page such that when the target H5 page is rendered by a browser, the H5 page watermarking method further comprises, after the step of displaying the first watermark in the target H5 page:
And after the first watermark is added, the server counts time, and after the preset time length is exceeded, the first watermark in the target H5 page is removed.
8. A server, comprising:
the receiving module is used for triggering the sent indication message when the receiving 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;
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;
wherein, the server further includes:
the watermark detection module is used for detecting whether a second watermark exists in the target H5 page or not;
the watermark adding module is specifically configured to, if the second watermark is included, remove the second watermark first, and add the first watermark to the target H5 page;
the watermark adding module is specifically configured to splice the first watermark with a preset watermark pattern code to generate a section of JS code including the first watermark after the first watermark is acquired; if the first watermark is a word, the word 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 JS codes are generated, the HTML file of the target H5 page is queried and determined by utilizing the link address information included in the indication message, the HTML file is further traversed to a content body of the HTML file, and a new child node under the JS codes body is buried in the target H5 page.
9. A computer device comprising a memory having stored therein computer readable instructions which when executed by the processor implement the steps of the watermark adding method for an H5 page as claimed 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 implement the steps of the watermarking method of an H5 page according to any 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 CN113326462A (en) 2021-08-31
CN113326462B true 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 (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017201251A1 (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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN113326462A (en) 2021-08-31

Similar Documents

Publication Publication Date Title
CN108073828B (en) Webpage tamper-proofing method, device and system
CN103051733B (en) Data downloading method, terminal and system
US20140222947A1 (en) Method and apparatus for browsings webpages, and storage medium
CN111414407A (en) Data query method and device of database, computer equipment and storage medium
EP3176719B1 (en) Methods and devices for acquiring certification document
CN113452579B (en) H5 page loading method and device, computer equipment and storage medium
CN113254445B (en) Real-time data storage method, device, computer equipment and storage medium
WO2021184896A1 (en) Page screenshot method and device
CN112183045A (en) Online document processing method and device and electronic equipment
CN111797297B (en) Page data processing method and device, computer equipment 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
CN113364915B (en) Information display method and device and electronic equipment
EP3616092A1 (en) Media sharing based on identified physical objects
CN108509229A (en) Method, terminal device and the computer readable storage medium of the cross-domain control of window
CN107749892B (en) Network reading method and device for conference record, intelligent tablet and storage medium
CN116521630B (en) Task progress real-time display method and device, computer equipment and storage medium
CN116206032A (en) Task verification method, device, computer equipment and medium thereof
CN103207966A (en) Method and system for management of information safety
CN117851014A (en) Application program calling method and device, computer equipment and storage medium
CN116467145A (en) Page performance data acquisition method and device, computer equipment and storage medium
CN106951478B (en) Data processing method and device
US20110138009A1 (en) Methods, Systems and Computer Program Products for Tracking Creations on the Internet
CN111209459A (en) Information processing method, information processing device, electronic equipment and storage 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
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.

GR01 Patent grant
GR01 Patent grant