CN111177702B - Webpage content anti-shielding method, device, equipment and computer storage medium - Google Patents
Webpage content anti-shielding method, device, equipment and computer storage medium Download PDFInfo
- Publication number
- CN111177702B CN111177702B CN201911273895.5A CN201911273895A CN111177702B CN 111177702 B CN111177702 B CN 111177702B CN 201911273895 A CN201911273895 A CN 201911273895A CN 111177702 B CN111177702 B CN 111177702B
- Authority
- CN
- China
- Prior art keywords
- shielding
- webpage
- content
- client
- information
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000009877 rendering Methods 0.000 claims abstract description 86
- 238000012544 monitoring process Methods 0.000 claims abstract description 51
- 230000008859 change Effects 0.000 claims abstract description 15
- 230000015654 memory Effects 0.000 claims description 19
- 230000001737 promoting effect Effects 0.000 claims description 12
- 238000003780 insertion Methods 0.000 claims description 6
- 230000037431 insertion Effects 0.000 claims description 6
- 230000000903 blocking effect Effects 0.000 claims description 4
- 230000000694 effects Effects 0.000 abstract description 6
- 230000000873 masking effect Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 6
- 230000007246 mechanism Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000004590 computer program Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000012423 maintenance Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000012216 screening Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001151 other effect Effects 0.000 description 1
- 230000002265 prevention Effects 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application discloses a method, a device and equipment for preventing webpage content from being shielded and a computer storage medium, and relates to the technical field of information flow. The specific implementation scheme is as follows: analyzing shielding information of a client to webpage content by monitoring the change of a Document Object Model (DOM) in rendered webpage content; collecting a rendering log, wherein the rendering log comprises shielding information of a client on webpage content; and monitoring the rendering log so as to replace an anti-shielding strategy according to the shielding information of the client on the webpage content. The anti-shielding effect can be improved, and the timeliness is enhanced.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a computer storage medium for preventing web content from being masked in the field of information flow technologies.
Background
With the increasing requirements for network environment, more and more clients are capable of shielding web page contents. Such as the screening of illegal contents such as sensitive information, yellow-related information, etc., and also the screening of promotion contents (such as advertisements). However, the promotion content on the web page is an important income source for the web page manager, and the promotion content is also an important channel for marketing, promotion and information dissemination of relevant merchants. If the normal display of legal information such as promotion content of the web page cannot be guaranteed, the loss is undoubtedly great for website managers and merchants.
At present, most of the anti-shielding modes for web page contents bypass the shielding mode of the client by some special web page content code settings. However, the shielding mode adopted by the client is often ambiguous and needs to be determined through manual analysis, and then the web page code is rewritten through the manual mode, which results in poor anti-shielding timeliness, and once the shielding mode is changed by the client, the web page content is still shielded and cannot be displayed.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, a device, and a computer storage medium for preventing shielding of web page content, so as to effectively improve the anti-shielding effect and enhance the timeliness.
In a first aspect, the present application provides a method for preventing shielding of web page content, including:
monitoring the change of a Document Object Model (DOM) in rendered webpage content, and analyzing the shielding information of the webpage content by a client;
collecting a rendering log, wherein the rendering log comprises shielding information of a client on webpage content;
and monitoring the rendering log so as to replace an anti-shielding strategy according to the shielding information of the client on the webpage content.
According to a preferred embodiment of the present application, analyzing the shielding information of the web content by the client by monitoring the change of the document object model DOM in the rendered web content includes:
the webpage script monitors the change of DOM in the rendered webpage content, and determines whether the client side shields the webpage content or not and the shielding mode adopted by the client side to the webpage content.
According to a preferred embodiment of the present application, the collecting the rendering log includes:
the webpage script records information of rendered webpage content and uploads the information to the server, wherein the information comprises information of the displayed webpage content and shielding information of the client on the webpage content.
According to a preferred embodiment of the present application, the client shielding information for web page content includes:
the masked webpage content identification, the client information and the masking mode.
According to a preferred embodiment of the present application, the monitoring the rendering log to replace the anti-shielding policy according to the shielding information of the client on the web page content includes:
the server monitors the rendering log to determine shielded webpage contents with a shielding condition meeting a first preset requirement;
and replacing the anti-shielding strategy aiming at the shielded webpage content.
According to a preferred embodiment of the present application, the monitoring the rendering log to replace the anti-shielding policy according to the shielding information of the client on the web page content includes:
the server monitors the rendering log to determine the client type of the webpage content, wherein the shielding condition of the webpage content meets a second preset requirement;
and replacing the anti-shielding strategy aiming at the client type.
According to a preferred embodiment of the present application, the monitoring the rendering log to replace the anti-shielding policy according to the shielding information of the client on the web page content includes:
the server monitors the rendering log and counts the shielding condition of each type of client to each webpage content;
and if the shielding condition of a certain client type on certain webpage content meets a third preset requirement, replacing the anti-shielding strategy aiming at the access request of the client type on the webpage content.
According to a preferred embodiment of the present application, the replacement anti-shielding strategy includes:
the server side issues the replaced anti-shielding strategy configuration information through the configuration platform so as to be read by the webpage script; or,
and the server side issues the webpage script adopting the replaced anti-shielding strategy in the webpage.
According to a preferred embodiment of the present application, the replacement anti-shielding strategy includes at least one of:
writing DOM style information in a line;
disabling a style name indicating promotional content;
replacing the label of the shielded webpage content;
asynchronously rendering the shielded webpage content;
the insertion location of the masked web page content is changed.
According to a preferred embodiment of the present application, the masked web page content includes promotional information.
In a second aspect, the present application further provides an anti-shielding apparatus for web page content, including:
the monitoring unit is used for analyzing the shielding information of the webpage content from the client by monitoring the change of a Document Object Model (DOM) in the rendered webpage content;
the log collection unit is used for collecting a rendering log, and the rendering log comprises shielding information of the client to the webpage content;
the monitoring unit is used for monitoring the rendering log and informing the strategy replacement unit to replace the anti-shielding strategy according to the shielding information of the client on the webpage content;
and the strategy replacing unit is used for replacing the anti-shielding strategy.
According to a preferred embodiment of the present application, the monitoring unit is configured to be a web script, and is specifically configured to monitor changes in a DOM in rendered web content, and determine whether a client performs shielding on the web content and a shielding manner that the client uses on the web content.
According to a preferred embodiment of the present application, the log collection unit is configured as a web script, and is specifically configured to record information of rendering the web content and upload the information to the server, where the information includes information of rendering the web content and information of shielding the web content by the client.
According to a preferred embodiment of the present application, the monitoring unit is configured at the server, and specifically configured to:
monitoring a rendering log to determine shielded webpage contents with a shielding condition meeting a first preset requirement, and informing the strategy replacement unit to replace an anti-shielding strategy for the shielded webpage contents; or,
monitoring a rendering log to determine a client type with a webpage content shielding condition meeting a second preset requirement, and informing the strategy replacement unit to replace an anti-shielding strategy aiming at the client type; or,
monitoring rendering logs and counting shielding conditions of various types of clients to various webpage contents, and if the shielding conditions of certain client types to certain webpage contents meet a third preset requirement, informing the strategy replacement unit to replace an anti-shielding strategy according to an access request of the client types to the webpage contents.
According to a preferred embodiment of the present application, the policy changing unit is configured at the service end, and is specifically configured to:
issuing the replaced anti-shielding strategy configuration information through a configuration platform for reading a webpage script; or,
and issuing the webpage script adopting the replaced anti-shielding strategy in the webpage.
According to a preferred embodiment of the present application, the replacement anti-shielding strategy includes at least one of:
writing DOM style information in a line;
disabling a style name indicating promotional information;
replacing the label of the shielded webpage content;
asynchronously rendering the shielded webpage content;
the insertion position of the shielded web page content is changed.
In a third aspect, the present application provides an electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform any of the methods described above.
In a fourth aspect, the present application provides a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any of the above.
According to the method and the device, the shielding mode of the client is analyzed through monitoring the DOM changes in the rendered webpage content, and the anti-shielding strategy is timely replaced for the shielded webpage content through collecting and monitoring the rendering logs, so that the anti-shielding effect and timeliness are improved.
According to the method and the device, a mechanism of issuing the configuration information is adopted, the webpage codes do not need to be rewritten or the webpage templates do not need to be modified, the replacement of the anti-shielding strategy can be realized only by issuing the replaced anti-shielding configuration information, and the timeliness is further improved.
The device provided by the application can be used as a component in different projects, and has high portability.
The replacement mechanism of the anti-shielding strategy has high expandability, and besides the general anti-shielding strategy, developers can flexibly develop some private anti-shielding strategies according to actual conditions.
The application provides a plurality of anti-shielding strategies, which can be selected and utilized in a targeted manner according to actual conditions, so that the anti-shielding effect is further improved.
Other effects of the above-described alternative will be described below with reference to specific embodiments.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 illustrates an exemplary system architecture of an anti-blocking method or apparatus for web content to which embodiments of the invention may be applied;
FIG. 2 is a flow chart of a main method provided by an embodiment of the present application;
FIG. 3 is a flowchart of a detailed method provided by an embodiment of the present application;
fig. 4 is a structural diagram of an anti-shielding device provided in an embodiment of the present application;
fig. 5 is a block diagram of an electronic device for implementing the anti-shielding method according to the embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 illustrates an exemplary system architecture of an anti-blocking method or apparatus for web page content to which an embodiment of the present invention may be applied.
As shown in fig. 1, the system architecture may include a client and a server. The client installed and running on the terminal device may be a client such as a browser capable of rendering and presenting a webpage to a user. The client may interact with the server over a network. Wherein the network may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few. The terminal device may be various electronic devices capable of installing and operating the client. Including but not limited to smart phones, tablets, smart televisions, and the like.
In the application, the client can request the web page content from the server and render the web page content. The server may embed a web script, such as a js (javascript) script, in the web content sent to the client. The web script can be executed in the terminal device.
The webpage content anti-shielding device can be arranged and operated on the server side, and the server side can also issue partial functions to the webpage script to realize the webpage content anti-shielding device. It may be implemented as a plurality of software or software modules, or may be implemented as a single software or software module, and is not particularly limited herein. The server may be a single server or a server group consisting of a plurality of servers.
Fig. 2 is a flowchart of a main method provided in an embodiment of the present application, and as shown in fig. 2, the method may include the following steps:
in 201, the shielding information of the web page content by the client is analyzed by monitoring the change of DOM (Document Object Model) in the rendered web page content.
This step may be performed by a web script. And after the page is issued to the client, executing the webpage script embedded in the webpage. After rendering the web page content, the client often uses some shielding methods to shield part of the web page content. Therefore, the webpage script conducts DOM monitoring on the rendered webpage content. On one hand, whether the client shields the webpage content or not is determined, and on the other hand, the shielding mode adopted by the client to the webpage content is determined.
In particular, the web script may monitor changes to the DOM through, for example, a MutationObserver interface, which provides the ability to monitor changes made to the DOM tree.
Generally, the shielding modes adopted by a client to shield webpage content mainly include three types:
the first is to remove a DOM node of a specific type, for example, remove a DOM node corresponding to promotion information.
The second method is to change the style of a DOM node of a specific type, for example, to change the style of the DOM node corresponding to the promotion information into transparent.
The third is to intercept a request of a specific path, for example, an access request of a specific domain name.
At 202, a rendering log is collected, the rendering log including client-side shielding information for web page content.
The recording of the rendering log may be performed by a web script. The webpage script records the rendering log according to the rendering condition of the webpage content. Wherein rendering the log may include presenting the log and masking the log. The presentation log may record presentation information of the web content, and the mask log may record information of the web content masked by the client, which may include, for example, a masked web content identifier, client information, and a masking manner.
The maintenance of the rendering log can be executed by a log platform of the server, namely, each webpage script reports the rendering log recorded by the script to the log platform in real time or at regular time. And maintaining and counting by the log platform.
In 203, the rendering log is monitored to replace the anti-shielding policy according to the shielding information of the client on the webpage content.
The step is executed by the server, wherein the monitoring of the rendering log can be executed by a log platform of the server, and the replacement of the anti-shielding strategy can be executed by a configuration platform.
The specific implementation of this step may include, but is not limited to, the following three ways:
the first mode is as follows: the server monitors the rendering log to determine shielded webpage contents with shielded conditions meeting preset first preset requirements, and the shielded webpage contents are replaced by the shielding prevention strategy.
The log platform can monitor the presentation log and the shielding log respectively to determine the shielding rate of the shielded content and determine the shielded webpage content with the shielding rate higher than a preset shielding rate threshold. The presentation log and the number of screening times may also be monitored to determine a presentation rate of the screened content, and to determine the screened web page content having a presentation rate lower than a preset presentation rate threshold. In addition, masked web page content whose masking number exceeds a preset threshold may also be used, and the like, which are not exhaustive herein.
For example, if the number of times a promotional message is displayed and the number of times b a promotional message is masked, the display rate may beShielding ratio of
In this way, if a piece of promotional information (e.g., an ad slot) is frequently masked, it indicates that the current anti-blocking policy for the promotional information has been broken by a plurality of clients, and the anti-blocking policy needs to be changed for the promotional information. Namely, when responding to the webpage access request containing the promotion information, the replaced anti-shielding strategy is adopted.
The second mode is as follows: the server monitors the rendering log to determine the client type of which the shielding condition of the webpage content meets a second preset requirement.
Similarly, the log platform can monitor the display logs and the shielding logs, count the shielding condition of each client type on the specific webpage content, and change the anti-shielding strategy for the client type if the shielding rate of a certain client type on the specific webpage content is higher than a preset shielding rate threshold value. Or if the presentation rate of a certain client type to specific webpage content is lower than a preset presentation rate threshold, replacing the anti-shielding strategy for the client type. Or if the shielding times of a certain client type to specific webpage contents exceed a preset shielding time threshold, replacing the anti-shielding strategy for the client type. And so on.
Because the shielding modes of the same type of client for specific webpage content such as promotion information are generally consistent, if the promotion information is frequently shielded by a certain type of client, the anti-shielding policy for the type of client is considered to be invalid, and the anti-shielding policy needs to be replaced for the type of client. Namely, when responding to the webpage access request of the client, the replaced anti-shielding strategy is adopted.
The third mode is as follows: the server monitors the rendering log and counts the shielding condition of each type of client to each webpage content; and if the shielding condition of a certain client type on certain webpage content meets a third preset requirement, replacing the anti-shielding strategy aiming at the access request of the client type on the webpage content.
Due to the fact that shielding capabilities of the client sides are stronger and stronger, the client sides can often adopt different shielding modes according to different webpage contents, and therefore shielding conditions of various webpage contents can be counted according to various client side types. For example, if the blocking rate of the client type 1 on the ad spot a exceeds a preset blocking rate threshold, or the presentation rate of the client type 1 on the ad spot a is lower than a preset presentation rate threshold, or the like, the anti-blocking policy may be changed for the combination of the client type 1 and the ad spot a. Namely, when responding to the webpage access request containing the advertisement space a by the client type 1, the replaced anti-shielding strategy is adopted.
In this step, the mode of replacing the anti-shielding strategy can adopt, but is not limited to, the following two modes:
the first mode is as follows: and issuing the replaced anti-shielding strategy configuration information through the configuration platform, reading the configuration information by the webpage script and executing the replaced anti-shielding strategy.
The configuration platform may configure the replaced anti-blocking policy configuration information for the masked web content, the configuration information is sent along with the web page, and the web script reads the configuration information and executes the replaced anti-blocking policy.
When the anti-shielding strategy configuration information is sent, the configuration field can be added. For example, the format of the configuration field is:
${type}_${num}_${value}
the type value may be 0 or 1,0 representing a general policy mechanism and 1 representing a policy mechanism customized by the developer. The num value is used for indicating the identification of the anti-shielding strategy, and the value is the content of the anti-shielding strategy.
That is, some general anti-shadowing strategies may be employed in the system for use and selection. In addition, developers can flexibly develop some private anti-shielding strategies according to actual conditions and then issue the strategies through a configuration platform.
The second mode is as follows: and issuing a webpage script adopting the replaced anti-shielding strategy in the webpage.
The log platform, the configuration platform, and the like are logically divided, and may be implemented by being installed on one server of the server, or by being installed on a plurality of servers.
The "client" referred to in the embodiments of the present application may be a browser, or may be other clients capable of rendering and presenting web page content. In the following embodiments of the present application, a browser is described as an example.
The web content targeted by the anti-blocking in the present application may be a specified type of web content, and the following embodiments of the present application are described by taking the popularization content as an example.
Fig. 3 is a flowchart of a detailed method provided by an embodiment of the present application, and as shown in fig. 3, the method may include the following steps:
in 301, after the webpage is sent to the browser for rendering, the webpage script monitors DOM changes corresponding to the rendered promotion content to analyze whether the browser shields the promotion content; if not, executing 302, namely recording the display log, uploading to a log platform, and turning to 304; if so, 303 is performed.
The webpage script can monitor DOM changes corresponding to the rendered promotion content through the MutationObserver interface, so as to determine whether the promotion content is shielded and a specific shielding mode.
And if the browser does not shield the promotion content, recording a display log. For example, an identification of the promotional content, a browser identification, a presentation time, etc. may be recorded.
In 303, the webpage script analyzes the shielding mode adopted for the promotion content, records the shielding log, and uploads the shielding log to the log platform.
The shielding mode can include: removing the DOM node corresponding to the promotion content, changing the DOM node style corresponding to the promotion content and intercepting a request of a specific path.
The web script records a shielding log, such as the identification of the promotion content, the identification of the browser, the shielding mode, and the like. In the embodiment of the application, the logs are uploaded to a log platform for unified maintenance no matter the logs are displayed or shielded.
At 304, the log platform maintains rendering logs including presentation logs and mask logs, collects and accounts the rendering logs.
And the log platform monitors the maintained rendering logs and monitors and counts the shielding condition of the popularization content of each browser. The monitoring and counting of the shielding status of the promotion content by each browser may include counting of indexes such as shielding rate, presentation rate, shielding times and the like of the promotion content. In this embodiment, the statistical masking rate is taken as an example.
Statistics may be performed, for example, using the data format shown in table 1 below:
TABLE 1
Browser identification | Promotion content identification | Number of masks | Number of presentations |
Browser 1 | Popularization content a | 80 | 20 |
Browser 1 | Popularization content b | 2 | 88 |
Browser 2 | Popularization content a | 60 | 40 |
Browser 2 | Popularization content b | 55 | 45 |
… | … | … | … |
In 305, if the shielding rate of a certain type of browser for a certain promotion content exceeds a preset shielding rate threshold, the developer side device is notified of the information of the shielding of the promotion content by the browser of the type.
Continuing with the example shown in table 1, assuming that the preset shielding rate threshold is 80%, it can be seen from table 1 that the shielding rate of the browser 1 on the promotion content a reaches 80%, and then the developer-side device may be notified with a message that the shielding rate of the browser 1 on the promotion content a reaches 80%.
The device at the developer side can be notified by means of a method such as mail, short message, etc., and the identification of the promotion content such as being masked, the identification of the browser, the masking method, etc. are notified.
In 306, the anti-shielding policy is replaced for the access request of the browser to the promotion content, and the configuration platform issues the replaced anti-shielding policy configuration information to the webpage script.
Continuing with the example shown in table 1, the anti-blocking policy may be replaced for the combination of browser 1 and promotion content a, and the replacement of the anti-blocking policy needs to be determined according to the shielding manner adopted by browser 1 for promotion content a. Accordingly, when the browser 1 responds to the webpage access request containing the promotion content a, the replaced anti-shielding strategy is adopted,
the format of the configuration information may be the same as that described in the first embodiment, and is not described herein again. The manner in which the anti-blocking strategy is replaced is described in detail herein, and may specifically include, but is not limited to, the following:
the first mode is as follows: and writing DOM style information of the promotion content in a line. The tags are commonly used tags such as div, span, h 1-h 6, etc., the tags are prohibited from using id or class, etc., and Inline Styles (Inline Styles) are used.
The second mode is as follows: the style name indicating the promotion information is disabled. Usually, when the browser is used for shielding promotion content, matching is performed through a keyword "ad" and the like, so that the style name of the "ad" and the like can be forbidden.
The third mode is as follows: and replacing the label shielded with the promotion information. For example, if the original promoted content uses a div tag, but is recognized and masked by the browser, the promoted content may be replaced with a h1 tag or the like.
The fourth mode is that: the masked web page content is rendered asynchronously. When the promotion content is shielded by a plurality of browsers, the DOM corresponding to the promotion content is changed or removed after the webpage content is rendered. If an asynchronous rendering mode is adopted for the promotion content, namely after rendering is completed on other webpage contents except the promotion content, the promotion content is requested to be obtained and rendered from the server, and therefore the shielding difficulty of the browser on the promotion content is increased.
The fifth mode is as follows: the insertion location of the masked web page content is changed. If the browser shields the promotion content according to the DOM position of the promotion content, the DOM position of the promotion content can be replaced.
At 307, the web script reads the anti-blocking policy configuration information and executes the replaced anti-blocking policy. Proceed to execution 301.
And after the webpage script reads the anti-shielding strategy configuration information, executing the replaced anti-shielding strategy according to the configuration information in the executing process.
In the application, a mode of issuing the anti-shielding policy configuration information by the configuration platform is taken as an example, in addition, a mode of directly issuing a webpage script which adopts the replaced anti-shielding policy can be adopted, so that the replaced anti-shielding policy is executed during execution.
After the anti-blocking policy is changed, the web script proceeds to 301 to perform the process of listening for DOM changes and logging.
The above is a detailed description of the method provided in the present application, and the following is a detailed description of the apparatus provided in the present application with reference to the embodiments.
Fig. 4 is a structural diagram of an anti-shielding apparatus provided in an embodiment of the present application, and as shown in fig. 4, the apparatus may include: the monitoring unit 01, the log collecting unit 02, the monitoring unit 03 and the policy replacing unit 04, and may further include a notifying unit 05. The main functions of each component unit are as follows:
and the monitoring unit 01 is used for analyzing the shielding information of the webpage content by the client by monitoring the DOM change in the rendered webpage content.
Specifically, the monitoring unit 01 may be configured as a web script, configured to monitor changes in the DOM in the rendered web content, for example, monitor changes in the DOM through, for example, a MutationObserver interface, and determine whether the client masks the web content and a manner in which the client masks the web content. Wherein the masking may include removing the DOM, altering the DOM pattern, or intercepting a request for a particular path.
And the log collection unit 02 is used for collecting a rendering log, wherein the rendering log comprises shielding information of the client on the webpage content.
Specifically, the log collection unit 02 may be configured as a web script, so as to record information of rendered web contents and upload the information to the server, where the information includes information of the rendered web contents and information of the masked web contents. For example, a rendering log may be recorded and uploaded to a log platform of the server, where the rendering log includes a presentation log and a mask log.
The information that the webpage content is shielded may include: the shielded webpage content identification, the client information and the shielding mode.
And the monitoring unit 03 is used for monitoring the rendering log and informing the strategy changing unit 04 of changing the anti-shielding strategy according to the shielding information of the client on the webpage content.
The maintenance and monitoring of the rendering log can be executed by a log platform of the server, the log platform can respectively monitor the display log and the shielding log, and one of the following modes is adopted:
the first mode is as follows: monitoring a rendering log to determine shielded webpage contents with a shielding condition meeting a first preset requirement, and informing the policy changing unit to change an anti-shielding policy for the shielded webpage contents.
The second mode is as follows: and monitoring the rendering log to determine the client type with the shielding condition of the webpage content meeting a second preset requirement, and informing the strategy replacement unit to replace the anti-shielding strategy aiming at the client type.
The third mode is as follows: monitoring the rendering logs and counting the shielding condition of each type of client to each webpage content, and if the shielding condition of a certain client type to a certain webpage content meets a third preset requirement, informing the policy replacement unit to replace the anti-shielding policy for the access request of the client type to the webpage content.
A notification unit 05, configured to notify the developer side device of information that the anti-blocking policy needs to be replaced. Specifically, the developer side device may be notified of information that the shielding status of the web page content meets a first preset requirement, the developer side device may be notified of information that the shielding status of the client side to the web page content meets a second preset requirement, and the developer side device may be notified of information that the shielding status of the specific client side type to the web page content meets a third preset requirement.
And the strategy replacing unit 04 is used for replacing the anti-shielding strategy.
Specifically, the policy replacing unit 04 may replace the anti-shielding policy in, but not limited to, the following two ways:
the first mode is as follows: and issuing the replaced anti-shielding strategy configuration information through the configuration platform for the webpage script to read.
The second mode is as follows: and issuing a webpage script adopting the replaced anti-shielding strategy in the webpage.
Wherein, the replacement anti-shielding strategy comprises at least one of the following modes:
the first mode is as follows: the DOM style information is written within a line.
The second mode is as follows: the style name indicating the promotion information is disabled.
The third mode is as follows: the label of the masked web page content is replaced.
The fourth mode is that: masked web page content is rendered asynchronously.
The fifth mode is as follows: the insertion position of the shielded web page content is changed.
According to an embodiment of the present application, an electronic device and a readable storage medium are also provided.
Fig. 5 is a block diagram of an electronic device according to an anti-shielding method of the embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 5, the electronic apparatus includes: one or more processors 501, memory 502, and interfaces for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, as desired. Also, multiple electronic devices may be connected, with each device providing some of the necessary operations (e.g., as an array of servers, a group of blade servers, or a multi-processor system). In fig. 5, one processor 501 is taken as an example.
The memory 502, which is a non-transitory computer-readable storage medium, may be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as program instructions/modules corresponding to the anti-blocking methods in the embodiments of the present application. The processor 501 executes various functional applications of the server and data processing by running non-transitory software programs, instructions, and modules stored in the memory 502, that is, implements the anti-blocking method in the above-described method embodiments.
The memory 502 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 502 may include high speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, memory 502 may optionally include memory located remotely from processor 501, which may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the anti-shielding method may further include: an input device 503 and an output device 504. The processor 501, the memory 502, the input device 503 and the output device 504 may be connected by a bus or other means, and fig. 5 illustrates the connection by a bus as an example.
The input device 503 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic apparatus, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, or other input devices. The output devices 504 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
From the above description, it can be seen that the method, apparatus, device, and computer storage medium provided by the present application have the following advantages:
1) According to the method and the device, the shielding mode of the client is analyzed by monitoring the DOM changes in the rendered webpage content, the rendering log is collected and monitored to timely replace the shielding-proof strategy for the shielded webpage content, and compared with the mode of manually analyzing and rewriting the webpage code, the timeliness is higher. And under the condition that the shielding mode is changed at the client, the anti-shielding strategy can be timely and flexibly changed, and the anti-shielding effect is effectively improved.
2) By adopting a mechanism of issuing the configuration information, the replacement of the anti-shielding strategy can be realized only by issuing the replaced anti-shielding configuration information without rewriting the webpage codes or modifying the webpage template, and the timeliness is further improved.
3) The device provided by the application can be used as a component in different projects, and has high portability.
4) The replacement mechanism of the anti-shielding strategy has high expandability, and besides the general anti-shielding strategy, developers can flexibly develop some private anti-shielding strategies according to actual conditions.
5) The application provides a plurality of anti-shielding strategies, which can be selected and utilized in a targeted manner according to actual conditions, so that the anti-shielding effect is further improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and the present invention is not limited thereto as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (14)
1. An anti-shielding method for web page contents, comprising:
analyzing the shielding information of the webpage content by the client by monitoring the change of a Document Object Model (DOM) in the rendered webpage content;
collecting a rendering log, wherein the rendering log comprises shielding information of a client on webpage content, and the shielding information of the client on the webpage content comprises: shielded webpage content identification, client information and a shielding mode;
monitoring the rendering log to replace an anti-shielding strategy according to shielding information of the client to the webpage content, wherein the anti-shielding strategy is replaced aiming at the shielded webpage content, the client type or an access request of each client type to each webpage content; wherein,
the monitoring and rendering log to replace the anti-shielding strategy according to the shielding information of the client to the webpage content comprises the following steps:
the server monitors the rendering log to determine shielded webpage contents with a shielding condition meeting a first preset requirement, wherein the rendering log and the shielding log are respectively monitored to determine a shielding rate of the shielded webpage contents, the shielded webpage contents with the shielding rate higher than a preset shielding rate threshold are determined, or the rendering log and the shielding times are respectively monitored to determine a rendering rate of the shielded webpage contents, the shielded webpage contents with the rendering rate lower than the preset rendering rate threshold are determined, or the shielded webpage contents with the shielding times higher than the preset times threshold are determined;
replacing an anti-shielding strategy aiming at the shielded webpage content;
the replacement anti-shield strategy includes:
the server side issues the replaced anti-shielding strategy configuration information through the configuration platform so as to be read by the webpage script; or,
and the server side issues the webpage script adopting the replaced anti-shielding strategy in the webpage.
2. The method according to claim 1, wherein analyzing the shielding information of the web page content by the client by monitoring the rendered web page content for changes in the document object model DOM comprises:
the webpage script monitors the change of DOM in the rendered webpage content, and determines whether the client side shields the webpage content or not and the shielding mode adopted by the client side to the webpage content.
3. The method of claim 1, wherein the collecting rendering logs comprises:
the webpage script records information of rendered webpage content and uploads the information to the server, wherein the information comprises information of the displayed webpage content and shielding information of the client on the webpage content.
4. The method of claim 1, wherein monitoring the rendering log to replace the anti-blocking policy based on the blocking information of the client to the web content comprises:
the server monitors the rendering log to determine the client type of the webpage content, wherein the shielding condition of the webpage content meets a second preset requirement;
and replacing the anti-shielding strategy aiming at the client type.
5. The method of claim 1, wherein monitoring the rendering log to replace the anti-blocking policy based on the blocking information of the client to the web content comprises:
the server monitors the rendering log and determines the shielding condition of each type of client to each webpage content;
and if the shielding condition of a certain client type on certain webpage content meets a third preset requirement, replacing the anti-shielding strategy aiming at the access request of the client type on the webpage content.
6. The method of claim 1, wherein the replacement anti-shadowing policy comprises at least one of:
writing DOM style information in a line;
disabling a style name indicating promotional content;
replacing the label of the shielded webpage content;
asynchronously rendering the shielded webpage content;
the insertion position of the shielded web page content is changed.
7. The method of any of claims 1 to 6, wherein the masked web content comprises promotional information.
8. An anti-blocking device for web content, comprising: the device includes:
the monitoring unit is used for analyzing the shielding information of the webpage content from the client by monitoring the change of a Document Object Model (DOM) in the rendered webpage content;
a log collection unit, configured to collect a rendering log, where the rendering log includes shielding information of a client on web page content, and the shielding information of the client on the web page content includes: shielded webpage content identification, client information and a shielding mode;
the monitoring unit is used for monitoring the rendering log and informing the strategy replacement unit to replace the anti-shielding strategy according to the shielding information of the client on the webpage content;
a policy replacing unit, configured to replace an anti-blocking policy, where the anti-blocking policy is replaced for a blocked web content, for a client type, or for an access request of each client type for each web content; wherein,
the monitoring unit is configured at the server, and is specifically configured to:
monitoring rendering logs to determine shielded webpage contents with shielding conditions meeting first preset requirements, and informing the policy replacement unit to replace a shielding-preventing policy for the shielded webpage contents, wherein the rendering logs and the shielding logs are respectively monitored to determine the shielding rate of the shielded webpage contents, the shielded webpage contents with the shielding rate higher than a preset shielding rate threshold are determined, or the rendering logs and the shielding times are respectively monitored to determine the rendering rate of the shielded webpage contents, the shielded webpage contents with the rendering rate lower than the preset rendering rate threshold are determined, or the shielded webpage contents with the shielding times higher than the preset times threshold are determined;
the policy replacing unit is configured at the server, and is specifically configured to:
issuing the replaced anti-shielding strategy configuration information through a configuration platform for reading a webpage script; or,
and issuing the webpage script adopting the replaced anti-shielding strategy in the webpage.
9. The apparatus according to claim 8, wherein the monitoring unit is configured to be a web script, and is specifically configured to monitor a DOM change in the rendered web content, and determine whether the client performs the shielding on the web content and a shielding manner adopted by the client on the web content.
10. The apparatus according to claim 8, wherein the log collection unit is configured as a web script, and is specifically configured to record information of rendering the web content and upload the information to the server, including information of rendering the web content and information of shielding the web content by the client.
11. The apparatus according to claim 8, wherein the monitoring unit is configured at the server, and is specifically configured to:
monitoring a rendering log to determine a client type with a webpage content shielding condition meeting a second preset requirement, and informing the strategy replacement unit to replace an anti-shielding strategy aiming at the client type; or,
and monitoring the rendering log and determining the shielding condition of each type of client to each webpage content, and if the shielding condition of a certain client type to a certain webpage content meets a third preset requirement, informing the policy replacement unit to replace the anti-shielding policy for the access request of the client type to the webpage content.
12. The apparatus of claim 8, wherein the replacement anti-shadowing policy comprises at least one of:
writing DOM style information in a line;
disabling a style name indicating promotional information;
replacing the label of the shielded webpage content;
asynchronously rendering the shielded webpage content;
the insertion position of the shielded web page content is changed.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911273895.5A CN111177702B (en) | 2019-12-12 | 2019-12-12 | Webpage content anti-shielding method, device, equipment and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911273895.5A CN111177702B (en) | 2019-12-12 | 2019-12-12 | Webpage content anti-shielding method, device, equipment and computer storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111177702A CN111177702A (en) | 2020-05-19 |
CN111177702B true CN111177702B (en) | 2023-01-13 |
Family
ID=70646364
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911273895.5A Active CN111177702B (en) | 2019-12-12 | 2019-12-12 | Webpage content anti-shielding method, device, equipment and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111177702B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113688339A (en) * | 2021-07-26 | 2021-11-23 | 珠海金山办公软件有限公司 | Information loading method and device, electronic equipment and computer storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104580244A (en) * | 2015-01-26 | 2015-04-29 | 百度在线网络技术(北京)有限公司 | Method and device for defending against malicious click |
CN109669580A (en) * | 2018-12-28 | 2019-04-23 | 努比亚技术有限公司 | False-touch prevention operating method, mobile terminal and computer readable storage medium |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103679487B (en) * | 2012-09-05 | 2017-07-07 | 阿里巴巴集团控股有限公司 | The monitoring method and equipment of advertising display |
EP3427216A1 (en) * | 2016-03-09 | 2019-01-16 | Sourcepoint Technologies Inc. | Content blocker detection and circumvention |
US10437917B2 (en) * | 2017-04-28 | 2019-10-08 | Microsoft Technology Licensing, Llc | Web page nonintrusive content protection on user device |
CN108243249B (en) * | 2018-01-04 | 2020-05-22 | 网宿科技股份有限公司 | Webpage advertisement anti-shielding method, content distribution network and client |
CN109150965B (en) * | 2018-07-06 | 2021-09-21 | 百度在线网络技术(北京)有限公司 | Information resource anti-shielding method and device, computer equipment and storage medium |
CN109325192B (en) * | 2018-10-11 | 2021-11-23 | 网宿科技股份有限公司 | Advertisement anti-shielding method and device |
CN109948080A (en) * | 2019-03-18 | 2019-06-28 | 西安电子科技大学 | A kind of counteradvertising based on machine learning intercepts the application method of detection system |
-
2019
- 2019-12-12 CN CN201911273895.5A patent/CN111177702B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104580244A (en) * | 2015-01-26 | 2015-04-29 | 百度在线网络技术(北京)有限公司 | Method and device for defending against malicious click |
CN109669580A (en) * | 2018-12-28 | 2019-04-23 | 努比亚技术有限公司 | False-touch prevention operating method, mobile terminal and computer readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111177702A (en) | 2020-05-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11868373B2 (en) | Method and apparatus for monitoring an in-memory computer system | |
US10097440B2 (en) | User interface element adjustment using web analytics | |
US10984109B2 (en) | Application component auditor | |
CN112527748A (en) | Method, device, equipment and storage medium for analyzing user operation behaviors | |
US9501377B2 (en) | Generating and implementing data integration job execution design recommendations | |
CN104331474A (en) | Page processing method and device | |
CN103530218A (en) | Monitoring triggering method based on behavior detection | |
Bao et al. | Tracking and Analyzing Cross-Cutting Activities in Developers' Daily Work (N) | |
CN110889056A (en) | Page marking method and device | |
CN111177702B (en) | Webpage content anti-shielding method, device, equipment and computer storage medium | |
US20150066965A1 (en) | Data processing, data collection | |
US8566345B2 (en) | Enterprise intelligence (‘EI’) reporting in an EI framework | |
WO2021189766A1 (en) | Data visualization method and related device | |
US10318650B2 (en) | Identifying corrupted text segments | |
CN111694810A (en) | Data warehouse creation method and device, electronic equipment and readable storage medium | |
US9659266B2 (en) | Enterprise intelligence (‘EI’) management in an EI framework | |
US9639815B2 (en) | Managing processes in an enterprise intelligence (‘EI’) assembly of an EI framework | |
US20220171670A1 (en) | Adaptive log analysis | |
US20180314765A1 (en) | Field name recommendation | |
US20130018695A1 (en) | Enterprise Intelligence ('EI') Assembly Analysis In An EI Framework | |
US20130019246A1 (en) | Managing A Collection Of Assemblies In An Enterprise Intelligence ('EI') Framework | |
US9952773B2 (en) | Determining a cause for low disk space with respect to a logical disk | |
US8893289B1 (en) | Internal privacy invasion detection and prevention system | |
US9646278B2 (en) | Decomposing a process model in an enterprise intelligence (‘EI’) framework | |
JP2019160223A (en) | Automatic transaction device and signage system including the same |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |