CN112926034A - Watermark processing method and device - Google Patents

Watermark processing method and device Download PDF

Info

Publication number
CN112926034A
CN112926034A CN202110327646.0A CN202110327646A CN112926034A CN 112926034 A CN112926034 A CN 112926034A CN 202110327646 A CN202110327646 A CN 202110327646A CN 112926034 A CN112926034 A CN 112926034A
Authority
CN
China
Prior art keywords
target
attribute information
watermark
webpage
modified
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.)
Pending
Application number
CN202110327646.0A
Other languages
Chinese (zh)
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202110327646.0A priority Critical patent/CN112926034A/en
Publication of CN112926034A publication Critical patent/CN112926034A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Technology Law (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a watermark processing method and a watermark processing device, wherein when a target watermark is detected to be added in a target webpage, preset attribute information of the target watermark in the target webpage is acquired; converting preset attribute information into target attribute information; monitoring the target attribute information to determine whether the target watermark is modified in the target webpage; and when the target watermark is determined to be modified in the target webpage, modifying the target watermark to be in an initial state. Based on the processing, the preset attribute information of the target watermark is converted into the target attribute information, and a malicious user cannot acquire the target attribute information, so that the malicious user can be prevented from acquiring the target attribute information of the target watermark and modifying the target watermark through the target attribute information. The target watermark can be modified to the initial state when the target watermark is detected to be modified, namely, the modification of the target watermark by a malicious user can be restored so as to protect the watermark in the webpage, and further, the safety of the webpage can be improved.

Description

Watermark processing method and device
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a watermark processing method and apparatus.
Background
A watermark refers to an identifier (e.g., text, picture, etc.) added to a file (e.g., video, web page, picture, etc.) to represent copyright information of the file. For example, in order to protect the copyright of a video, the copyright information of the video may be added to a video playing web page as a watermark.
However, a malicious user may modify or delete the watermark in the web page, for example, the malicious user may delete the watermark in the video playing web page and perform a screen recording operation in the video playing web page to obtain a video without copyright information. When the watermark in the web page is modified, the copyright of the information displayed in the web page cannot be protected, so that the watermark in the web page needs to be protected to prevent the watermark in the web page from being tampered, and the security of the web page is improved.
Disclosure of Invention
The embodiment of the invention aims to provide a watermark processing method and a watermark processing device, which can protect watermarks in a webpage and improve the safety of the webpage. The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a watermarking method, including:
when a target watermark is detected to be added in a target webpage, acquiring preset attribute information of the target watermark in the target webpage; the preset attribute information is used for representing information calling of the target watermark in the target webpage;
converting the preset attribute information into target attribute information; the target attribute information and the preset attribute information have a preset corresponding relation;
monitoring the target attribute information to determine whether the target watermark is modified in the target webpage;
when the target watermark is determined to be modified in the target webpage, modifying the target watermark to an initial state.
Optionally, the method further includes:
when a target event is monitored, displaying preset information except a developer tool page; wherein the target event represents that a user triggers a target control in the target webpage; the target controls represent controls for displaying the developer tools page based on an original configuration of a target web page.
Optionally, the monitoring the target attribute information to determine whether the target watermark is modified in the target webpage includes:
detecting whether attribute information to be processed with changed parameter values exists in target attribute information recorded in a first HTML source code corresponding to the target watermark;
and when the attribute information to be processed with the changed parameter value exists in the target attribute information recorded in the first HTML source code, determining that the target watermark is modified in the target webpage.
Optionally, modifying the target watermark to an initial state when it is determined that the target watermark is modified in the target webpage includes:
acquiring initial parameter values of the attribute information to be processed;
modifying the current parameter value of the attribute information to be processed recorded in the first HTML source code into the initial parameter value of the attribute information to be processed;
and rendering in the target webpage according to the modified first HTML source code to obtain the target watermark in the initial state.
Optionally, modifying the target watermark to an initial state when it is determined that the target watermark is modified in the target webpage includes:
generating a second HTML source code corresponding to the target watermark; wherein, the second HTML source code records the initial parameter value of the target attribute information of the target watermark;
and rendering in the target webpage according to the second HTML source code to obtain the target watermark in the initial state.
Optionally, the detecting whether there is attribute information to be processed whose parameter value changes in the target attribute information recorded in the first HTML source code corresponding to the target watermark includes:
monitoring whether a modified target field exists in a field corresponding to a parameter value of target attribute information in the first HTML source code through an element Observer Mutation Observer;
if the modified target field exists, determining attribute information corresponding to the target field, wherein the attribute information is attribute information to be processed with changed parameter values;
and if the modified target field does not exist, determining that the attribute information to be processed with the changed parameter value does not exist.
Optionally, the target attribute information includes: identification information, style information, and content information; the fields corresponding to the identification information comprise an identity id field and a type class field; the field corresponding to the style information comprises an attribute field; the fields corresponding to the content information include a child element child list field and a child node subtree field.
In a second aspect of the present invention, there is also provided a watermark processing apparatus, including:
the acquisition module is used for acquiring preset attribute information of a target watermark in a target webpage when the target webpage is detected to be added with the target watermark; the preset attribute information is used for representing information calling of the target watermark in the target webpage;
the conversion module is used for converting the preset attribute information into target attribute information; the target attribute information and the preset attribute information have a preset corresponding relation;
a monitoring module, configured to monitor the target attribute information to determine whether the target watermark is modified in the target webpage;
and the modification module is used for modifying the target watermark into an initial state when the target watermark is determined to be modified in the target webpage.
Optionally, the apparatus further comprises:
the display module is used for displaying preset information except a developer tool page when a target event is monitored; wherein the target event represents that a user triggers a target control in the target webpage; the target controls represent controls for displaying the developer tools page based on an original configuration of a target web page.
Optionally, the monitoring module is specifically configured to detect whether there is attribute information to be processed whose parameter value changes in the target attribute information recorded in the first HTML source code corresponding to the target watermark;
and when the attribute information to be processed with the changed parameter value exists in the target attribute information recorded in the first HTML source code, determining that the target watermark is modified in the target webpage.
Optionally, the modification module is specifically configured to obtain an initial parameter value of the attribute information to be processed;
modifying the current parameter value of the attribute information to be processed recorded in the first HTML source code into the initial parameter value of the attribute information to be processed;
and rendering in the target webpage according to the modified first HTML source code to obtain the target watermark in the initial state.
Optionally, the modifying module is specifically configured to generate a second HTML source code corresponding to the target watermark; wherein, the second HTML source code records the initial parameter value of the target attribute information of the target watermark;
and rendering in the target webpage according to the second HTML source code to obtain the target watermark in the initial state.
Optionally, the monitoring module is specifically configured to monitor, by using the element viewer multicast Observer, whether a modified target field exists in a field corresponding to a parameter value of the target attribute information in the first HTML source code;
if the modified target field exists, determining attribute information corresponding to the target field, wherein the attribute information is attribute information to be processed with changed parameter values;
and if the modified target field does not exist, determining that the attribute information to be processed with the changed parameter value does not exist.
Optionally, the target attribute information includes: identification information, style information, and content information; the fields corresponding to the identification information comprise an identity id field and a type class field; the field corresponding to the style information comprises an attribute field; the fields corresponding to the content information include a child element child list field and a child node subtree field.
In another aspect of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the steps of the watermark processing method when executing the program stored in the memory.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements any one of the above-mentioned watermarking methods.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-described watermarking methods.
The embodiment of the invention provides a watermark processing method, which comprises the steps of acquiring preset attribute information of a target watermark in a target webpage when the target webpage is detected to be added with the target watermark; the preset attribute information is used for representing information calling of the target watermark in the target webpage; converting preset attribute information into target attribute information; the target attribute information and the preset attribute information have a preset corresponding relation; monitoring the target attribute information to determine whether the target watermark is modified in the target webpage; and when the target watermark is determined to be modified in the target webpage, modifying the target watermark to be in an initial state.
Based on the processing, the preset attribute information of the target watermark can be converted into the target attribute information, and a malicious user can be prevented from acquiring the target attribute information of the target watermark and modifying the target watermark through the target attribute information because the malicious user cannot acquire the target attribute information. In addition, the target watermark can be modified to the initial state when the target watermark is detected to be modified, namely, the modification of the target watermark by a malicious user can be restored, the watermark in the webpage can be protected, and further, the safety of the webpage can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a flowchart of a watermarking method provided in an embodiment of the present invention;
fig. 2 is a flowchart of another watermarking method provided in an embodiment of the present invention;
fig. 3 is a flowchart of another watermarking method provided in an embodiment of the present invention;
fig. 4 is a flowchart of another watermarking method provided in an embodiment of the present invention;
fig. 5 is a flowchart of another watermarking method provided in an embodiment of the present invention;
fig. 6 is a schematic diagram of a watermarking method provided in an embodiment of the present invention;
fig. 7 is a block diagram of a watermark processing apparatus provided in an embodiment of the present invention;
fig. 8 is a structural diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described below with reference to the drawings in the embodiments of the present invention.
In order to protect a watermark in a web page and improve security of the web page, referring to fig. 1, fig. 1 is a flowchart of a watermark processing method provided in an embodiment of the present invention, where the method is applied to an electronic device, and the method may include the following steps:
s101: when the target watermark is detected to be added in the target webpage, the preset attribute information of the target watermark in the target webpage is obtained.
The preset attribute information is used for representing information calling of the target watermark in the target webpage.
S102: and converting the preset attribute information into target attribute information.
And the target attribute information and the preset attribute information have a preset corresponding relation.
S103: and monitoring the target attribute information to determine whether the target watermark is modified in the target webpage.
S104: and when the target watermark is determined to be modified in the target webpage, modifying the target watermark to be in an initial state.
The watermark processing method provided by the embodiment of the invention can convert the preset attribute information of the target watermark into the target attribute information, and can prevent a malicious user from acquiring the target attribute information of the target watermark and modifying the target watermark through the target attribute information because the malicious user cannot acquire the target attribute information. In addition, the target watermark can be modified to the initial state when the target watermark is detected to be modified, namely, the modification of the target watermark by a malicious user can be restored, the watermark in the webpage can be protected, and further, the safety of the webpage can be improved.
In step S101, the target webpage may be any webpage displayed by the electronic device, and the target watermark is any watermark added to the target webpage. The preset attribute information of the target watermark in the target webpage is used for representing the information call of the target watermark in the target webpage.
For example, the preset attribute information may include: identification information, style information and content information of the target watermark. The identification information of the target watermark is recorded with the watermark identification of the target watermark. The pattern information records a pattern of the target watermark, for example, a color, a shape, a size, a number, a display position, and the like of the target watermark. The content information records content of the target watermark, for example, text content, picture content of pictures, and the like.
In step S102, a DOM (Text Object Model) tree corresponding to the target web page includes a plurality of nodes, each node of the DOM tree corresponds to the page content of the target web page, the target watermark corresponds to one node (which may be referred to as a watermark node) of the DOM tree, and the watermark node is an HTML (Hyper Text Markup Language) source code corresponding to the target watermark. The watermark identification of the target watermark is the node identification of the watermark node.
The watermark identification in the preset attribute information is fixed characters such as a watermark and a logo, which are commonly used, when a malicious user modifies the target watermark, a watermark node (namely, an HTML source code corresponding to the target watermark) needs to be determined in a DOM tree in a target webpage through the watermark identification of the target watermark, and then the HTML source code corresponding to the target watermark is modified to modify the target watermark.
Therefore, in order to prevent a malicious user from determining the HTML source code corresponding to the target watermark, the preset attribute information may be converted into the target attribute information. In one implementation, the parameter value of the identification information in the preset attribute information may be modified to a target parameter value, so as to obtain target attribute information of the target watermark.
In one implementation, the electronic device may generate a random string based on a preset random algorithm, and then modify a parameter value of the identification information in the preset attribute information into the generated random string, where the watermark of the target watermark is identified as the random string (i.e., the target parameter value).
The random algorithm may be an algorithm for generating a random string, for example, a math random algorithm.
Based on the processing, a malicious user can not know the watermark identification of the target watermark, and can be prevented from determining the HTML source code corresponding to the target watermark through the fixed watermark identification and modifying the target watermark compared with the fixed watermark identification, so that the safety of the webpage can be improved.
In another way, the electronic device may calculate the MD5 value of a preset character (watermark, logo, etc.) based on MD5(Message Digest Algorithm 5). Furthermore, the electronic device may modify a parameter value of the identification information in the preset attribute information to the calculated MD5 value, where the watermark of the target watermark is identified as the MD5 value of the preset character.
Based on the above processing, when a technician needs to adjust the target watermark, the MD5 value of the preset character may be calculated, and the HTML source code whose node identifier is the MD5 value is determined in the DOM tree corresponding to the target webpage, that is, the HTML source code corresponding to the target watermark. Furthermore, technicians can modify HTML source codes corresponding to the target watermarks to adjust the target watermarks, so that malicious users can be prevented from modifying the target watermarks, and the technicians can conveniently adjust the target watermarks.
In an embodiment of the present invention, when a malicious user modifies a target watermark in a target web page, a developer tool page needs to be opened in the target web page first, and the target watermark is modified through the developer tool page. Therefore, in order to prevent the target watermark from being modified, the method may further comprise the steps of:
when the target event is monitored, preset information except for the developer tool page is displayed.
The target event represents that a user triggers a target control in a target webpage; the target controls represent controls for displaying the developer tools page based on the original configuration of the target web page.
In one implementation, in order to prevent a malicious user from entering a developer tool page, a target watermark is deleted or modified through the developer tool page, and a technician may unbind a corresponding relationship between a target event and a display developer tool page in an original configuration of a target web page and bind the target event and display preset information in the original configuration of the target web page, where the preset information is information other than the developer tool page. Furthermore, when the electronic device monitors the target event, the electronic device does not display the developer tool page but displays the preset information.
It can be understood that the preset information may be blank information, that is, a technician may modify the correspondence relationship to indicate that the target event points to the blank information. Accordingly, the electronic device may not respond to the target event, i.e., not display any other information, when it listens to the target event.
Or, the preset information may be a reminding message, that is, the technician may modify the correspondence to bind the target event with the display reminding message. Correspondingly, the electronic device can display the reminding message when monitoring the target event. For example, the electronic device may display a reminder message containing "prohibit opening of the developer tools page" content.
The target event represents that a user triggers a target control in a target webpage; the target controls represent controls for displaying the developer tools page based on the original configuration of the target web page. Illustratively, the target control may be the F12 button, and the target control may also be a "developer tools" button in the menu bar of the target web page.
In one implementation, when the target control is the F12 button, the electronic device may listen for a target event that the user triggers the F12 button through an eventtarget. For example, a keydown event, a keyup event, or a keyress event corresponding to the F12 key may be monitored, or a keydown event, a keyup event, or a keypress event corresponding to the F12 key may also be monitored at the same time, and when any one of the above events corresponding to the F12 key is monitored, it indicates that the user has triggered the F12 key, the electronic device may display the preset information.
In another implementation, when the target control is a "developer tool" button in a menu bar of the target web page, the electronic device may monitor a target event that the user triggers the "developer tool" button through a mouse by using an eventtarget. For example, a contextmenu event corresponding to the "developer tools" button may be monitored, and when the contextmenu event corresponding to the "developer tools" button is monitored, indicating that the user has triggered the "developer tools" button, the electronic device may display the preset information.
Based on the processing, the malicious user can be prevented from opening the developer tool page, and then the malicious user is prevented from deleting or modifying the target watermark in the target webpage through the developer tool page, so that the safety of the webpage can be further improved.
In step S103, if the user opens the developer tool page by other means, the user may delete or modify the target watermark through the developer tool page. Therefore, to further improve the security of the web page, the electronic device may detect whether the target watermark is modified.
In one embodiment of the present invention, referring to fig. 2, step S103 may include the steps of:
s1031: and detecting whether attribute information to be processed with a changed parameter value exists in the target attribute information recorded in the first HTML source code corresponding to the target watermark, and if so, executing step S1032.
S1032: it is determined that the target watermark is modified in the target web page.
In one implementation, if a malicious user modifies a target watermark, a parameter value of target attribute information of the target watermark may be changed, so that the electronic device may detect whether there is attribute information to be processed, of which the parameter value is changed, in the target attribute information recorded in the first HTML source code, so as to perform corresponding processing according to a detection result.
The first HTML source code is generated when the preset attribute information of the target watermark is converted into the target attribute information, and therefore the initial parameter value of the target attribute information of the target watermark is recorded in the first HTML source code. It is to be understood that the initial parameter value of the identification information in the target attribute information is the target parameter value in the foregoing embodiment.
If the current parameter value of any attribute information is not the initial parameter value, the parameter value of the attribute information can be determined to be changed, that is, the attribute information to be processed with the changed parameter value can be determined to exist, and the target watermark is modified in the target webpage.
In one embodiment of the present invention, referring to fig. 3, step S1031 may include the steps of:
s10311: monitoring whether a modified target field exists in a field corresponding to a parameter value of target attribute information in the first HTML source code through an element Observer Mutation Observer, if so, executing step S10312, and if not, executing step S10313.
S10312: and determining attribute information corresponding to the target field, wherein the attribute information is to-be-processed attribute information with changed parameter values.
S10313: and determining that the attribute information to be processed with the changed parameter value does not exist.
In one implementation, the electronic device may determine, through a document.getelementbyid (node is obtained by identification), a node (i.e., a watermark node) corresponding to the watermark identification of the target watermark in each node of the DOM tree corresponding to the target web page. Further, a first HTML source code represented by the watermark node may be determined. Furthermore, a field corresponding to a parameter value of the target attribute information in the first HTML source code may be monitored through a Mutation Observer (element viewer) to determine whether there is a modified target field.
In one embodiment of the present invention, the target attribute information of the target watermark may include: identification information, style information, and content information. The fields corresponding to the identification information comprise an id (identity identification) field and a class (type) field; the fields corresponding to the style information may include attributes fields; the fields corresponding to the content information may include a child list field and a child node field.
If the electronic device monitors that the modified target field exists, which indicates that the parameter value of the attribute information corresponding to the target field changes, the electronic device may determine that the attribute information corresponding to the target field is the attribute information to be processed. If there is no modified target field, the electronic device may determine that there is no pending attribute information for which the parameter value has changed.
In one embodiment of the present invention, referring to fig. 4, step S104 may include the steps of:
s1041: and acquiring initial parameter values of the attribute information to be processed.
S1042: and modifying the current parameter value of the attribute information to be processed recorded in the first HTML source code into the initial parameter value of the attribute information to be processed.
S1043: and rendering in the target webpage according to the modified first HTML source code to obtain the target watermark in the initial state.
In one implementation, when it is determined that the target watermark is modified, the electronic device may obtain an initial parameter value of the attribute information to be processed. And the initial parameter value of the attribute information to be processed corresponds to the target watermark in the initial state. Then, the electronic device may modify the current parameter value of the attribute information to be processed recorded in the first HTML source code to the initial parameter value of the attribute information to be processed.
Furthermore, the electronic device can render in the target webpage according to the modified first HTML source code to obtain the target watermark in the initial state. Additionally, the electronic device may not process if it is determined that the target watermark is unmodified.
In one embodiment of the present invention, referring to fig. 5, step S104 may include the steps of:
s1044: and generating a second HTML source code corresponding to the target watermark.
And the second HTML source code records initial parameter values of target attribute information of the target watermark.
S1045: and rendering in the target webpage according to the second HTML source code to obtain the target watermark in the initial state.
In one implementation, the target watermark is indicated as being modified when it is determined that there is pending attribute information for which the parameter value has changed. Accordingly, the electronic device may regenerate the HTML source code (i.e., the second HTML source code) corresponding to the target watermark based on the initial parameter value of the target attribute information of the target watermark. Furthermore, the electronic device may render in the target webpage according to the second HTML source code to obtain the target watermark in the initial state.
In an implementation manner, the electronic device may generate a second HTML source code corresponding to the target watermark through a callback function preset in the Mutation Observer, and render the target webpage according to the second HTML source code to obtain the target watermark in the initial state.
In addition, if the target watermark is deleted, the watermark node in the DOM tree corresponding to the target webpage is also deleted. After generating the second HTML source code, the electronic device may add the generated second HTML source code as a watermark node to a DOM tree corresponding to the target web page through a node insert function or a node add function.
Referring to fig. 6, fig. 6 is a schematic diagram of a watermarking method according to an embodiment of the present invention.
First, a malicious user may click a preset button (e.g., an F12 button) while browsing a target web page containing a target watermark. Accordingly, the electronic device may display a developer tools page. Therefore, in order to prevent a malicious user from opening the developer tool page through a target control (e.g., an F12 button, a "developer tool" button of a menu bar) during browsing a target web page containing a target watermark, the corresponding relationship between a target event (i.e., a user-triggered target control) and a display developer tool page can be unbound, and the target event and display preset information can be bound. Accordingly, when the electronic device monitors the target event, the electronic device may display preset information other than the developer tool page instead of the developer tool page.
Secondly, after opening the developer tool page, the malicious user may input a commonly used watermark identifier (e.g., watermark, logo, etc.) as a key into a search input box of an Elements page of the developer tool page. Correspondingly, the electronic equipment carries out retrieval according to the key words input by the user and displays the retrieved source codes containing the key words, and the retrieved source codes are watermark nodes in a DOM tree corresponding to the target webpage (namely HLML source codes corresponding to the target). Therefore, in order to prevent a malicious user from retrieving the source code of the target watermark through a commonly used watermark identification (e.g., watermark, logo, etc.), a random character string may be used as the watermark identification of the target watermark in a developer tool page.
In addition, after retrieving the HLML source code corresponding to the target watermark, a malicious user may modify or delete the retrieved HLML source code to modify or delete the target watermark in the target web page. Therefore, in order to prevent a malicious user from modifying or deleting the target watermark, the modification of the target watermark may be restored when the modification of the target watermark is monitored, that is, the target watermark may be modified to the initial state.
The watermark processing method provided by the embodiment of the invention has corresponding coping strategies for each step in the operation flow of modifying the watermark by a malicious user, can avoid the problem that the watermark in the webpage is deleted or modified, and further can improve the safety of the webpage.
Corresponding to the embodiment of the method in fig. 1, referring to fig. 7, fig. 7 is a block diagram of a watermark processing apparatus provided in an embodiment of the present invention, where the apparatus includes:
an obtaining module 701, configured to obtain preset attribute information of a target watermark in a target webpage when the target webpage is detected to be added with the target watermark; the preset attribute information is used for representing information calling of the target watermark in the target webpage;
a conversion module 702, configured to convert the preset attribute information into target attribute information; the target attribute information and the preset attribute information have a preset corresponding relation;
a monitoring module 703, configured to monitor the target attribute information to determine whether the target watermark is modified in the target webpage
A modification module 704, configured to modify the target watermark to an initial state when it is determined that the target watermark is modified in the target webpage.
Optionally, the apparatus further comprises:
the display module is used for displaying preset information except a developer tool page when a target event is monitored; wherein the target event represents that a user triggers a target control in the target webpage; the target controls represent controls for displaying the developer tools page based on an original configuration of a target web page.
Optionally, the monitoring module 703 is specifically configured to detect whether attribute information to be processed with a changed parameter value exists in target attribute information recorded in a first HTML source code corresponding to the target watermark;
when attribute information to be processed with changed parameter values exists in the target attribute information recorded in the first HTML source code, determining that the target watermark is modified in the target webpage;
optionally, the modifying module 704 is specifically configured to obtain an initial parameter value of the attribute information to be processed;
modifying the current parameter value of the attribute information to be processed recorded in the first HTML source code into the initial parameter value of the attribute information to be processed;
and rendering in the target webpage according to the modified first HTML source code to obtain the target watermark in the initial state.
Optionally, the modifying module 704 is specifically configured to generate a second HTML source code corresponding to the target watermark; wherein, the second HTML source code records the initial parameter value of the target attribute information of the target watermark;
and rendering in the target webpage according to the second HTML source code to obtain the target watermark in the initial state.
Optionally, the monitoring module 703 is specifically configured to monitor, by using the element viewer detail Observer, whether a modified target field exists in a field corresponding to a parameter value of the target attribute information in the first HTML source code;
if the modified target field exists, determining attribute information corresponding to the target field, wherein the attribute information is attribute information to be processed with changed parameter values;
and if the modified target field does not exist, determining that the attribute information to be processed with the changed parameter value does not exist.
Optionally, the target attribute information includes: identification information, style information, and content information; the fields corresponding to the identification information comprise an identity id field and a type class field; the field corresponding to the style information comprises an attribute field; the fields corresponding to the content information include a child element child list field and a child node subtree field.
The watermark processing device provided by the embodiment of the invention can convert the preset attribute information of the target watermark into the target attribute information, and can prevent a malicious user from acquiring the target attribute information of the target watermark and modifying the target watermark through the target attribute information because the malicious user cannot acquire the target attribute information. In addition, the target watermark can be modified to the initial state when the target watermark is detected to be modified, namely, the modification of the target watermark by a malicious user can be restored, the watermark in the webpage can be protected, and further, the safety of the webpage can be improved.
An embodiment of the present invention further provides an electronic device, as shown in fig. 8, which includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804, where the processor 801, the communication interface 802, and the memory 803 complete mutual communication through the communication bus 804,
a memory 803 for storing a computer program;
the processor 801 is configured to implement the following steps when executing the program stored in the memory 803:
when a target watermark is detected to be added in a target webpage, acquiring preset attribute information of the target watermark in the target webpage; the preset attribute information is used for representing information calling of the target watermark in the target webpage;
converting the preset attribute information into target attribute information; the target attribute information and the preset attribute information have a preset corresponding relation;
monitoring the target attribute information to determine whether the target watermark is modified in the target webpage;
when the target watermark is determined to be modified in the target webpage, modifying the target watermark to an initial state.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
The electronic equipment provided by the embodiment of the invention can convert the preset attribute information of the target watermark into the target attribute information, and can prevent a malicious user from acquiring the target attribute information of the target watermark and modifying the target watermark through the target attribute information because the malicious user cannot acquire the target attribute information. In addition, the target watermark can be modified to the initial state when the target watermark is detected to be modified, namely, the modification of the target watermark by a malicious user can be restored, the watermark in the webpage can be protected, and further, the safety of the webpage can be improved.
In yet another embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the watermarking method described in any of the above embodiments.
In a further embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the watermarking method described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and in relation to them, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method of watermarking, the method comprising:
when a target watermark is detected to be added in a target webpage, acquiring preset attribute information of the target watermark in the target webpage; the preset attribute information is used for representing information calling of the target watermark in the target webpage;
converting the preset attribute information into target attribute information; the target attribute information and the preset attribute information have a preset corresponding relation;
monitoring the target attribute information to determine whether the target watermark is modified in the target webpage;
when the target watermark is determined to be modified in the target webpage, modifying the target watermark to an initial state.
2. The method of claim 1, further comprising:
when a target event is monitored, displaying preset information except a developer tool page; wherein the target event represents that a user triggers a target control in the target webpage; the target controls represent controls for displaying the developer tools page based on an original configuration of a target web page.
3. The method of claim 1, wherein the listening for the target attribute information to determine whether the target watermark is modified in the target web page comprises:
detecting whether attribute information to be processed with changed parameter values exists in target attribute information recorded in a first HTML source code corresponding to the target watermark;
and when the attribute information to be processed with the changed parameter value exists in the target attribute information recorded in the first HTML source code, determining that the target watermark is modified in the target webpage.
4. The method of claim 3, wherein modifying the target watermark to an initial state when the target watermark is determined to be modified in the target webpage comprises:
acquiring initial parameter values of the attribute information to be processed;
modifying the current parameter value of the attribute information to be processed recorded in the first HTML source code into the initial parameter value of the attribute information to be processed;
and rendering in the target webpage according to the modified first HTML source code to obtain the target watermark in the initial state.
5. The method of claim 3, wherein modifying the target watermark to an initial state when the target watermark is determined to be modified in the target webpage comprises:
generating a second HTML source code corresponding to the target watermark; wherein, the second HTML source code records the initial parameter value of the target attribute information of the target watermark;
and rendering in the target webpage according to the second HTML source code to obtain the target watermark in the initial state.
6. The method according to claim 3, wherein the detecting whether there is attribute information to be processed with a changed parameter value in the target attribute information recorded in the first HTML source code corresponding to the target watermark includes:
monitoring whether a modified target field exists in a field corresponding to a parameter value of target attribute information in the first HTML source code through an element Observer Mutation Observer;
if the modified target field exists, determining attribute information corresponding to the target field, wherein the attribute information is attribute information to be processed with changed parameter values;
and if the modified target field does not exist, determining that the attribute information to be processed with the changed parameter value does not exist.
7. The method of claim 6, wherein the target attribute information comprises: identification information, style information, and content information; the fields corresponding to the identification information comprise an identity id field and a type class field; the field corresponding to the style information comprises an attribute field; the fields corresponding to the content information include a child element child list field and a child node subtree field.
8. A watermark processing apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring preset attribute information of a target watermark in a target webpage when the target webpage is detected to be added with the target watermark; the preset attribute information is used for representing information calling of the target watermark in the target webpage;
the conversion module is used for converting the preset attribute information into target attribute information; the target attribute information and the preset attribute information have a preset corresponding relation;
a monitoring module, configured to monitor the target attribute information to determine whether the target watermark is modified in the target webpage;
and the modification module is used for modifying the target watermark into an initial state when the target watermark is determined to be modified in the target webpage.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN202110327646.0A 2021-03-26 2021-03-26 Watermark processing method and device Pending CN112926034A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110327646.0A CN112926034A (en) 2021-03-26 2021-03-26 Watermark processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110327646.0A CN112926034A (en) 2021-03-26 2021-03-26 Watermark processing method and device

Publications (1)

Publication Number Publication Date
CN112926034A true CN112926034A (en) 2021-06-08

Family

ID=76176223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110327646.0A Pending CN112926034A (en) 2021-03-26 2021-03-26 Watermark processing method and device

Country Status (1)

Country Link
CN (1) CN112926034A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113407890A (en) * 2021-07-19 2021-09-17 北京百度网讯科技有限公司 Information extraction method, information extraction device, electronic equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110321675A (en) * 2018-03-29 2019-10-11 中移(苏州)软件技术有限公司 Generation, source tracing method and device based on webpage watermark
CN110489943A (en) * 2019-07-15 2019-11-22 贝壳技术有限公司 Page watermark tamper resistant method and system
CN111191414A (en) * 2019-11-11 2020-05-22 苏州亿歌网络科技有限公司 Page watermark generation method, identification method, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110321675A (en) * 2018-03-29 2019-10-11 中移(苏州)软件技术有限公司 Generation, source tracing method and device based on webpage watermark
CN110489943A (en) * 2019-07-15 2019-11-22 贝壳技术有限公司 Page watermark tamper resistant method and system
CN111191414A (en) * 2019-11-11 2020-05-22 苏州亿歌网络科技有限公司 Page watermark generation method, identification method, device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王继成: "大数据时代高校信息化战略与实践" *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113407890A (en) * 2021-07-19 2021-09-17 北京百度网讯科技有限公司 Information extraction method, information extraction device, electronic equipment and medium
CN113407890B (en) * 2021-07-19 2024-01-12 北京百度网讯科技有限公司 Information extraction method, device, electronic equipment and medium

Similar Documents

Publication Publication Date Title
CN108495185B (en) Video title generation method and device
WO2019196498A1 (en) Page data collection method and device, server, electronic device and computer readable medium
US9886159B2 (en) Selecting portions of computer-accessible documents for post-selection processing
KR101990598B1 (en) Method and device for recommending solution based on user operation behavior
US20150178476A1 (en) System and method of monitoring font usage
US20170337357A1 (en) System and method for managing, tracking, and utilizing copy and/or paste events
JP5135389B2 (en) Information leakage file detection apparatus, method and program thereof
WO2020042375A1 (en) Method and apparatus for outputting information
CN112559928A (en) Page processing method and device based on hybrid development, electronic equipment and storage medium
JP7040800B2 (en) Architecture, methods and equipment for collecting and displaying computer file metadata
CN112926034A (en) Watermark processing method and device
CN113709147B (en) Network security event response method, device and equipment
CN113987393A (en) Web page operation recorder, system, device and method
CN112257005A (en) Form component generation method and device
CN112379871A (en) Data processing method and device
WO2020250320A1 (en) Operation log acquisition device, operation log acquisition method, and operation log acquisition program
Pieterse et al. Evaluating the authenticity of smartphone evidence
CN111414495B (en) Multimedia data acquisition method, device and computer readable storage medium
CN113901360A (en) Data processing method and device and electronic equipment
CN114185795A (en) Embedded point configuration method and device, electronic equipment and storage medium
CN112988776A (en) Method, device and equipment for updating text parsing rule and readable storage medium
CN112035596A (en) Text submission method, device, equipment and storage medium
CN111428210B (en) Method and device for editing watermark and electronic equipment
CN117454336B (en) Anti-disclosure method and device for adding watermark to target webpage
CN112416499B (en) Icon display method and 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