Web Page Advertisement Filtering Method, Electronic Device, and Storage Medium
20230401606 · 2023-12-14
Inventors
Cpc classification
G06F16/9535
PHYSICS
G06F16/958
PHYSICS
International classification
G06F16/9535
PHYSICS
Abstract
A method includes receiving a to-be-filtered web page element sent by a client in a local area network in which the main client is located; sending first query broadcast information including the to-be-filtered web page element to the local area network in which the main client is located; receiving first query feedback information generated by all clients in the local area network based on the first query broadcast information; if the first query feedback information meets a preset condition, determining that the to-be-filtered web page element is an advertisement; and updating an advertisement filtering rule based on the to-be-filtered web page element that is an advertisement.
Claims
1. A web page advertisement filtering method, comprising: receiving, from a first client in a local area network in which a main client is located, a to-be-filtered web page element; sending, to the local area network, first query broadcast information comprising the to-be-filtered web page element; receiving, from all clients in the local network, first query feedback information generated by all clients in the local area network based on the first query broadcast information; determining that the to-be-filtered web page element is a first advertisement when the first query feedback information meets a first preset condition; and updating, in response to determining that the to-be-filtered web page element is the first advertisement, an advertisement filtering rule to obtain a first updated advertisement filtering rule.
2. The web page advertisement filtering method of claim 1, further comprising delivering the first updated advertisement filtering rule to a second client in the local area network.
3. The web page advertisement filtering method of claim 1, further comprising filtering a web page advertisement according to the first updated advertisement filtering rule.
4. The web page advertisement filtering method of claim 1, wherein before receiving the to-be-filtered web page element, the web page advertisement filtering method further comprises: determining, from among the clients, a third client as the main client.
5. The web page advertisement filtering method according to of claim 4, wherein determining the third client as the main client comprises: sending recommendation broadcast information comprising a request for a vote for the third client in the local area network; receiving, from a fourth client in the local area network, recommendation feedback information based on the recommendation broadcast information; and determining the third client as the main client when the recommendation feedback information meets a second preset condition.
6. The web page advertisement filtering method of claim 5, further comprising sending notification broadcast information indicating that the third client is the main client to the local area network.
7. The web page advertisement filtering method of claim 1, further comprising: receiving, from a fifth client in the local area network, query broadcast information querying whether the fifth client is the main client, wherein the fifth client is a client newly new to the local area network after the advertisement filtering rule is updated; returning to the fifth client, acknowledgment information based on the query broadcast information; receiving, from the fifth client, an advertisement filtering rule request; and sending, to the fifth client, the first updated advertisement filtering rule based on the advertisement filtering rule request.
8. The web page advertisement filtering method of claim 1, further comprising: receiving, from the first client, a to-be-displayed web page element; sending to the local area network, second query broadcast information comprising the to-be-displayed web page element; receiving, from all the clients in the local area network, second query feedback information based on the second query broadcast information; determining that the to-be-displayed web page element is not a second advertisement when the second query feedback information meets a second preset rule; and updating, in response to determining that the to-be-displayed web element is not the second advertisement, the advertisement filtering rule or the first updated advertisement filtering rule to obtain a second updated advertisement filtering rule.
9. An electronic device, comprising: a memory configured to store instructions; and one or more processors coupled to the memory and configured to: receive, from a first client in a local area network it which a main client is located, a to-be-filtered web page element; send, to the local area network, first query broadcast information comprising the to-be-filtered web page element; receive, from all clients in the local area network, first query feedback information based on the first query broadcast information; determine that the to-be-filtered page element is a first advertisement when the first query feedback information meets a preset condition; and update, in response to determining that the to-be-filtered web page element is the first advertisement, an advertisement filtering rule to obtain a first updated advertisement filtering rule.
10. (canceled)
11. The electronic device of claim 9, wherein the one or more processors are further configured to deliver the first updated advertisement filtering rule to a second client in the local area network.
12. The electronic device of claim 11, wherein the one or more processors are further configured to filter a web page advertisement according to the first updated advertisement filtering rule.
13. The electronic device of claim 9, wherein one or more processors are further configured to determine, from among the clients, a third client as the main client.
14. The electronic device of claim 9, wherein the one or more processors are further configured to: send recommendation broadcast information comprising a request for a vote for the third client in the local area network; receive, from a fourth client in the local area network, recommendation feedback information based on the recommendation broadcast information; and determine the third client as the main client when the recommendation feedback information meets a second preset condition.
15. The electronic device of claim 14, wherein the one or more processors are further configured to send notification broadcast information indicating that the third client is the main client to the local area network.
16. The electronic device of claim 9, wherein the one or more processors are further configured to: receive, from a fifth client in the local area network, query broadcast information querying whether the fifth client is the main client, wherein the fifth client is a new to the local area network after the advertisement filtering rule is updated; return, to the fifth client, acknowledgment information based on the query broadcast information; receive, from the fifth client, an advertisement filtering rule request; and send, to the fifth client, the first updated advertisement filtering rule based on the advertisement filtering rule request.
17. The electronic device of claim 9, wherein the one or more processors are further configured to: receive, from the first client, a to-be-displayed web page element; send, to the local area network, second query broadcast information comprising the to-be-displayed web page element; receive, from all the clients in the local area network, second query feedback information based on the second query broadcast information; determine that the to-be-displayed web page element is not a second advertisement when the second query feedback information meets a second preset rule; and update, in response to determining that the to-be-displayed web page element is not the second advertisement, the advertisement filtering rule or the first updated advertisement filtering rule to obtain a second updated advertisement filtering rule.
18. A computer program product comprising computer-executable instructions that are stored on a non-transitory computer-readable storage medium and that, when executed by one or more processors, cause an electronic device to: receive, from a first client in a local area network in which a main client is located, a to-be-filtered web page element; send, to the local area network, first query broadcast information comprising the to-be-filtered web page element; receive, from all clients in the local area network, first query feedback information based on the first query broadcast information; determine that the to-be-filtered web page element is a first advertisement when the first query feedback information meets a preset condition; and update, in response to determining that the to-be-filtered web page element is the first advertisement, an advertisement filtering rule to obtain a first updated advertisement filtering rule.
19. The computer program product of claim 18, wherein the instructions when executed by the one or more processors, further cause the electronic device to deliver the first updated advertisement filtering rule to a second client in the local area network.
20. The computer program product of claim 19, wherein the instructions when executed by the one or more processors, further cause the electronic device to filter a web page advertisement according to the first updated advertisement filtering rule.
21. The computer program product of claim 18, wherein the instructions when executed by the one or more processors, further cause the electronic device to determine, from among the clients, a third client as the main client.
Description
BRIEF DESCRIPTION OF DRAWINGS
[0036]
[0037]
[0038]
[0039]
[0040]
[0041]
[0042]
[0043]
[0044]
[0045]
[0046]
DESCRIPTION OF REFERENCE SIGNS OF MAIN COMPONENTS
[0047]
TABLE-US-00001 Electronic device 1 Network device 2 Client 10 Communication module 20 Server 3 Memory 30 Processor 40
DESCRIPTION OF EMBODIMENTS
[0048] The terms “first”, “second”, “third”, “fourth”, and “fifth” mentioned below are used merely for the purpose of description, and shall not be construed as indicating or implying relative importance or implying a quantity of indicated technical features. Therefore, a feature preceded by “first”, “second”, “third”, “fourth”, or “fifth” may explicitly or implicitly include one or more features. In descriptions of embodiments of this application, words such as “for example” are used to represent giving an example, an illustration, or a description. Any embodiment or design solution described as “for example” in embodiments of this application should not be explained as being more preferred or having more advantages than another embodiment or design solution. Exactly, use of the words such as “for example” is intended to present a related concept in a specific manner.
[0049] Unless otherwise defined, all technical and scientific terms used in this specification have same meanings as those usually understood by a person skilled in the art of this application. The term used in this specification of this application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the present invention. It should be understood that in this application, unless otherwise specified, “a plurality of” means two or more than two.
[0050] According to a web page advertisement filtering method in an embodiment of the present invention, a client may transmit advertisement feedback information to a server based on a user operation, the server generates an advertisement filtering rule based on the advertisement feedback information, and delivers the advertisement filtering rule to each client, and the client filters or blocks an advertisement according to the advertisement filtering rule when loading a web page. However, the method relies on the filtering rule generated by the server. If the client is unable to connect to the server, the client cannot update the advertisement filtering rule, and consequently cannot identify and filter a new advertisement. In addition, the server needs to adjust the advertisement filtering rule based on feedback of the client. Regardless of whether the server adjusts the advertisement filtering rule manually or intelligently, there may be a specific delay in delivering the advertisement filtering rule. In addition, load of the server increases with a large quantity of client requests generated due to an increasing quantity of clients, and with changes of the web page and a form and emergence of the new web page.
[0051]
[0052]
[0053] The memory 30 may be configured to store the client. The memory 30 may be further configured to store another software program and/or module/unit. The processor 40 implements various functions of the electronic device 1 by running or executing the software program and/or the module/unit stored in the memory 30 and invoking data stored in the memory 30. The memory 30 may mainly include a program storage area and a data storage area. The program storage area may store an operating system, an application program required by at least one function (such as a web page browsing function, a sound playing function, and an image playing function), and the like. The data storage area may store data (such as audio data) created according to use of the electronic device 1, and the like. In addition, the memory 30 may include a non-volatile computer-readable memory, for example, a hard disk, an internal storage, a plug-in hard disk, a smart media card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one magnetic disk storage device, a flash memory device, or another non-volatile solid-state storage device.
[0054] The processor 40 may be a central processing unit (Central Processing Unit, CPU), or may be another general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or another programmable logic device, a discrete gate, a transistor logic device, a discrete hardware component, or the like. The processor 40 may be a microprocessor, or the processor 40 may be any conventional processor, or the like. The processor 40 is a control center of the electronic device 1, and all parts of the entire electronic device 1 are connected by using various interfaces and lines.
[0055]
[0056] S31: One or more first clients in a same local area network send recommendation broadcast information including a request for a vote for the first client to the local area network in which the first client is located.
[0057] The one or more first clients are clients that simultaneously initiate requests for votes for the first clients. In this embodiment, the one or more first clients are a client 1. In another embodiment, the one or more first clients may be, for example, a client 1 and a client 2. Each first client may send the recommendation broadcast information including the request for the vote for each first client to the local area network. For example, the client 1 sends information including a request for a vote for the client 1 to the local area network, and the client 2 sends information including a request for a vote for the client 2 to the local area network. In the local area network, all other clients other than the first client can receive the broadcast information sent by the first client.
[0058] In this embodiment, as shown in
[0059] S32: A second client sends recommendation feedback information to each first client based on the recommendation broadcast information, where the second client is a client in the local area network other than the first client.
[0060] There may be one or more second clients. The recommendation feedback information includes voting for the first client or not voting for the first client. Each client has one vote, that is, may vote for one client to elect the client as a main client.
[0061] In this embodiment, the second client includes, for example, the client 2 and the client 3 shown in
[0062] To prevent another client from requesting a vote from the client after the client completes voting, the client 2 further transmits, to the client 3, information indicating that the client 1 has been voted, and the client 3 further transmits, to the client 2, information indicating that the client 1 has been voted.
[0063] S33: The first client determines the first client as the main client if the recommendation feedback information meets a preset condition.
[0064] The preset condition includes a quantity of received votes is greater than or equal to a preset quantity, a proportion of received votes is greater than a preset value, or the like. In this embodiment, the client 1, for example, as shown in
[0065] S34: The first client determined as the main client sends notification broadcast information including that the first client is the main client to the local area network in which the first client is located.
[0066] For example, as shown in
[0067] In this embodiment, the method further includes:
[0068] If the recommendation feedback information does not meet the preset condition, the first client determines that the first client is not the main client.
[0069] In this case, the another client, for example, the client 3, may send recommendation broadcast information including a request for a vote for the another client to the local area network in which the client is located.
[0070]
[0071] S51: A third client determines a to-be-filtered web page element based on an operation on a browsed web page.
[0072] The operation on the browsed web page may include an operation such as touching and holding or right-clicking specific content on the browsed web page. In this case, a browser displays a selection dialog box. The selection dialog box includes an option “mark as advertisement”. The operation on the browsed web page may further include a selection operation on the option “mark as advertisement”. The third client is any client in the local area network other than the main client. Determining the to-be-filtered web page element is determining the to-be-filtered web page element based on content of the operation.
[0073] For example, content of an HTML web page is as follows:
TABLE-US-00002 <html <head> <title >My first HTML page</title> </head> <body> <div id=“TopBanner_02” class=“jy_fx168_default_head_navAdBox_middle”></div> <p >body content of an element is displayed in a browser. </p> <p >title the content of the element is displayed in a title bar of the browser. </p> <img src=“http://png.zhongwangmy.cn/jpg/200” >abc.img</ img> <svg xmlns=“http://www.w3.org/2000/svg” version=“1.1” height=“190”> <polygon points=“100,10 40,180 190,60 10,60 160,180” style=“fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;” /> </svg> </body> </html>
[0074] If a web page element corresponding to the content of the operation is: <img src=“http://png.zhongwangmy.cn/jpg/200” >abc.img</img>, key information in the web page element, for example, png.zhongwangmy.cn/jpg/200, is determined as the to-be-filtered web page element, that is, an advertisement.
[0075] Referring to
[0076] S52: The third client transmits the to-be-filtered web page element to the main client of the local area network in which the third client is located.
[0077] In this embodiment, the third client transmits the to-be-filtered web page element to the main client in an agreed manner, so that the main client may determine, in the agreed manner, that received content is the to-be-filtered web page element. For example, the third client transmits adltems: [“png.zhongwangmy.cn/jpg/200”] to the main client.
[0078] That the third client transmits the to-be-filtered web page element to the main client may be, for example, as shown in
[0079] S53: The main client sends first query broadcast information including the to-be-filtered web page element to the local area network in which the main client is located.
[0080] In this embodiment, after receiving adltems: [“png.zhongwangmy.cn/jpg/200”] transmitted by the third client, the main client parses out keywords adltems and png.zhongwangmy.cn/jpg/200, and determines png.zhongwangmy.cn/jpg/200 as the to-be-filtered web page element according to the keyword adltems.
[0081] Before that the main client sends first query broadcast information including the to-be-filtered web page clement to the local area network in which the main client is located, the method further includes:
[0082] After receiving to-be-filtered web page element within a preset time, the main client sends the first query broadcast information including the to-be-filtered web page element to the local area network in which the main client is located.
[0083] The to-be-filtered web page element within the preset time may be two to-be-filtered web page elements transmitted by the third client within the preset time, or may be to-be-filtered web page elements transmitted by the third client and another client within the preset time. The preset time may be, for example, one week or three days.
[0084] That the main client sends first query broadcast information including the to-be-filtered web page element to the local area network in which the main client is located may be, for example, as shown in
[0085] S54: Each client sends first query feedback information to the main client based on the first query broadcast information.
[0086] The first query feedback information includes that the to-be-filtered web page element is voted as an advertisement and the to-be-filtered web page element is voted as being not an advertisement. Each client has one vote for each to-be-filtered web page element. For example, each client may vote a to-be-filtered web page element 1 as being an advertisement or being not an advertisement, but cannot vote the to-be-filtered web page element 1 as being an advertisement and being not an advertisement. Each piece of first query feedback information may correspond to one to-be-filtered web page element, or each piece of first query feedback information corresponds to a plurality of to-be-filtered web page elements.
[0087] In this embodiment, for example, as shown in
[0088] S55: If the first query feedback information meets a preset condition, the main client determines that the to-be-filtered web page element is an advertisement.
[0089] The preset condition may include: a quantity of received votes for which the to-be-filtered web page element is an advertisement is greater than a quantity of received votes for which the to-be-filtered web page element is not an advertisement, or a proportion of received votes for which the to-be-filtered web page element is an advertisement is greater than a preset value, or the like. The first query feedback information is first query feedback information of one to-be-filtered web page element or first query feedback information of some to-be-filtered web page elements.
[0090] In this embodiment, the main client, that is, the client 2, for example, as shown in
[0091] S56: The main client updates an advertisement filtering rule based on the to-be-filtered web page element that is an advertisement.
[0092] There may be one or more to-be-filtered web page elements being an advertisement. The advertisement filtering rule may be, for example, easylist.txt. The advertisement filtering rule records a large amount of advertisement information, for example, png.zhongwangmy.cn/jpg/201. Updating the advertisement filtering rule may be, for example, adding png.zhongwangmy.cn/jpg/200 to the advertisement filtering rule.
[0093] In this embodiment, the main client, that is, the client 2, for example, as shown in
[0094] S57: The main client delivers an updated advertisement filtering rule to a fourth client, where the fourth client is a client in the local area network other than the main client.
[0095] There may be one or more fourth clients. In this embodiment, the main client, that is, the client 2, for example, as shown in
[0096] S58: The fourth client updates a local advertisement filtering rule according to the updated advertisement filtering rule.
[0097] Each client includes an advertisement filtering rule, and filters a web page advertisement according to the advertisement filtering rule. In this embodiment, as shown in
[0098] S59: Each client in the local area network filters the web page advertisement according to the updated advertisement filtering rule.
[0099] The web page element of the web page includes separately downloaded resources, for example, multimedia and JS. Before downloading the web page element, the client matches the web page element with the updated advertisement filtering rule. If the web page element matches the updated advertisement filtering rule, the client does not download the web page element. If the web page element does not match the updated advertisement filtering rule, the client downloads the web page element. For example, if the client attempts to download a resource corresponding to png.zhongwangmy.cn/jpg/200, and the client determines that the web page element matches the updated advertisement filtering rule, the client does not download the web page element, to filter a web page advertisement.
[0100] In this embodiment, as shown in
[0101] In this embodiment, the method further includes:
[0102] If the first query feedback information does not meet the preset condition, the main client determines that the to-be-filtered web page element is not an advertisement.
[0103] In this embodiment, the main client, that is, the client 2, for example, as shown in
[0104]
[0105] S71: The fifth client sends query broadcast information including querying whether the fifth client is the main client to a local area network in which the fifth client is located, where the fifth client is a client newly joining the local area network after the advertisement filtering rule is updated.
[0106] The fifth client is the client newly joining the local area network. The fifth client may freely communicate with any client in the local area network. Referring to
[0107] S72: The main client in the local area network returns acknowledgment information to the fifth client based on the query broadcast information.
[0108] As shown in
[0109] S73: The fifth client sends an advertisement filtering rule request to the main client.
[0110] As shown in
[0111] S74: The main client sends the advertisement filtering rule to the fifth client based on the advertisement filtering rule request.
[0112] The main client includes the advertisement filtering rule, and the main client filters a web page advertisement according to the advertisement filtering rule. As shown in
[0113] S75: The fifth client filters a web page advertisement according to the advertisement filtering rule.
[0114] As shown in
[0115]
[0116] S91: A sixth client determines a to-be-displayed web page element based on an operation on a web page browsed when a web page advertisement blocking switch is in an off state.
[0117] The sixth client is any client in a local area network other than a main client. Each client includes a web page advertisement blocking switch. If the web page advertisement blocking switch is in an on state, the client does not display an advertisement. If the web page advertisement blocking switch is in the off state, the client displays an advertisement. When it needs to determine which web page elements are to be displayed, the web page advertisement blocking switch may be switched from the on state to the off state or from the off state to the on state. In this way, by comparing a result obtained when an advertisement is blocked with a result obtained when no advertisement is blocked, the user may determine which web page elements are blocked, and determine which web page elements do not want to be blocked.
[0118] The operation on the browsed web page may include an operation such as touching and holding or right-clicking specific content on the browsed web page. In this case, a browser displays a selection dialog box. The selection dialog box includes an option “mark as non-advertisement”. The operation on the browsed web page may further include a selection operation on the option “mark as non-advertisement”. Determining the to-be-filtered web page clement is determining the to-be-displayed web page element based on content of the operation.
[0119] For example, content of an HTML web page is as follows:
TABLE-US-00003 <html> <head> <title >My first HTML page</title> </head> <body> <div id=“TopBanner_02” class=“jy_fx168_default_head_navAdBox_middle”></div> <p >body content of an element is displayed in a browser. </p> <p >title the content of the element is displayed in a title bar of the browser. </p> <img src=“http://png.zhongwangmy.cn/jpg/205” >abc.img</ img> <svg xmlns=“http://www.w3.org/2000/svg” version=“1.1” height=“190”> <polygon points=“100,10 40,180 190,60 10,60 160,180” style=“fill:lime;stroke:purple;stroke-width:5;fill-rule:evenodd;” /> </svg> </body> </html>
[0120] If a web page element corresponding to the content of the operation is: <img src=“http://png.zhongwangmy.cn/jpg/205” >abc.img</img>, key information in the web page element, for example, png.zhongwangmy.cn/jpg/205, is determined as the to-be-displayed web page element.
[0121] Referring to
[0122] S92: The sixth client transmits the to-be-displayed web page element to the main client of the local area network in which the sixth client is located.
[0123] In this embodiment, the sixth client transmits the to-be-displayed web page element to the main client in an agreed manner, so that the main client may determine, in the agreed manner, that received content is the to-be-displayed web page element. For example, the sixth client transmits notadltems: [“png. zhongwangmy.cn/jpg/205”] to the main client.
[0124] That the sixth client transmits the to-be-displayed web page element to the main client may be, for example, as shown in
[0125] S93: The main client sends second query broadcast information including the to-be-displayed web page element to the local area network in which the main client is located.
[0126] In this embodiment, after receiving notadltems: [“png.zhongwangmy.cn/jpg/205”] transmitted by the sixth client, the main client parses out keywords notadltems and png.zhongwangmy.cn/jpg/205, and determines png.zhongwangmy.cn/jpg/205 as the to-be-displayed web page element according to the keyword notadltems.
[0127] Before that the main client sends second query broadcast information including the to-be-displayed web page element to the local area network in which the main client is located, the method further includes:
[0128] After receiving the to-be-displayed web page element within a preset time, the main client sends the second query broadcast information including the to-be-displayed web page element to the local area network in which the main client is located.
[0129] The to-be-displayed web page element within the preset time may be two to-be-displayed web page elements transmitted by the sixth client within the preset time, or may be to-be-displayed web page elements transmitted by the sixth client and another client within the preset time. The preset time may be, for example, one week or three days.
[0130] That the main client sends second query broadcast information including the to-be-displayed web page element to the local area network in which the main client is located may be, for example, as shown in
[0131] S94: Each client sends second query feedback information to the main client based on the second query broadcast information.
[0132] The second query feedback information includes that the to-be-displayed web page element is voted as an advertisement and the to-be-displayed web page element is voted as being not an advertisement. Each client has one vote for each to-be-displayed web page element. For example, each client may vote a to-be-displayed web page element 1 as being an advertisement or being not an advertisement, but cannot vote the to-be-displayed web page element 1 as being an advertisement and being not an advertisement. Each piece of second query feedback information may correspond to one to-be-displayed web page element, or each piece of second query feedback information corresponds to a plurality of to-be-displayed web page elements.
[0133] In this embodiment, for example, as shown in
[0134] S95: If the second query feedback information meets a preset rule, the main client determines that the to-be-displayed web page element is not an advertisement.
[0135] The preset rule may include: a quantity of received votes for which the to-be-displayed web page element is not an advertisement is greater than a quantity of received votes for which the to-be-displayed web page element is an advertisement, or a proportion of received votes for which the to-be-displayed web page element is not an advertisement is greater than a preset value, or the like. The second query feedback information is second query feedback information of one to-be-displayed web page element or second query feedback information of some to-be-displayed web page elements.
[0136] In this embodiment, the main client, that is, the client 2, for example, as shown in
[0137] S96: The main client updates the advertisement filtering rule based on the to-be-displayed web page element that is not an advertisement.
[0138] There may be one or more to-be-displayed web page elements being not an advertisement. The advertisement filtering rule may be, for example, easylist.txt. The advertisement filtering rule records a large amount of advertisement information, for example, png.zhongwangmy.cn/jpg/205. Updating the advertisement filtering rule may be, for example, deleting png.zhongwangmy.cn/jpg/205 from the advertisement filtering rule.
[0139] In this embodiment, the main client, that is, the client 2, for example, as shown in
[0140] S97: The main client delivers an updated advertisement filtering rule to a fourth client, where the fourth client is a client in the local area network other than the main client.
[0141] There may be one or more fourth clients. In this embodiment, the main client, that is,
[0142] the client 2, for example, as shown in
[0143] S98: The fourth client updates a local advertisement filtering rule according to the updated advertisement filtering rule.
[0144] Each client includes an advertisement filtering rule, and filters a web page advertisement according to the advertisement filtering rule. In this embodiment, as shown in
[0145] S99: Each client in the local area network filters the web page advertisement according to the updated advertisement filtering rule.
[0146] The web page element of the web page includes separately downloaded resources, for example, multimedia and JS. Before downloading the web page element, the client matches the web page element with the updated advertisement filtering rule. If the web page element matches the updated advertisement filtering rule, the client does not download the web page element. If the web page element does not match the updated advertisement filtering rule, the client downloads the web page element. For example, if the client attempts to download a resource corresponding to png.zhongwangmy.cn/jpg/205, and the client determines that the web page element does not match the updated advertisement filtering rule, the client downloads the web page element, to not filter the web page element.
[0147] In this embodiment, as shown in
[0148] In this embodiment, the method further includes:
[0149] If the second query feedback information does not meet the preset rule, the main client determines that the to-be-displayed web page element is an advertisement.
[0150] In this embodiment, the main client, that is, the client 2, for example, as shown in
[0151]
[0152] S1101: Receive a to-be-filtered web page element sent by a client in a local area network in which the main client is located.
[0153] S1102: Send first query broadcast information including the to-be-filtered web page element to the local area network in which the main client is located.
[0154] S1103: Receive first query feedback information generated by all clients in the local area network based on the first query broadcast information.
[0155] S1104: If the first query feedback information meets a preset condition, determine that the to-be-filtered web page element is an advertisement.
[0156] S1105: Update an advertisement filtering rule based on the to-be-filtered web page element that is an advertisement.
[0157] In this embodiment, the method further includes: [0158] delivering an updated advertisement filtering rule to a client in the local area network other than the main client.
[0159] In this embodiment, the method further includes: [0160] filtering a web page advertisement according to the updated advertisement filtering rule.
[0161] In this embodiment, before the receiving a to-be-filtered web page element sent by a client in a local area network in which the main client is located, the method further includes: [0162] determining, in a plurality of clients located in a same local area network, a first client as the main client.
[0163] In this embodiment, the determining, in a plurality of clients located in a same local area network, a first client as the main client includes: [0164] sending recommendation broadcast information including a request for a vote for the first client to the local area network in which the first client is located; [0165] receiving recommendation feedback information generated by a client in the local area network other than the first client based on the recommendation broadcast information; and [0166] determining the first client as the main client if the recommendation feedback information meets a preset condition.
[0167] In this embodiment, after the determining the first client as the main client if the recommendation feedback information meets a preset condition, the method further includes: [0168] sending notification broadcast information including that the first client is the main client to the local area network in which the main client is located.
[0169] In this embodiment, the method further includes: [0170] receiving query broadcast information that is sent by a fifth client in a local area network in which the fifth client is located and that is used to query whether the fifth client is the main client, where the fifth client is a client newly joining the local area network after the advertisement filtering rule is updated; [0171] returning acknowledgment information to the fifth client based on the query broadcast information; [0172] receiving an advertisement filtering rule request sent by the fifth client; and [0173] sending the advertisement filtering rule to the fifth client based on the advertisement filtering rule request.
[0174] In this embodiment, the method further includes: [0175] receiving a to-be-displayed web page element sent by the client in the local area network in which the main client is located; [0176] sending second query broadcast information including the to-be-displayed web page element to the local area network in which the main client is located; [0177] receiving second query feedback information generated by all the clients in the local area network based on the second query broadcast information; [0178] if the second query feedback information meets a preset rule, determining that the to-be-displayed web page element is not an advertisement; and [0179] updating the advertisement filtering rule based on the to-be-displayed web page element that is not an advertisement.
[0180] In this embodiment, the method further includes: [0181] delivering an updated advertisement filtering rule to a client in the local area network other than the main client.
[0182] In this solution, by receiving the to-be-filtered web page element sent by the client in
[0183] the local area network in which the main client is located, a vote is initiated in the local area network, whether the to-be-filtered web page element is an advertisement is determined through voting, and the advertisement filtering rule is generated accordingly. Therefore, an existing client can generate the advertisement filtering rule without intervention and existence of a server. By delivering the advertisement filtering rule to the other clients in the local area network other than the main client, the advertisement filtering rule can be synchronized to all the clients in the local area network without relying on a function of the server for delivering the advertisement filtering rule to the clients. When the fifth client is added to the local area network, even the newly added client can obtain the advertisement filtering rule without re-learning or relying on the server. By receiving the to-be-displayed web page element sent by the client in the local area network in which the main client is located, a vote is initiated in the local area network, whether the to-be-displayed web page element is an advertisement is determined through voting, and the advertisement filtering rule is generated accordingly, so that the web page element can be corrected in a scenario in which the web page element is incorrectly determined as an advertisement. Therefore, the existing client can update the advertisement filtering rule without intervention and existence of the server.
[0184] Finally, it should be noted that the above embodiments are only intended to explain, rather than to limit the technical solutions of the present invention. Although the present invention is described in detail with reference to the preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions may be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.