CN110888906A - Method and system for automatically identifying advertisements in webview - Google Patents
Method and system for automatically identifying advertisements in webview Download PDFInfo
- Publication number
- CN110888906A CN110888906A CN201911155227.2A CN201911155227A CN110888906A CN 110888906 A CN110888906 A CN 110888906A CN 201911155227 A CN201911155227 A CN 201911155227A CN 110888906 A CN110888906 A CN 110888906A
- Authority
- CN
- China
- Prior art keywords
- filtering
- webview
- advertisement
- advertisements
- library
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000001914 filtration Methods 0.000 claims abstract description 74
- 238000013461 design Methods 0.000 claims abstract description 4
- 238000013481 data capture Methods 0.000 abstract description 3
- 238000002347 injection Methods 0.000 abstract description 2
- 239000007924 injection Substances 0.000 abstract description 2
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 230000004075 alteration Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000003203 everyday effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000000243 solution Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
- G06F16/24564—Applying rules; Deductive queries
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0241—Advertisements
- G06Q30/0277—Online advertisement
Abstract
The invention discloses a method and a system for automatically identifying advertisements in webview, wherein the method comprises the following steps: the advertisement library filtering rule design step: designing a filtering rule in an advertisement library; matching: after the webview application program is started, matching an advertisement library through cloud big data; and (3) an analysis step: after the filtering rule is taken, analyzing and fusing data of the current page; and (3) filtering: including url filtering and js filtering, through which advertisements are filtered. According to the invention, through big data capture and filtering strategies in multiple aspects such as domain name matching, js injection, html labels and the like, the advertisement part is efficiently identified and removed.
Description
Technical Field
The invention relates to a method and a system for automatically identifying advertisements in webview, which are applied to an android system browser and support more than 4.0 system versions.
Background
With the improvement of living standard of people, the smart phone becomes an essential living article in life of people. With the advent of the carrier of mobile phones, many operating companies have attempted to use it as an important tool for advertising. At present, a large number of advertisements exist on webviews of mobile phones, and people need to spend a large amount of time to read a large number of useless advertisement information every day.
Generally speaking, for advertisements displayed on webview, many people often need to manually close, so that the cost of using mobile phones by people is increased invisibly, and time and energy are wasted. For spam on webview, there is actually no good way for users to mask it, but for businesses at the information technology front, obligations are also made to address this historical problem.
Disclosure of Invention
The invention aims to solve the technical problem that advertisements are difficult to filter in webview, and provides a method and a system for automatically identifying advertisements in webview.
The purpose of the invention is realized by the following technical scheme:
a method of automatically identifying advertisements in a webview, comprising:
the advertisement library filtering rule design step: designing a filtering rule in an advertisement library;
matching: after the webview application program is started, matching with an advertisement list in an advertisement library according to the requested address;
and (3) an analysis step: calling through an interface, fetching a filtering rule list, comparing the currently intercepted address with the list, and judging whether the list comprises the address;
and (3) filtering: including url filtering and js filtering, through which advertisements are filtered.
As a preferable mode, when the url filtering utilizes Webview to load resources, a shouldInterceptRequest function is called back, and the resource requests of the Webview are matched with host data in an interception library by rewriting the shouldInterceptRequest function.
Preferably, js filtering utilizes an onprogress changed method of webchrome, and recognition and filtering of the advertisement are realized by executing js code.
As a preferred mode, the filtering rule is that a current url is obtained through a shouldInterceptRequest interception callback function in webview, compared with a filtering rule list, request data with advertisements is directly returned, and otherwise, no processing is performed; the js filtering step will execute loadUrl (js) in onProgressChanged.
Preferably, the onprogress changed method comprises the following steps: the js code is executed once each time the loading schedule changes, ensuring that the ad will be identified and filtered at the first time.
A system for automatically identifying advertisements in a webview, comprising:
the advertisement library module: storing advertisement filtering rules and providing the advertisement filtering rules to an interface called by a webview program;
a matching module: the method is used for the webview application program to match the advertisement library through the cloud big data;
an analysis module: after the filtering rule is taken, analyzing and fusing data of the current page;
a filtering module: the advertisements are filtered by url filtering and js filtering.
As a preferred mode, the webview application program is started and then matched with the advertisement library through the cloud big data.
The invention has the beneficial effects that: according to the invention, through big data capture and filtering strategies in multiple aspects such as domain name matching, js injection, html labels and the like, the advertisement part is efficiently identified and removed.
Detailed Description
The technical solutions of the present invention are described in further detail below, but the scope of the present invention is not limited to the following.
The invention aims to solve the technical problems that the advertisement removing mode fixed by the existing advertisement filtering is single in function, poor in user experience, insufficient in recognition degree and depth, filtering rules depend on local configuration of a mobile phone, so that the advertisement depth is generally recognized insufficiently, filtering fails and the like. Aiming at the problems in the prior art, the invention provides a method and a system for automatically identifying advertisements in webview.
Example one
A method of automatically identifying advertisements in a webview, comprising:
the advertisement library filtering rule design step: designing a filtering rule in an advertisement library; the advertisement library utilizes a third party advertisement resource url collection: adblock Plus, easy List China + easy List, and then merge url lists into the library, and add new advertisement resources.
Matching: after the webview application program is started, calling and taking an advertisement filter library list through an interface, matching the address of a request with an advertisement list in a shouldInterceptRequest interception callback function in the current webview, if the address of the request is matched with the advertisement list, determining that the current loading is an advertisement address, and if the address of the request is not matched with the advertisement list, determining that the current loading is a normal page;
and (3) an analysis step: calling through an interface, fetching a filtering rule list, comparing a current address with the list, and judging whether the list contains the address;
and (3) filtering: including url filtering and js filtering, through which advertisements are filtered.
The invention provides a method for automatically identifying advertisements in webview, which effectively identifies and filters the advertisements by matching an advertisement library and url filtering and js filtering and improves the accuracy of advertisement filtering.
Example two
And calling back a shouldInterceptRequest function when the url filtering utilizes Webview to load resources, and realizing matching of the resource request of Webview and host data in an interception library by rewriting the shouldInterceptRequest function.
js filtering utilizes an onprogress changed method of WebChromeClient to realize the identification and filtering of advertisements by executing js codes.
onprogress changed method: the js code is executed once each time the loading schedule changes, ensuring that the ad will be identified and filtered at the first time.
The filtering rule is that a shouldInterceptRequest interception callback function in webview is used for obtaining the comparison between the current url and a filtering rule list, the request data with advertisements directly returns empty data, otherwise, the data is data which is not processed, a js filtering step executes loadUrl (js) in onProgressChanged, and the loaded js code part is generated as follows:
the principle is to inject a js segment to delete the part of the displayed advertisement, and execute the js code to complete the filtering again through loadUrl (js) whenever the loading progress is changed.
EXAMPLE III
After the matching removes the advertisement, uploading the newly set rules to an advertisement matching library is carried out.
When the advertisement is failed to be removed, the advertisement part is clicked, the advertisement part is uploaded to an advertisement library, and the advertisement part of the current page is not presented any more.
The advertisement library carries out real-time big data capture, and the filtering rule of the advertisement library is continuously enriched.
The method is based on big data crawler capture, filtering rules such as domain name addresses, js codes and html tags required by interception are dynamically acquired, and rule matching is carried out on loaded pages.
Example four
Corresponding to the embodiment of the method, the invention provides a system for automatically identifying advertisements in webview, which comprises the following steps:
the advertisement library module: storing advertisement filtering rules and providing the advertisement filtering rules to an interface called by a webview program;
a matching module: the method is used for the webview application program to match the advertisement library through the cloud big data;
an analysis module: after the filtering rule is taken, analyzing and fusing data of the current page;
a filtering module: the advertisements are filtered by url filtering and js filtering.
The method provided by the first embodiment is realized through the above modules.
After the webview application program is started, the advertisement library is matched through the cloud big data.
The filtering rule is that a callback function is intercepted through a shouldInterceptRequest in the webview, the current url is obtained to be compared with a filtering rule list, the request data with the advertisement is directly returned to the empty data, and otherwise, the empty data is not processed; the js filtering step will perform loadUrl (js) in onProgressChanged (see above for specific implementation).
onprogress changed method: the js code is executed once each time the loading schedule changes, ensuring that the ad will be identified and filtered at the first time.
The invention has high-efficiency advertisement recognition capability, can continuously enrich the advertisement matching database, and can more thoroughly and more intelligently analyze and process advertisement parts by actively uploading the advertisement part by a user.
Since the system described in this embodiment is a system for implementing a method for automatically identifying an advertisement in a webview in the embodiment of the present invention, a specific implementation manner and various variations of the system described in this embodiment can be understood by those skilled in the art, and therefore, how to implement the method in the embodiment of the present invention in the system is not described in detail herein. The protection scope of the present invention is only the system adopted by those skilled in the art to implement the method in the embodiment of the present invention.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention. The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, it should be noted that any modifications, equivalents and improvements made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (7)
1. A method for automatically identifying advertisements in webview, comprising:
the advertisement library filtering rule design step: designing a filtering rule in an advertisement library;
matching: after the webview application program is started, matching with an advertisement list in an advertisement library according to the requested address;
and (3) an analysis step: calling through an interface, fetching a filtering rule list, comparing the currently intercepted address with the list, and judging whether the list comprises the address;
and (3) filtering: including url filtering and js filtering, through which advertisements are filtered.
2. The method of claim 1, wherein the method comprises: and calling back a shouldInterceptRequest function when the url filtering utilizes Webview to load resources, and realizing matching of the resource request of Webview and host data in an interception library by rewriting the shouldInterceptRequest function.
3. The method of claim 1, wherein the method comprises: js filtering utilizes an onprogress changed method of WebChromeClient to realize the identification and filtering of advertisements by executing js codes.
4. The method of claim 1, wherein the method comprises: the filtering rule is that a callback function is intercepted through a shouldInterceptRequest in the webview, the current url is obtained to be compared with a filtering rule list, the request data with the advertisement is directly returned to the empty data, and otherwise, the empty data is not processed; the js filtering step will execute loadUrl (js) in onProgressChanged.
5. The method of claim 4, wherein the method comprises: onprogress changed method: the js code is executed once each time the loading schedule changes, ensuring that the ad will be identified and filtered at the first time.
6. A system for automatically identifying advertisements in a webview, comprising:
the advertisement library module: storing advertisement filtering rules and providing the advertisement filtering rules to an interface called by a webview program;
a matching module: the method is used for the webview application program to match the advertisement library through the cloud big data;
an analysis module: after the filtering rule is taken, analyzing and fusing data of the current page;
a filtering module: the advertisements are filtered by url filtering and js filtering.
7. The system of claim 6, wherein the system is configured to automatically identify advertisements in a webview: after the webview application program is started, the advertisement library is matched through the cloud big data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911155227.2A CN110888906A (en) | 2019-11-22 | 2019-11-22 | Method and system for automatically identifying advertisements in webview |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911155227.2A CN110888906A (en) | 2019-11-22 | 2019-11-22 | Method and system for automatically identifying advertisements in webview |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110888906A true CN110888906A (en) | 2020-03-17 |
Family
ID=69748416
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911155227.2A Pending CN110888906A (en) | 2019-11-22 | 2019-11-22 | Method and system for automatically identifying advertisements in webview |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110888906A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101931685A (en) * | 2009-06-22 | 2010-12-29 | 北京邮电大学 | Method and system for filtering junk short messages |
CN103530560A (en) * | 2013-09-29 | 2014-01-22 | 北京金山网络科技有限公司 | Method, device and client side for advertisement blocking |
WO2014026606A1 (en) * | 2012-08-15 | 2014-02-20 | Tencent Technology (Shenzhen) Company Limited | Method, system and device for filtering mobile terminal webpage advertisements |
CN104021172A (en) * | 2014-05-30 | 2014-09-03 | 北京搜狗科技发展有限公司 | Advertisement filtering method and advertisement filtering device |
CN106095869A (en) * | 2016-06-03 | 2016-11-09 | 腾讯科技(深圳)有限公司 | Advertisement information processing method, subscriber equipment, background server and system |
CN106227847A (en) * | 2016-07-27 | 2016-12-14 | 宁波圆形网络科技有限公司 | One goes ad system and method |
CN108520179A (en) * | 2018-04-09 | 2018-09-11 | 福建中金在线信息科技有限公司 | A kind for the treatment of method and apparatus of webview loopholes |
-
2019
- 2019-11-22 CN CN201911155227.2A patent/CN110888906A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101931685A (en) * | 2009-06-22 | 2010-12-29 | 北京邮电大学 | Method and system for filtering junk short messages |
WO2014026606A1 (en) * | 2012-08-15 | 2014-02-20 | Tencent Technology (Shenzhen) Company Limited | Method, system and device for filtering mobile terminal webpage advertisements |
CN103530560A (en) * | 2013-09-29 | 2014-01-22 | 北京金山网络科技有限公司 | Method, device and client side for advertisement blocking |
CN104021172A (en) * | 2014-05-30 | 2014-09-03 | 北京搜狗科技发展有限公司 | Advertisement filtering method and advertisement filtering device |
CN106095869A (en) * | 2016-06-03 | 2016-11-09 | 腾讯科技(深圳)有限公司 | Advertisement information processing method, subscriber equipment, background server and system |
WO2017206782A1 (en) * | 2016-06-03 | 2017-12-07 | 腾讯科技(深圳)有限公司 | Information processing method, terminal, background server and system, and storage medium |
CN106227847A (en) * | 2016-07-27 | 2016-12-14 | 宁波圆形网络科技有限公司 | One goes ad system and method |
CN108520179A (en) * | 2018-04-09 | 2018-09-11 | 福建中金在线信息科技有限公司 | A kind for the treatment of method and apparatus of webview loopholes |
Non-Patent Citations (1)
Title |
---|
ALLYN的背包: "android WebView实践总结(四) WebView网页广告拦截(AdBlock)", 《HTTPS://WWW.JIANSHU.COM/P/0664D3398076?UTM_CAMPAIGN=MALESKINE&UTM_CONTENT=NOTE&UTM_MEDIUM=SEO_NOTES&UTM_SOURCE=RECOMMENDATION》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109614433B (en) | Method, device, equipment and storage medium for identifying data blooding margin between business systems | |
CN101102565B (en) | A processing method, device and equipment of user data in communication terminal | |
CN105138312B (en) | A kind of table generation method and device | |
CN104657058A (en) | Screenshot method | |
CN103309998A (en) | Message query method, message query device and terminal equipment | |
CN104243273A (en) | Method and device for displaying information on instant messaging client and information display system | |
CN106649488B (en) | Method and device for calling multi-data-source interactive interface | |
CN110765293A (en) | Method and system for automatically opening two-dimensional code, electronic device and storage medium | |
CN104679405A (en) | Terminal | |
CN114817968B (en) | Method, device and equipment for tracing path of featureless data and storage medium | |
CN111597388A (en) | Sample collection method, device, equipment and medium based on distributed system | |
CN111651296A (en) | Interception backup method, device, equipment and storage medium for data deletion operation | |
CN110795180A (en) | Two-dimensional code management method and system, electronic device and storage medium | |
CN111324786A (en) | Method and device for processing consultation problem information | |
CN111047147B (en) | Automatic business process acquisition method and intelligent terminal | |
CN102508884A (en) | Method and device for acquiring hotpot events and real-time comments | |
CN103546551B (en) | Application software smart download methods, devices and systems | |
CN110688581A (en) | Information real-time pushing method and device, computing equipment and medium | |
EP3564833B1 (en) | Method and device for identifying main picture in web page | |
CN105120046A (en) | Method and device for creating address book according to note information of new number | |
CN110888906A (en) | Method and system for automatically identifying advertisements in webview | |
CN103207890A (en) | Method and device for acquiring contact person information | |
CN105488054B (en) | A kind of method and device of browsing pictures | |
CN113779026A (en) | Method and device for processing service data table | |
CN113962316A (en) | Model training method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200317 |