CN105589870B - Method and system for filtering webpage advertisements - Google Patents

Method and system for filtering webpage advertisements Download PDF

Info

Publication number
CN105589870B
CN105589870B CN201410568315.6A CN201410568315A CN105589870B CN 105589870 B CN105589870 B CN 105589870B CN 201410568315 A CN201410568315 A CN 201410568315A CN 105589870 B CN105589870 B CN 105589870B
Authority
CN
China
Prior art keywords
advertisement
webpage
resource
resource request
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410568315.6A
Other languages
Chinese (zh)
Other versions
CN105589870A (en
Inventor
吕鹏元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201410568315.6A priority Critical patent/CN105589870B/en
Publication of CN105589870A publication Critical patent/CN105589870A/en
Application granted granted Critical
Publication of CN105589870B publication Critical patent/CN105589870B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a system for filtering webpage advertisements, wherein the method comprises the following steps: receiving a main resource request sent by a client, and sending the main resource request to a third-party site; acquiring a typesetting style label matched with the main resource request, wherein the typesetting style label is used for hiding advertisement elements contained in a webpage corresponding to the main resource request; and receiving a main resource sent by a third-party site in response to the main resource request, inserting the typesetting style tag into the main resource and sending the main resource to the client so that the client hides a webpage block where the advertising elements contained in the webpage are located through the typesetting style tag when typesetting the webpage. By implementing the method and the system, the client can hide the webpage block containing the advertisement elements in the webpage through the typesetting style tag when typesetting the webpage, thereby realizing the filtering function of the webpage advertisement, and improving the advertisement filtering efficiency, the webpage loading speed and the user experience.

Description

Method and system for filtering webpage advertisements
Technical Field
The invention relates to the technical field of internet, in particular to a method and a system for filtering webpage advertisements.
Background
At present, network pages on the internet often contain various advertisement contents such as advertisement pictures, FLASH, JS scripts and the like, and especially, the advertisement contents are more in hot websites. When a client browses a webpage, advertisements of the website can be loaded and displayed on the webpage, a browser can initiate a network request to request page content, the request for the page content can be requested together with all advertisement content, a large amount of advertisement content influences the loading and analysis of network requests of non-advertisement content in the page, the flow of users is wasted, and the processing efficiency of the webpage is reduced.
However, many terminal browsers adopt a system-owned kernel engine, and the kernel engine cannot be modified, so that web advertisements cannot be effectively filtered.
Disclosure of Invention
Accordingly, it is necessary to provide a method and a system for filtering web advertisements, aiming at the problem that the terminal browser cannot effectively filter web advertisements.
A method for filtering web advertisements comprises the following steps:
receiving a main resource request sent by a client, and sending the main resource request to a third-party site;
acquiring a typesetting style label matched with the main resource request, wherein the typesetting style label is used for hiding advertisement elements contained in a webpage corresponding to the main resource request;
and receiving the main resource sent by the third-party website responding to the main resource request, inserting the typesetting style tag into the main resource and sending the main resource to the client so that the client hides the webpage block where the advertising elements contained in the webpage are located through the typesetting style tag when typesetting the webpage.
A system for filtering web advertisements, comprising:
the main resource request module is used for receiving a main resource request sent by a client and sending the main resource request to a third-party site;
the typesetting label module is used for acquiring a typesetting style label matched with the main resource request, wherein the typesetting style label is used for hiding advertisement elements contained in a webpage corresponding to the main resource request;
and the main resource transmission module is used for receiving the main resource sent by the third-party website responding to the main resource request, inserting the typesetting style tag into the main resource and sending the main resource to the client so that the client hides the webpage block where the advertising elements contained in the webpage are located through the typesetting style tag when typesetting the webpage.
According to the method and the system for filtering the webpage advertisement, the typesetting style label matched with the main resource is obtained, and the main resource is inserted and sent to the client. The webpage block where the advertisement elements contained in the webpage are located can be hidden by the client through the typesetting style tag when the webpage is typeset, the filtering function of the webpage advertisement is realized, and the advertisement filtering efficiency, the webpage loading speed and the user experience can be improved.
A method for filtering web advertisements comprises the following steps:
sending a main resource request of a webpage to a cloud;
receiving a main resource acquired by the cloud from a third-party website, wherein the main resource comprises a typesetting style tag used for hiding advertisement elements contained in the webpage;
analyzing the main resource and sending a sub-resource request to the cloud;
receiving child resources returned by the cloud;
when the webpage blocks corresponding to the main resource and the sub-resource are typeset, the typesetting style labels included in the main resource are analyzed, and the webpage blocks matched with the typesetting style labels are hidden.
A system for filtering web advertisements, comprising:
the main resource module is used for sending a main resource request of a webpage to the cloud;
the main resource receiving module is used for receiving a main resource acquired by the cloud from a third-party website, wherein the main resource comprises a typesetting style tag used for hiding advertisement elements contained in the webpage;
the sub-resource module is used for analyzing the main resource and sending a sub-resource request to the cloud;
the child resource receiving module is used for receiving child resources returned by the cloud end;
and the webpage typesetting module is used for analyzing the typesetting style labels included in the main resource and hiding the webpage blocks matched with the typesetting style labels when the webpage blocks corresponding to the main resource and the sub-resources are typeset respectively.
According to the webpage advertisement filtering method and system, the main resource acquired by the cloud from the third-party website is received, the main resource and the sub-resources are typeset, the typesetting style tag included by the main resource is analyzed, so that the advertisement elements contained in the webpage are hidden, the filtering function of the webpage advertisement is realized, and the advertisement filtering efficiency, the webpage loading speed and the user experience can be improved.
Drawings
FIG. 1 is a schematic block diagram of an exemplary embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a method for filtering web advertisements according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a method for filtering web advertisements according to the present invention;
FIG. 4 is a schematic structural diagram of a first embodiment of a system for filtering web advertisements according to the present invention;
FIG. 5 is a schematic structural diagram of a second embodiment of a system for filtering web advertisements according to the present invention;
FIG. 6 is a flowchart illustrating a third embodiment of a method for filtering web advertisements according to the present invention;
FIG. 7 is a first diagram illustrating a web page according to a third embodiment of the method for filtering web page advertisements of the present invention;
FIG. 8 is a second diagram illustrating a web page according to a third embodiment of the method for filtering web page advertisements of the present invention;
FIG. 9 is a schematic structural diagram of a third embodiment of a system for filtering web advertisements according to the present invention;
FIG. 10 is a timing diagram illustrating a fourth embodiment of the method for filtering web advertisements according to the present invention;
FIG. 11 is a block diagram of a computer system capable of implementing embodiments of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Unless the context clearly dictates otherwise, the elements and components of the present invention may be present in either single or in multiple forms and are not limited thereto. Although the steps in the present invention are arranged by using reference numbers, the order of the steps is not limited, and the relative order of the steps can be adjusted unless the order of the steps is explicitly stated or other steps are required for the execution of a certain step. It is to be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
The implementation environment shown in fig. 1 is used to implement the method for filtering a web advertisement according to any embodiment or implementation manner of the present invention, and includes a terminal, a client 2020, a cloud 2040, and a third party site 2060, where the terminal is connected to the cloud 2040 through a wireless network or a limited network, and the cloud 2040 is connected to the third party site 2060 through a wireless network or a limited network.
The terminal includes at least one of a desktop, a notebook, a personal digital assistant, a smart phone, a tablet computer, a portable media player, and the like, and is provided with a client 2020 for implementing a filtering method for web advertisements.
The client 2020 may sequentially send the main resource request and the sub-resource request to the cloud 2040 when receiving the webpage loading instruction of the terminal, so as to obtain the main resource and the sub-resource of the webpage to be loaded.
Cloud 2040 may send a primary resource request and a child resource request to a third-party site upon receiving the primary resource request from the client, requesting primary and child resources for client 2020.
Further, after receiving a main resource request of the client 2020, the cloud 2040 obtains an advertisement hiding rule matched with the main resource request, converts the obtained advertisement hiding rule into a type setting style tag for hiding advertisement elements contained in a webpage corresponding to the main resource request, inserts the type setting style tag into the main resource, and sends the type setting style tag to the client 2020, so that the client 2020 hides the advertisement elements contained in the webpage through the type setting style tag. Cloud 2040 may also request asynchronous acquisition of advertisement hiding rules for advertisement elements included in the web page by the cloud kernel. The cloud 2040 may also identify whether the sub-resource request is an advertisement sub-resource request after receiving the sub-resource request, and if not, send the sub-resource request to the third-party site, and if so, intercept the sub-resource request.
After receiving the main resource request and the sub resource request sent by the cloud 2040, the third-party site 2060 may obtain the corresponding main resource and sub resource and return the main resource and sub resource to the cloud 2040.
The client 2020 may read the type-setting style label from the main resource after receiving the main resource and the sub-resource, and hide the display area of the advertisement element when the main resource and the sub-resource are type-set by the kernel engine according to the type-setting style label.
Referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a method for filtering a web advertisement according to the present invention.
The filtering method for the web page advertisement of the embodiment is preferably executed in a cloud, and may include the following steps:
step S201, receiving a main resource request sent by a client, and sending the main resource request to a third-party site.
Step S202, obtaining a typesetting style label matched with the main resource request, wherein the typesetting style label is used for hiding advertisement elements contained in the webpage corresponding to the main resource request.
Step S203, receiving the main resource sent by the third-party website responding to the main resource request, inserting the typesetting style label into the main resource and sending the main resource to the client, so that the client hides the webpage block where the advertisement elements contained in the webpage are located through the typesetting style label when typesetting the webpage.
In this embodiment, the typesetting style label matched with the master resource is obtained, and the master resource is inserted and sent to the client. The webpage block where the advertisement elements contained in the webpage are located can be hidden by the client through the typesetting style tag when the webpage is typeset, the filtering function of the webpage advertisement is realized, and the advertisement filtering efficiency, the webpage loading speed and the user experience can be improved.
Further, the method can also comprise the following steps:
step S204, receiving the sub-resource request of the client, and sending the sub-resource request to the third-party site.
Step S205, receiving the sub-resource sent by the third-party site and sending the sub-resource to the client.
In step S201, preferably, the layout style label matched with the main resource request is a layout style label corresponding to a webpage corresponding to the main resource, that is, a layout style label of an advertisement element included in the webpage. The primary resource request may include web page information, such as identification information of the web page, which may be a web address of the web page, a name of the web page, and the like. After receiving the main resource request, analyzing the main resource request to obtain webpage information of a corresponding webpage, obtaining a typesetting style label corresponding to the webpage information as a typesetting style label matched with the main resource request, or requesting the main resource from a corresponding third site according to the webpage information.
Preferably, the client can be accessed to the cloud in advance.
In one embodiment, before the step of receiving the primary resource request sent by the client, the method may further include the following steps:
and receiving an access request of the client.
And responding the access request to access the client.
In another embodiment, the primary resource request may further include an access request, and the client is accessed when the primary resource request is received.
For step S202, the web page corresponding to the primary resource request is preferably the web page requested by the primary resource request. The layout style label includes the advertisement hiding rule or identification information of the advertisement hiding rule. Preferably, the typesetting style label is a css file.
Preferably, in the step of obtaining the layout style label matched with the main resource request, the advertisement hiding rule of the webpage corresponding to the main resource request may be obtained first, and the obtained advertisement hiding rule is converted into the layout style label for hiding the advertisement elements included in the webpage.
Preferably, the advertisement hiding rule may include information of a webpage layout that hides the advertisement elements, such as: the advertisement hiding rules may be regular expressions; the advertisement hiding rule corresponding to one webpage comprises a regular expression which can be matched with the webpage block identification of the webpage block in which the child resource serving as the advertisement element is located in the webpage. Since the layout style label includes the advertisement hiding rule or the identification information of the advertisement hiding rule. Therefore, the layout style label also includes information that can be matched with the page block identification of the page block in which the child resource serving as the advertisement element is located in the page. The cloud can pre-store the corresponding relation between the webpage domain name and the advertisement hiding rule. After receiving a main resource request containing a webpage domain name, the method can also search an advertisement hiding rule corresponding to the webpage domain name, and convert the searched advertisement hiding rule into a typesetting style label for hiding advertisement elements contained in the webpage.
Further, the style of the web page block may be set to "display: none", that is, the style is set to "display: none" in the web page tag defining the web page block.
In one embodiment, the step of obtaining the typesetting style label matching the primary resource request comprises the following steps:
and reading webpage information from the main resource request.
And inquiring the advertisement hiding rules stored corresponding to the webpage information from the pre-stored advertisement hiding rules.
If the webpage is inquired, converting the inquired advertisement hiding rules into typesetting style labels for hiding the advertisement elements contained in the webpage.
In this embodiment, the pre-stored advertisement hiding rule is stored corresponding to the web page.
In other embodiments, the typesetting style tag into which the advertisement hiding rule is converted may be stored directly corresponding to the webpage.
Preferably, the webpage information is identification information of a webpage requested by the primary resource request.
In another embodiment, the step of converting the queried advertisement hiding rule into a typesetting style label for hiding the advertisement elements contained in the webpage further comprises the following steps:
and converting the inquired advertisement hiding rules into typesetting style labels for hiding the advertisement elements contained in the webpage.
And taking the maximum priority weight as the weight of the typesetting style label.
In this embodiment, the browser kernel engine of the client may preferentially perform the layout of the webpage according to the layout style label by identifying the maximum priority weight.
For step S203, the main resource of the web page is an html file of the web page, and the html file of the web page includes a source code of the web page. Resources of the web page other than the main resource are referred to as sub-resources of the web page, for example, picture, streaming media, JavaScript script files, Cascading Style Sheets (CSS) resources, and the like. Generally, when a browser requests a web page, the browser first requests a main resource of the web page, and then parses the main resource of the web page, and when a URL of a sub-resource included in the main resource is parsed, the browser starts to request the sub-resource corresponding to the URL.
Preferably, the operation of inserting the type setting style label into the main resource may add the type setting style label to a preset region of the main resource, or may combine the type setting style label and the main resource into a data packet and send the data packet to a client. The layout style label and the main resource can also be sent to the client by other technical means familiar to those skilled in the art, so that the client recognizes that the layout style label includes an advertisement hiding rule for hiding the advertisement elements included in the requested webpage.
Further, when the advertisement hiding rule corresponding to the webpage is not inquired, after the main resource returned by the third-party site is received, the main resource can be directly sent to the client.
For step S204, the child resource request may be subjected to advertisement filtering, and then requested to the third-party site.
In one embodiment, the step of receiving a sub-resource request of the client and sending the sub-resource request to the third-party site further includes the steps of:
and receiving a sub-resource request of the client, and identifying whether the sub-resource request is an advertisement sub-resource request.
And if not, sending the sub-resource request to the third-party site, receiving the sub-resource returned by the third-party site and sending the sub-resource to the client.
If yes, intercepting the child resource request.
In this embodiment, whether the request of the sub-resource request is an advertisement resource may be identified by a URL in the sub-resource request, and if the request is an advertisement resource, the sub-resource request is an advertisement sub-resource request.
In another embodiment, the step of identifying whether the sub-resource request is an advertising sub-resource request further comprises the steps of:
and analyzing the uniform resource locator of the sub-resource.
And acquiring advertisement filtering rules corresponding to the webpage.
And judging whether the analyzed uniform resource locator meets the advertisement filtering rule, if so, judging that the sub-resource request is an advertisement sub-resource request, and if not, judging that the sub-resource request is not the advertisement sub-resource request.
In this embodiment, the advertisement filtering rule of the web page may be pre-stored corresponding to the web page. And the advertisement filtering rule judges whether the analyzed uniform resource locator meets the advertisement filtering rule or not through a regular expression. In other embodiments, the advertisement filtering rules may be pre-stored corresponding to the type of the web page.
Preferably, the advertisement filtering rule is a regular expression; an advertisement filtering rule corresponding to a web page includes a regular expression that can be matched with a URL (uniform resource locator) that is a child resource of the advertisement in the web page.
Further, the webpage block in the webpage identifying the webpage block matched with the advertisement hiding rule comprises the webpage block where the child resource matched with the advertisement filtering rule is located in the webpage. That is, in the web page, if the URL of a certain sub-resource matches the advertisement filtering rule of the web page, the web page block identifier of the web page block where the sub-resource is located matches the advertisement hiding rule of the waiting web page.
For step S205, it is preferable that the advertisement sub-resources are filtered from the sub-resources sent to the client.
Referring to fig. 3, fig. 3 is a flowchart illustrating a second embodiment of a method for filtering a web advertisement according to the present invention.
The difference between the filtering method for web advertisements of this embodiment and the first embodiment is that: after the step of inquiring the advertisement hiding rules stored corresponding to the webpage information from the pre-stored advertisement hiding rules, the method further comprises the following steps:
step S301, if the advertisement hiding rule stored corresponding to the webpage information is not inquired, receiving the main resource sent by the third-party site in response to the main resource request, and directly sending the main resource to the client.
Step S302, requesting to asynchronously obtain the advertisement hiding rules of the advertisement elements contained in the webpage through the cloud kernel.
Step S303, storing the asynchronously acquired advertisement hiding rules corresponding to the webpage information.
In the embodiment, the main resource is requested to be traversed through the cloud kernel, the advertisement hiding rules of the advertisement elements contained in the webpage are asynchronously acquired, and the asynchronously acquired advertisement hiding rules are stored corresponding to the webpage. The asynchronously acquired advertisement hiding rules stored corresponding to the web page can be directly inquired as the advertisement hiding rules of the web page when the main resource request of the web page is received next time. The client side carries out typesetting layout on the webpage through the typesetting style label, the filtering function of the webpage advertisement is realized, and the advertisement filtering efficiency, the webpage loading speed and the user experience can be improved.
For step 302, the cloud kernel is configured to analyze the main resource, generate the webpage corresponding to the received sub-resource, traverse the webpage, match elements included in the webpage with preset advertisement elements, use, as advertisement elements included in the webpage, elements that are matched with the preset advertisement elements among the elements included in the webpage, generate an advertisement hiding rule for hiding the advertisement elements included in the webpage, and store the advertisement hiding rule corresponding to the webpage information.
Preferably, the preset advertisement elements may be reported to the cloud end by the client in advance, may be collected in advance by an open source organization, and may also be obtained in advance by other technical means familiar to those skilled in the art.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a filtering system for web advertisements according to a first embodiment of the present invention.
The filtering system for web page advertisement of this embodiment is preferably a system in the cloud, and may include a main resource request module 110, a composition tag module 120, a main resource transmission module 130, a sub-resource request module 140, and a sub-resource transmission module 150, where:
the primary resource request module 110 is configured to receive a primary resource request sent by a client, and send the primary resource request to a third-party site.
A composition tag module 120, configured to obtain a composition style tag matched with the main resource request, where the composition style tag is used to hide advertisement elements included in a webpage corresponding to the main resource request.
A main resource transmission module 130, configured to receive a main resource sent by the third-party website in response to the main resource request, insert the type setting style tag into the main resource, and send the main resource to the client, so that the client hides, through the type setting style tag, a webpage block where an advertisement element included in the webpage is located when typesetting the webpage.
In this embodiment, the typesetting style label matched with the master resource is obtained, and the master resource is inserted and sent to the client. The webpage block where the advertisement elements contained in the webpage are located can be hidden by the client through the typesetting style tag when the webpage is typeset, the filtering function of the webpage advertisement is realized, and the advertisement filtering efficiency, the webpage loading speed and the user experience can be improved.
Further, the system may further include a sub-resource request module, configured to receive a sub-resource request of the client, send the sub-resource request to the third-party site, receive a sub-resource sent by the third-party site, and send the sub-resource to the client.
For the main resource request module 110, preferably, the layout style label matched with the main resource request is a layout style label corresponding to a webpage corresponding to the main resource, that is, a layout style label of an advertisement element included in the webpage. The primary resource request may include web page information, such as identification information of the web page, which may be a web address of the web page, a name of the web page, and the like. After receiving the main resource request, analyzing the main resource request to obtain webpage information of a corresponding webpage, obtaining a typesetting style label corresponding to the webpage information as a typesetting style label matched with the main resource request, or requesting the main resource from a corresponding third site according to the webpage information.
For the typesetting label module 120, the webpage corresponding to the main resource request is preferably the webpage requested by the main resource request. The layout style label includes the advertisement hiding rule or identification information of the advertisement hiding rule. Preferably, the typesetting style label is a css file.
Preferably, the advertisement hiding rule may include information of a webpage layout that hides the advertisement elements, such as: the advertisement hiding rules may be regular expressions; the advertisement hiding rule corresponding to one webpage comprises a regular expression which can be matched with the webpage block identification of the webpage block in which the child resource serving as the advertisement element is located in the webpage. The cloud can pre-store the corresponding relation between the webpage domain name and the advertisement hiding rule. After receiving a main resource request containing a webpage domain name, the method can also search an advertisement hiding rule corresponding to the webpage domain name, and convert the searched advertisement hiding rule into a typesetting style label for hiding advertisement elements contained in the webpage.
The webpage blocks are defined through webpage tags, comprise webpage elements such as images and/or characters, and can occupy a certain area in webpage layout. For example, a partition or section defined by a div tag is a block of web pages. One block of web pages may contain other blocks of web pages. The character string that may serve as an identification for the page block may serve as a page block identification for the page block, e.g., an attribute value for an id attribute in a div tag, etc.
Further, the style of the web page block may be set to "display: none", that is, the style is set to "display: none" in the web page tag defining the web page block.
In one embodiment, the composition labeling module 120 may also be configured to:
reading webpage information from the main resource request;
inquiring advertisement hiding rules stored corresponding to the webpage information from prestored advertisement hiding rules;
if the webpage is inquired, converting the inquired advertisement hiding rules into typesetting style labels for hiding the advertisement elements contained in the webpage.
In this embodiment, the pre-stored advertisement hiding rule is stored corresponding to the web page.
In another embodiment, the composition labeling module 120 may be further configured to:
and converting the inquired advertisement hiding rules into typesetting style labels for hiding the advertisement elements contained in the webpage.
And taking the maximum priority weight as the weight of the typesetting style label.
In this embodiment, the browser kernel engine of the client may preferentially perform the layout of the webpage according to the layout style label by identifying the maximum priority weight.
For the master resource transfer module 130, preferably, the inserting the type setting style label into the master resource may add the type setting style label to a preset region of the master resource, or merge the type setting style label and the master resource into a data packet to be sent to the client. The layout style label and the main resource can also be sent to the client by other technical means familiar to those skilled in the art, so that the client recognizes that the layout style label includes an advertisement hiding rule for hiding the advertisement elements included in the requested webpage.
Further, when the advertisement hiding rule corresponding to the webpage is not inquired, after the main resource returned by the third-party site is received, the main resource can be directly sent to the client.
For the sub-resource request module 140, the advertisement of the sub-resource request may be filtered, and then the sub-resource request may be requested from the third-party site.
In one embodiment, the sub-resource request module 140 is further operable to:
and receiving a sub-resource request of the client, and identifying whether the sub-resource request is an advertisement sub-resource request.
And if not, sending the sub-resource request to the third-party site.
If yes, intercepting the child resource request.
In this embodiment, whether the request of the sub-resource request is an advertisement resource may be identified by a URL in the sub-resource request, and if the request is an advertisement resource, the sub-resource request is an advertisement sub-resource request.
In another embodiment, the sub-resource request module 140 may be further configured to:
and analyzing the uniform resource locator of the sub-resource.
And acquiring advertisement filtering rules corresponding to the webpage.
And judging whether the analyzed uniform resource locator meets the advertisement filtering rule, if so, judging that the sub-resource request is an advertisement sub-resource request, and if not, judging that the sub-resource request is not the advertisement sub-resource request.
In this embodiment, the advertisement filtering rule of the web page may be pre-stored corresponding to the web page. And the advertisement filtering rule judges whether the analyzed uniform resource locator meets the advertisement filtering rule or not through a regular expression. In other embodiments, the advertisement filtering rules may be pre-stored corresponding to the type of the web page.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a second embodiment of a system for filtering a web advertisement according to the present invention.
The filtering system for web advertisements of the present embodiment is different from the first embodiment in that: an asynchronous processing module 160 is also included for:
and when the advertisement hiding rule stored corresponding to the webpage information is not inquired, receiving the main resource sent by the third-party site in response to the main resource request, and enabling the main resource transmission module 150 to directly send the main resource to the client.
And requesting to asynchronously acquire the advertisement hiding rules of the advertisement elements contained in the webpage through a cloud core.
And storing the asynchronously acquired advertisement hiding rules corresponding to the webpage information.
In the embodiment, the main resource is requested to be traversed through the cloud kernel, the advertisement hiding rules of the advertisement elements contained in the webpage are asynchronously acquired, and the asynchronously acquired advertisement hiding rules are stored corresponding to the webpage. The asynchronously acquired advertisement hiding rules stored corresponding to the web page can be directly inquired as the advertisement hiding rules of the web page when the main resource request of the web page is received next time. The client side carries out typesetting layout on the webpage through the typesetting style label, the filtering function of the webpage advertisement is realized, and the advertisement filtering efficiency, the webpage loading speed and the user experience can be improved.
For the asynchronous processing module 160, the cloud kernel is configured to analyze the main resource, generate the web page corresponding to the received sub-resource, traverse the web page, match an element included in the web page with a preset advertisement element, use an element, which is matched with the preset advertisement element, of the elements included in the web page as the advertisement element included in the web page, generate an advertisement hiding rule for hiding the advertisement element included in the web page, and store the advertisement hiding rule corresponding to the web page information.
Preferably, the preset advertisement elements may be reported to the cloud end by the client in advance, may be collected in advance by an open source organization, and may also be obtained in advance by other technical means familiar to those skilled in the art.
Referring to fig. 6, fig. 6 is a flowchart illustrating a method for filtering a web advertisement according to a third embodiment of the present invention.
The method for filtering the web page advertisement of this embodiment is preferably executed at a client, and may include the following steps:
step S601, sending a main resource request of the web page to the cloud.
Step S602, receiving a main resource acquired by the cloud from a third-party website, where the main resource includes a typesetting style tag for hiding advertisement elements included in the webpage.
Step S603, parsing the main resource, and sending a sub-resource request to the cloud.
Step S604, receiving the child resources returned by the cloud.
Step S605, when the webpage blocks corresponding to the main resource and the sub-resource are typeset, parsing the typesetting style label included in the main resource, and hiding the webpage block matched with the typesetting style label.
This embodiment, receive the main resources that the high in the clouds acquireed from the third party website, the analysis the composing style label that main resources includes, it is right main resources with the layout is typeset to the sub resource, in order to hide the webpage contains the advertising element, realizes the filtering capability to the webpage advertisement, can improve advertisement filtration efficiency, webpage loading speed and user experience.
Step S601 corresponds to step S201 described above, step S602 corresponds to step S202 and step S203 described above, step S603 corresponds to step S304 described above, and step S604 corresponds to step S305 described above.
Preferably, the sub-resources include various resources included in the web page, such as pictures embedded in the web page, script connections (JS, css, etc.), flash, and other resources. The various resources contained in the web page are indicated by child resource identifiers.
Further, the client can be accessed to the cloud in advance.
In one embodiment, before the step of sending the primary resource request of the web page to the cloud, the following steps may be further included:
and sending an access request to the cloud end to access the cloud end.
In another embodiment, the primary resource request may further include an access request, which requests access to the cloud while requesting the primary resource.
For step S605, the webpage block matched with the layout style label is the webpage block where the advertisement element included in the webpage is located. Step S605 corresponds to step S603, and the webpage block and the type-setting style label are the same as the type-setting style label and the webpage block for hiding the advertisement elements included in the webpage in the first embodiment of the filtering method for web advertisements.
Preferably, the matching information contained in the typesetting style label and the identification of each webpage block can be matched.
Since it is only through matching the URL of the sub-resource with the advertisement filtering rule to identify whether the sub-resource is an advertisement, it may not be possible to completely filter the advertisement in the web page. Because the amount of advertisement information on the internet is huge, it is impossible to formulate an advertisement filtering rule for each advertisement, and an advertisement filtering rule is generally formulated by extracting commonalities of URLs of a plurality of advertisements, so that one advertisement filtering rule can generally match a plurality of URLs as child resources of advertisements. In some cases, the URLs of multiple ad sub-resources have commonality, as do URLs of sub-resources that are not ads. For example, the first URL is: http:// images. sohu.com/bill/1. jpg; the second URL is: http:// images. sohu.com/bill/2. jpg; the third URL is: http:// images. sohu.com/bill/3. jpg; wherein the first and second URLs correspond to advertisements and the third URL corresponds to non-advertisements, such that the following advertisement filtering rules cannot be formulated: sohu com/bill/, which matches all URLs starting with "images sohu com/bill/". Thus, advertisements corresponding to the first URL and the second URL cannot be filtered by matching the URLs of the sub-resources with advertisement filtering rules. Any one of the sub-resources is contained in one webpage block, the cloud can pre-extract the webpage block identification of the webpage block in which the sub-resource serving as the advertisement is located in the webpage, formulate an advertisement hiding rule according to the extracted webpage block identification, convert the advertisement hiding rule into a typesetting style label of an advertisement element contained in the webpage, insert the typesetting style label into the main resource, and send the main resource to the client.
In this embodiment, when the client typesets the webpage, the client hides the webpage block in which the webpage block identifier matches with the typesetting style label, and can be used as a supplementary means for matching the URL of the sub-resource with the advertisement filtering rule to identify whether the sub-resource is an advertisement, thereby achieving the purpose of completely filtering the advertisement in the webpage to be opened. In addition, in the embodiment, the advertisement of the webpage to be opened is only required to be filtered according to a few advertisement hiding rules corresponding to the webpage, rather than the advertisement of the webpage to be opened according to a large number of advertisement hiding rules, so that the computing resource spent by the terminal where the client is located for filtering the advertisement in the webpage can be greatly saved, and the speed of filtering the advertisement in the webpage can be improved.
Preferably, the layout style labels included in the main resource are analyzed, and after the webpage blocks matched with the layout style labels are hidden, the webpage displayed by the client is the filtered webpage as shown in fig. 7 and 8.
In fig. 7, the web page before filtering is the web page displayed by the client when the cloud does not filter the advertisement for the child resource request and does not obtain the advertisement hiding rule. In fig. 7, the display area where the advertisement elements are not displayed in the filtered web page and the advertisement elements before filtering are located has no advertisement margin, and the advertisement display area is replaced by the display area of the website content, so that the filtering function of the web page advertisement is realized, and the advertisement filtering efficiency, the web page loading speed and the user experience can be improved.
The web page before filtering in fig. 8 is the web page displayed by the client when the cloud performs advertisement filtering on the child resource request and does not obtain the advertisement hiding rule. With the advertisement display area left blank. The filtered web page of fig. 8 eliminates the advertisement whiteout and replaces the advertisement display area with the display area of the web site content. The filtering function of the webpage advertisements is realized, and meanwhile, the advertisement filtering efficiency, the webpage loading speed and the user experience can be improved.
In one embodiment, the step of parsing the layout style label included in the main resource and hiding the webpage block matched with the layout style label includes the following steps:
and reading the typesetting style labels and the weight values of the typesetting style labels from the main resource.
And if the weight is the priority maximum weight, analyzing the typesetting style label to obtain corresponding typesetting information.
And matching the mark of each webpage block with the typesetting style label, and hiding the webpage block matched with the typesetting style label according to the typesetting information.
Referring to fig. 9, fig. 9 is a schematic structural diagram of a filtering system for web advertisements according to a third embodiment of the present invention.
The filtering system for web page advertisement of this embodiment is preferably a system in the client, and may include a main resource module 210, a main resource receiving module 220, a sub resource module 230, a sub resource receiving module 240, and a web page composition module 250, where:
the main resource module 210 is configured to send a main resource request of a web page to the cloud.
A main resource receiving module 220, configured to receive a main resource obtained by the cloud from a third-party website, where the main resource includes a typesetting style tag used for hiding advertisement elements included in the webpage.
The sub-resource module 230 is configured to parse the sub-resource identifier of the main resource, and send a sub-resource request corresponding to the sub-resource identifier to the cloud.
And the child resource receiving module 240 is configured to receive a child resource returned by the cloud.
The webpage layout module 250 is configured to, when the webpage blocks corresponding to the main resource and the sub-resources are respectively laid out, parse the layout style labels included in the main resource, and hide the webpage blocks matched with the layout style labels.
This embodiment, receive the main resources that the high in the clouds acquireed from the third party website, the analysis the composing style label that main resources includes, it is right main resources with the layout is typeset to the sub resource, in order to hide the webpage contains the advertising element, realizes the filtering capability to the webpage advertisement, can improve advertisement filtration efficiency, webpage loading speed and user experience.
The main resource module 210 corresponds to the main resource request module 110, the main resource receiving module 220 corresponds to the main resource transmission module 130 and the composition label module 120, the sub resource module 230 corresponds to the sub resource request module 140, and the sub resource receiving module 240 corresponds to the sub resource transmission module 150.
The web page layout module 250 corresponds to the layout label module 120, and the layout style label and the web page block are the same as the layout style label and the web page block for hiding the advertisement elements included in the web page in the first embodiment of the filtering method for web page advertisements.
Preferably, the matching information contained in the typesetting style label and the identification of each webpage block can be matched.
Preferably, the layout style labels included in the main resource are analyzed, and after the webpage blocks matched with the layout style labels are hidden, the webpage displayed by the client is the filtered webpage as shown in fig. 7 and 8.
In fig. 7, the web page before filtering is the web page displayed by the client when the cloud does not filter the advertisement for the child resource request and does not obtain the advertisement hiding rule. In fig. 7, the display area where the advertisement elements are not displayed in the filtered web page and the advertisement elements before filtering are located has no advertisement margin, and the advertisement display area is replaced by the display area of the website content, so that the filtering function of the web page advertisement is realized, and the advertisement filtering efficiency, the web page loading speed and the user experience can be improved.
The web page before filtering in fig. 8 is the web page displayed by the client when the cloud performs advertisement filtering on the child resource request and does not obtain the advertisement hiding rule. With the advertisement display area left blank. The filtered web page of fig. 8 eliminates the advertisement whiteout and replaces the advertisement display area with the display area of the web site content. The filtering function of the webpage advertisements is realized, and meanwhile, the advertisement filtering efficiency, the webpage loading speed and the user experience can be improved.
In one embodiment, the webpage layout module 250 is further operable to:
and reading the typesetting style labels and the weight values of the typesetting style labels from the main resource.
And if the weight is the priority maximum weight, analyzing the typesetting style label to obtain corresponding typesetting information.
And matching the mark of each webpage block with the typesetting style label, and hiding the webpage block matched with the typesetting style label according to the typesetting information.
Referring to fig. 10, fig. 10 is a timing diagram illustrating a filtering method for web advertisements according to a fourth embodiment of the present invention.
The filtering method for the web page advertisement of this embodiment is preferably executed by a client, a cloud, and a third-party site in an interactive manner, and may include the following steps:
a1, the client sends a primary resource request to the cloud.
A2, the cloud receives the main resource request and sends the main resource request to the third-party site.
A3, the cloud acquires the advertisement hiding rules matched with the main resources, and converts the acquired advertisement hiding rules into typesetting style labels used for hiding the advertisement elements contained in the webpage corresponding to the main resources.
A4, the third-party site responds to the primary resource request and searches the corresponding primary resource.
And A5, the third-party site returns the found main resource to the cloud.
A6, the cloud end inserts the typesetting style label into the main resource returned by the third-party site.
A7, the cloud returns the main resource for inserting the typesetting style label to the client.
A8, the client receives the main resource returned by the cloud, and analyzes the sub-resource identifier of the main resource.
A9, the client sends the sub-resource request corresponding to the sub-resource identification to the cloud.
A10, the cloud receives the sub-resource request and judges whether the sub-resource request is an advertisement sub-resource request.
And A11, if not, the cloud intercepts the child resource request, and does not return the child resource to the client.
And A12, if not, the cloud end sends the child resource request to the third-party site.
A13, the third-party site responds to the sub-resource request and searches the corresponding sub-resource.
And A14, the third-party site returns the searched child resources to the cloud.
A15, the cloud receives the child resources and returns the child resources to the client.
A16, receiving the sub-resources returned by the cloud, analyzing the layout style labels included in the main resources when the main resources and the webpage blocks corresponding to the sub-resources are respectively typeset, and hiding the webpage blocks matched with the layout style labels.
The following is a fifth embodiment of the method for filtering a web advertisement according to the present invention.
In this embodiment, the cloud may include a cloud access layer, a business processing layer, a cloud kernel layer, and a cloud advertisement filter layer, and the filtering method of the web advertisement is preferably performed by the client, the cloud access layer, the business processing layer, the cloud kernel layer, the cloud advertisement filter layer, and a third-party website in an interactive manner, and may include the following steps:
and B1, the client sends the main resource request to the cloud access layer.
And B2, the cloud access layer receives the main resource request and sends the main resource request to the service processing layer.
B3, the service processing layer receives the primary resource request and sends the primary resource request to the third-party site.
And B4, the business processing layer inquires the advertisement hiding rules matched with the main resource request from the prestored advertisement hiding rules.
And B5, if the query is received, the business processing layer converts the queried advertisement hiding rule into a typesetting style label for hiding the advertisement elements contained in the webpage corresponding to the main resource request.
And B6, if not, the business processing layer sends a request for asynchronously acquiring the advertisement hiding rules of the advertisement elements contained in the webpage to the cloud kernel layer.
B7, responding the primary resource request by the third-party site, searching the corresponding primary resource,
and B8, the third-party site returns the searched main resource to the cloud service processing layer.
And B9, if the webpage is inquired, the cloud service processing layer inserts the typesetting style label into the main resource returned by the third-party website.
And B10, if the layout style label is inquired, the cloud service processing layer returns the main resource inserted with the layout style label to the cloud access layer.
And B11, the cloud access layer returns the main resource inserted with the typesetting style label to the client.
And B12, if not, the cloud service processing layer directly returns the main resource returned by the local site to the cloud access layer.
And B13, the cloud access layer returns the main resource returned by the third-party site to the client.
And B14, if not, the cloud core service layer traverses the main resource returned by the third-party site, and asynchronously obtains the advertisement hiding rule of the advertisement elements contained in the webpage.
And B15, returning the asynchronously acquired advertisement hiding rules to the business processing layer by the cloud core service layer.
And B16, the business processing layer stores the asynchronously acquired advertisement hiding rules corresponding to the webpage.
And B17, the client receives the main resource returned by the cloud access layer, and analyzes the sub-resource identifier of the main resource.
And B18, the client sends the sub-resource request corresponding to the sub-resource identification to the cloud access layer.
And B19, the cloud access layer receives the sub-resource request and sends the sub-resource request to the service processing layer.
B20, the business processing layer receives the sub-resource request and sends the sub-resource request to the cloud advertisement filter layer.
B21, the cloud advertisement filter layer judges whether the sub-resource request is an advertisement sub-resource request.
And B22, the cloud advertisement filtering layer returns the judgment result to the business processing layer.
B23, if not, the business processing layer sends the sub resource request to the third-party website, if the request is the advertisement sub resource request, the business processing layer intercepts the sub resource request and does not return the sub resource to the client.
And B24, the third-party site responds to the sub-resource request and searches the corresponding sub-resource.
And B25, the third-party site returns the searched sub-resources to the business processing layer.
And B26, the business processing layer receives the child resources and returns the child resources to the cloud access layer.
And B27, the cloud access layer receives the child resources and returns the child resources to the client.
And B28, the client receives the sub-resources returned by the cloud access layer, and when the main resources and the webpage blocks respectively corresponding to the sub-resources are typeset, the typesetting style labels included by the main resources are analyzed, and the webpage blocks matched with the typesetting style labels are hidden.
FIG. 11 is a block diagram of a computer system 1000 upon which embodiments of the present invention may be implemented. The computer system 1000 is only one example of a suitable computing environment for the invention and is not intended to suggest any limitation as to the scope of use of the invention. Neither should the computer system 1000 be interpreted as having a dependency or requirement relating to a combination of one or more components of the exemplary computer system 1000 illustrated.
The computer system 1000 shown in FIG. 11 is one example of a computer system suitable for use with the invention. Other architectures with different subsystem configurations may also be used. Such as well known desktop, notebook, personal digital assistant, smart phone, tablet, portable media player, and the like, may be suitable for use with some embodiments of the present invention. But are not limited to, the devices listed above.
As shown in fig. 11, the computer system 1000 includes a processor 1010, a memory 1020, and a system bus 1022. Various system components including the memory 1020 and the processor 1010 are connected to the system bus 1022. The processor 1010 is hardware for executing computer program instructions through basic arithmetic and logical operations in a computer system. Memory 1020 is a physical device used for temporarily or permanently storing computing programs or data (e.g., program state information). The system bus 1020 may be any of several types of bus structures including a memory bus or memory controller, a peripheral bus, and a local bus. The processor 1010 and the memory 1020 may be in data communication via a system bus 1022. Wherein memory 1020 includes Read Only Memory (ROM) or flash memory (neither shown), and Random Access Memory (RAM), which typically refers to main memory loaded with an operating system and application programs.
The computer system 1000 also includes a display interface 1030 (e.g., a graphics processing unit), a display device 1040 (e.g., a liquid crystal display), an audio interface 1050 (e.g., a sound card), and an audio device 1060 (e.g., speakers). Display device 1040 and audio device 1060 are media devices for experiencing multimedia content.
Computer system 1000 typically includes a storage device 1070. Storage device 1070 may be selected from a variety of computer readable media, which refers to any available media that may be accessed by computer system 1000, including both removable and non-removable media. For example, computer-readable media includes, but is not limited to, flash memory (micro SD cards), CD-ROM, Digital Versatile Disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can accessed by computer system 1000.
Computer system 1000 also includes input device 1080 and input interface 1090 (e.g., an IO controller). A user may enter commands and information into computer system 1000 through input device 1080, such as a keyboard, a mouse, a touch-panel device on display device 1040. Input device 1080 is typically connected to system bus 1022 through an input interface 1090, but may be connected by other interface and bus structures, such as a Universal Serial Bus (USB).
Computer system 1000 may logically connect with one or more network devices in a network environment. The network device may be a personal computer, a server, a router, a smartphone, a tablet, or other common network node. The computer system 1000 is connected to a network device through a Local Area Network (LAN) interface 1100 or a mobile communication unit 1110. A Local Area Network (LAN) refers to a computer network formed by interconnecting within a limited area, such as a home, a school, a computer lab, or an office building using a network medium. WiFi and twisted pair wiring ethernet are the two most commonly used technologies to build local area networks. WiFi is a technology that enables computer systems 1000 to exchange data between themselves or to connect to a wireless network via radio waves. The mobile communication unit 1110 is capable of making and receiving calls over a radio communication link while moving throughout a wide geographic area. In addition to telephony, the mobile communication unit 1110 also supports internet access in a 2G, 3G or 4G cellular communication system providing mobile data services.
It should be noted that other computer systems, including more or less subsystems than computer system 1000, can also be suitable for use with the invention. For example, the computer system 1000 may include a bluetooth unit capable of exchanging data over short distances, an image sensor for taking pictures, and an accelerometer for measuring acceleration.
As described in detail above, the computer system 1000 adapted to the present invention can perform the specified operations of the filtering method of the web advertisement. The computer system 1000 performs these operations in the form of software instructions executed by the processor 1010 in a computer-readable medium. These software instructions may be read into memory 1020 from storage device 1070 or from another device via local network interface 1100. The software instructions stored in memory 1020 cause processor 1010 to perform the web advertisement filtering method described above. Furthermore, the present invention can be implemented by hardware circuits or by a combination of hardware circuits and software instructions. Thus, implementations of the invention are not limited to any specific combination of hardware circuitry and software.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (18)

1. A method for filtering web advertisements is characterized by comprising the following steps:
receiving a main resource request sent by a client, and sending the main resource request to a third-party site;
acquiring a typesetting style label matched with the main resource request, wherein the typesetting style label is obtained by converting an advertisement hiding rule of a webpage corresponding to the main resource request and is used for hiding a webpage label of an advertisement element contained in the webpage;
and receiving the main resource sent by the third-party website in response to the main resource request, inserting the typesetting style tag into the main resource and sending the main resource to the client, so that when the client typesets the webpage according to the typesetting style tag, a webpage block where the advertisement elements contained in the webpage are located is hidden, and the display area of the website content replaces the display area of the advertisement elements.
2. The method for filtering web page advertisements according to claim 1, wherein the step of receiving the primary resource sent by the third-party site in response to the primary resource request further comprises the steps of:
receiving a sub-resource request of the client, and identifying whether the sub-resource request is an advertisement sub-resource request;
if not, sending the sub-resource request to the third-party site, receiving the sub-resource returned by the third-party site and sending the sub-resource to the client;
if yes, intercepting the child resource request.
3. The method for filtering web page advertisements according to claim 2, wherein the step of identifying whether the sub-resource request is an advertisement sub-resource request further comprises the steps of:
analyzing a uniform resource locator of the sub-resource;
acquiring an advertisement filtering rule corresponding to the webpage;
and judging whether the analyzed uniform resource locator meets the advertisement filtering rule, if so, judging that the sub-resource request is an advertisement sub-resource request, and if not, judging that the sub-resource request is not the advertisement sub-resource request.
4. The method for filtering web page advertisements according to any one of claims 1 to 3, wherein the step of obtaining the typesetting style label matching with the main resource request comprises the following steps:
reading webpage information from the main resource request;
inquiring advertisement hiding rules stored corresponding to the webpage information from prestored advertisement hiding rules;
if the webpage is inquired, converting the inquired advertisement hiding rules into typesetting style labels for hiding the advertisement elements contained in the webpage.
5. The method for filtering web page advertisements according to claim 4, wherein the step of converting the queried advertisement hiding rules into typesetting style tags for hiding advertisement elements contained in the web page further comprises the steps of:
converting the inquired advertisement hiding rules into typesetting style labels for hiding advertisement elements contained in the webpage;
and taking the maximum priority weight as the weight of the typesetting style label.
6. The method for filtering web page advertisements according to claim 4, wherein after the step of querying the advertisement hiding rules stored in correspondence with the web page information from the pre-stored advertisement hiding rules, the method further comprises the steps of:
if the advertisement hiding rule stored corresponding to the webpage information is not inquired, receiving the main resource sent by the third-party site in response to the main resource request, and directly sending the main resource to the client;
requesting to asynchronously obtain an advertisement hiding rule of an advertisement element contained in the webpage through a cloud kernel;
and storing the asynchronously acquired advertisement hiding rules corresponding to the webpage information.
7. The method for filtering web page advertisements of claim 6, wherein the cloud kernel is configured to parse the main resource, generate the web page corresponding to the received sub-resource, traverse the web page, match an element included in the web page with a preset advertisement element, use an element, which is matched with the preset advertisement element, of the elements included in the web page as the advertisement element included in the web page, generate an advertisement hiding rule for hiding the advertisement element included in the web page, and store the advertisement hiding rule corresponding to the web page information.
8. A system for filtering web advertisements, comprising:
the main resource request module is used for receiving a main resource request sent by a client and sending the main resource request to a third-party site;
the typesetting label module is used for acquiring a typesetting style label matched with the main resource request, wherein the typesetting style label is obtained by converting an advertisement hiding rule of a webpage corresponding to the main resource request and is used for hiding a webpage label of an advertisement element contained in the webpage corresponding to the main resource request;
and the main resource transmission module is used for receiving the main resource sent by the third-party website in response to the main resource request, inserting the typesetting style label into the main resource and sending the main resource to the client so that when the client typesets the webpage according to the typesetting style label, a webpage block where the advertisement element contained in the webpage is located is hidden, and the display area of the advertisement element is replaced by the display area of the website content.
9. The system for filtering web page advertisements of claim 8 further comprising a sub-resource request module, wherein the sub-resource request module is configured to:
receiving a sub-resource request of the client, and identifying whether the sub-resource request is an advertisement sub-resource request;
if not, sending the sub-resource request to the third-party site, receiving the sub-resource returned by the third-party site and sending the sub-resource to the client;
if yes, intercepting the child resource request.
10. The system for filtering web page advertisements as claimed in claim 9, wherein the sub-resource request module is further configured to
Analyzing a uniform resource locator of the sub-resource;
acquiring an advertisement filtering rule corresponding to the webpage;
and judging whether the analyzed uniform resource locator meets the advertisement filtering rule, if so, judging that the sub-resource request is an advertisement sub-resource request, and if not, judging that the sub-resource request is not the advertisement sub-resource request.
11. The system for filtering web page advertisements according to any one of claims 8 to 10, wherein the typesetting tag module is further configured to:
reading webpage information from the main resource request;
inquiring advertisement hiding rules stored corresponding to the webpage information from prestored advertisement hiding rules;
if the webpage is inquired, converting the inquired advertisement hiding rules into typesetting style labels for hiding the advertisement elements contained in the webpage.
12. The system for filtering web page advertisements of claim 11 further comprising an asynchronous processing module configured to:
when the advertisement hiding rule stored corresponding to the webpage information is not inquired, receiving the main resource sent by the third-party site in response to the main resource request, and enabling the main resource transmission module to directly send the main resource to the client;
requesting to traverse the main resource through a cloud kernel, and asynchronously acquiring an advertisement hiding rule of an advertisement element contained in the webpage;
and storing the asynchronously acquired advertisement hiding rules corresponding to the webpage information.
13. A method for filtering web advertisements is characterized by comprising the following steps:
sending a main resource request of a webpage to a cloud;
receiving a main resource acquired by the cloud from a third-party website, wherein the main resource comprises a typesetting style tag used for hiding advertisement elements contained in the webpage; the typesetting style label is obtained by converting the advertisement hiding rule of the webpage corresponding to the main resource request and is used for hiding the webpage label of the advertisement element contained in the webpage;
analyzing the main resource and sending a sub-resource request to the cloud;
receiving child resources returned by the cloud;
when the webpage blocks corresponding to the main resource and the sub-resource are typeset, the typesetting style labels included in the main resource are analyzed, and the webpage blocks matched with the typesetting style labels are hidden, so that the display area of the website content replaces the display area of the advertisement elements.
14. The method for filtering web page advertisements according to claim 13, wherein the step of parsing the layout style label included in the main resource and hiding the web page block matched with the layout style label comprises the steps of:
reading the typesetting style labels and the weight values of the typesetting style labels from the main resources;
if the weight is the priority maximum weight, analyzing the typesetting style label to obtain corresponding typesetting information;
and matching the mark of each webpage block with the typesetting style label, and hiding the webpage block matched with the typesetting style label according to the typesetting information.
15. A system for filtering web advertisements, comprising:
the main resource module is used for sending a main resource request of a webpage to the cloud;
the main resource receiving module is used for receiving a main resource acquired by the cloud from a third-party website, wherein the main resource comprises a typesetting style tag used for hiding advertisement elements contained in the webpage; the typesetting style label is obtained by converting the advertisement hiding rule of the webpage corresponding to the main resource request and is used for hiding the webpage label of the advertisement element contained in the webpage;
the sub-resource module is used for analyzing the main resource and sending a sub-resource request to the cloud;
the child resource receiving module is used for receiving child resources returned by the cloud end;
and the webpage typesetting module is used for analyzing the typesetting style labels included in the main resource and hiding the webpage blocks matched with the typesetting style labels when typesetting the webpage blocks respectively corresponding to the main resource and the sub-resources so as to enable the display area of the website content to replace the display area of the advertisement elements.
16. The system for filtering web page advertisements of claim 15 wherein the web page composition module is further configured to:
reading the typesetting style labels and the weight values of the typesetting style labels from the main resources;
if the weight is the priority maximum weight, analyzing the typesetting style label to obtain corresponding typesetting information;
and matching the mark of each webpage block with the typesetting style label, and hiding the webpage block matched with the typesetting style label according to the typesetting information.
17. A storage medium on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out a method of filtering a web advertisement according to any one of claims 1 to 7 or 13 to 14.
18. A terminal device comprising a storage medium, a processor and a computer program stored on the storage medium and executable on the processor, the processor implementing the method of filtering a web advertisement according to any one of claims 1 to 7 or 13 to 14 when executing the program.
CN201410568315.6A 2014-10-22 2014-10-22 Method and system for filtering webpage advertisements Active CN105589870B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410568315.6A CN105589870B (en) 2014-10-22 2014-10-22 Method and system for filtering webpage advertisements

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410568315.6A CN105589870B (en) 2014-10-22 2014-10-22 Method and system for filtering webpage advertisements

Publications (2)

Publication Number Publication Date
CN105589870A CN105589870A (en) 2016-05-18
CN105589870B true CN105589870B (en) 2020-09-25

Family

ID=55929457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410568315.6A Active CN105589870B (en) 2014-10-22 2014-10-22 Method and system for filtering webpage advertisements

Country Status (1)

Country Link
CN (1) CN105589870B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106599105A (en) * 2016-11-29 2017-04-26 珠海市魅族科技有限公司 Display control method and electronic equipment
CN111143526B (en) * 2019-12-18 2024-03-22 口碑(上海)信息技术有限公司 Method and device for generating and controlling configuration information of counsel service control

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100211467A1 (en) * 2009-02-18 2010-08-19 Kumaresan Ramanathan computerized method and system for effectively utilizing empty-spaces on websites
CN102768664A (en) * 2011-05-06 2012-11-07 李超 Distributed webpage advertisement blocking method and system
CN103593354B (en) * 2012-08-15 2018-09-07 腾讯科技(深圳)有限公司 A kind of method, apparatus, server and the system of screen page ad
CN103530560A (en) * 2013-09-29 2014-01-22 北京金山网络科技有限公司 Method, device and client side for advertisement blocking
CN104021172B (en) * 2014-05-30 2017-07-28 北京搜狗科技发展有限公司 Advertisement filter method and advertisement filter device

Also Published As

Publication number Publication date
CN105589870A (en) 2016-05-18

Similar Documents

Publication Publication Date Title
EP3518124A1 (en) Webpage rendering method and related device
CN104899220B (en) Application program recommendation method and system
US8645355B2 (en) Mapping Uniform Resource Locators of different indexes
KR20190039230A (en) Method and system for server-side rendering of native content for presentations
CN108717437B (en) Search result display method and device and storage medium
CN108023867B (en) Method for filtering mobile terminal webpage advertisement, gateway server and filtering server
WO2016000507A1 (en) Traffic-saving mode search service method, server, client and system
TWI584149B (en) Web page access request response method and device
CN105589922A (en) Page display method, device and system and page display assisting method and device
US20150012533A1 (en) Method and client device for accessing webpage
WO2015000342A1 (en) Method and client device for accessing webpage
CN112256772A (en) Data service method, device and readable storage medium
CN103544150A (en) Method and system for providing recommendation information for mobile terminal browser
CN110955855B (en) Information interception method, device and terminal
CN105589870B (en) Method and system for filtering webpage advertisements
JP6684894B2 (en) Method and apparatus for push information distribution
CN110119483A (en) Display methods, device, terminal device and the storage medium of multimedia file
CN111680247A (en) Local calling method, device, equipment and storage medium of webpage character string
JP5220090B2 (en) Advertisement distribution apparatus, advertisement distribution method and program
US20160182520A1 (en) Method, apparatus and system for client accessing authenticated web address
CN108614844B (en) Multimedia file generation method and device
CN107656935B (en) Webpage display method and device
CN111444448B (en) Data processing method, server and system
WO2019001333A1 (en) Application interface display method, apparatus and electronic device
CN111641690B (en) Session message processing method and device and electronic equipment

Legal Events

Date Code Title Description
C06 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