CN105468746B - Web-page Multi-media content processing method and device - Google Patents

Web-page Multi-media content processing method and device Download PDF

Info

Publication number
CN105468746B
CN105468746B CN201510834093.2A CN201510834093A CN105468746B CN 105468746 B CN105468746 B CN 105468746B CN 201510834093 A CN201510834093 A CN 201510834093A CN 105468746 B CN105468746 B CN 105468746B
Authority
CN
China
Prior art keywords
web page
information
page element
web
multimedia content
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
CN201510834093.2A
Other languages
Chinese (zh)
Other versions
CN105468746A (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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201510834093.2A priority Critical patent/CN105468746B/en
Publication of CN105468746A publication Critical patent/CN105468746A/en
Application granted granted Critical
Publication of CN105468746B publication Critical patent/CN105468746B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation

Abstract

The embodiment of the invention provides a kind of Web-page Multi-media content processing method and devices.Wherein, Web-page Multi-media content processing method includes: acquisition web content data;The information of web page element relevant to multimedia content is extracted from web content data, and records the information of the web page element extracted;Web page contents in loading page other than multimedia content, and show the web page contents of load;By individual thread, it is loaded into webpage from the information for obtaining the web page element being located in browser window in the information of the web page element of record, and by the corresponding multimedia content of the web page element being located in browser window.The Web-page Multi-media content processing method and device of the embodiment of the present invention, it realizes during user browses webpage, multimedia content in browser window is accurately and timely loaded into webpage, it triggers since realization process needs not rely upon to respond particular event, make it have versatility and promotes user experience.

Description

Web-page Multi-media content processing method and device
Technical field
The present invention relates to Internet technical field more particularly to a kind of Web-page Multi-media content processing methods and device.
Background technique
With the continuous development of Internet technology, web page contents also become increasingly abundant.In general, webpage, which removes, includes text Outside word content, also including, for example, multimedia content such as picture, audio, videos.Compared with word content, multimedia content is more raw Dynamic image, it is more attractive to user, can information abundant efficiently be provided for user.
By taking picture as an example, excessive picture will lead to the reduction of customer terminal webpage loading velocity, bandwidth traffic and memory consumption Increase, reduces user experience.Meanwhile also excessive pressure can be caused to server.To solve the above problems, at present frequently with picture The mode of lazyness load, is whole pictures when user browses to current region in ability loading area.
However, this mode can be only triggered by being responded to particular event (such as page scroll event) including figure The load of the multimedia content such as piece, video, audio, with trigger condition, single, the primary rolling container of container non-browser causes The shortcomings such as technology is not general, development cost is high, development efficiency is low.
Summary of the invention
The purpose of the embodiment of the present invention is, provides a kind of Web-page Multi-media content processing method and device, is existed with realizing During user browses webpage, the multimedia content in browser window is accurately and timely loaded into webpage, is made it have Versatility simultaneously promotes user experience.
For achieving the above object, the embodiment provides a kind of Web-page Multi-media content processing method, packets It includes: web page contents obtaining step: obtaining web content data;Multimedia page element extracting step: from the web page contents number According to the information for extracting web page element relevant to multimedia content, and record the information of the web page element extracted;Webpage Content shows step: the web page contents in loading page other than the multimedia content, and shows in the webpage of load Hold;Multimedia content load step: it by individual thread, is obtained from the information of the web page element of record and is located at browsing The information of web page element in device form, and the corresponding multimedia content of the web page element being located in browser window is added It is downloaded in webpage.
Preferably, the processing of the multimedia page element extracting step further include: in the web content data The data of the web page element extracted replace with specified default information.
Preferably, the processing of the multimedia content load step includes: the letter to the web page element of the record The information of any web page element in breath obtains position data of the web page element relative to browser window, if its position It sets and is presently in browser window, then corresponding more matchmakers are obtained from web page server according to the information of the web page element Body content-data, and the corresponding multimedia content of the web page element is loaded into webpage.
Preferably, the information of the web page element includes the download address or download link of the multimedia content.
Preferably, the method also includes: from the information of the web page element of the record remove the net loaded The information of page element and corresponding web page element.
Preferably, the processing of the multimedia content load step is executed at predetermined intervals.
Preferably, the specified default information is specified text information, blank picture or specified picture.
The embodiments of the present invention also provide a kind of Web-page Multi-media content processing apparatus, comprising: web page contents obtain mould Block, for obtaining web content data;Multimedia page element extraction module is used to extract from the web content data and more The information of the relevant web page element of media content, and record the information of the web page element extracted;Web page contents show mould Block for the web page contents in loading page other than the multimedia content, and shows the web page contents of load;More matchmakers Body content load module, for being obtained from the information of the web page element of record and being located at browser by individual thread The information of web page element in form, and the corresponding multimedia content of the web page element in browser window will be located at and loaded Into webpage.
Preferably, the multimedia page element extraction module is also used in the middle extract the web content data The data of the web page element replace with specified default information.
Preferably, the multimedia content loading module was used for appointing in the information of the web page element of the record The information of one web page element obtains position data of the web page element relative to browser window, if its position is currently In in browser window, then corresponding multimedia content number is obtained from web page server according to the information of the web page element According to, and the corresponding multimedia content of the web page element is loaded into webpage.
Preferably, the information of the web page element includes the download address or download link of the multimedia content.
Preferably, described device further include: web page element remove module, for the web page element from the record The information of the web page element loaded and corresponding web page element is removed in information.
Preferably, the multimedia content loading module is described by individual line for executing at predetermined intervals Journey is located at the information of the web page element in browser window from acquisition in the information of the web page element of record, and will be located at The corresponding multimedia content of the web page element in browser window is loaded into the processing in webpage.
Preferably, the specified default information is specified text information, blank picture or specified picture.
Web-page Multi-media content processing method and device provided in an embodiment of the present invention, after obtaining web content data, The information of web page element relevant to multimedia content is further extracted from web content data, and records the webpage member extracted The information of element, it is first from the webpage obtained in the information of the web page element of record in browser window by individual thread The information of element, so that the corresponding multimedia content of the web page element is loaded into webpage automatically, accurately.As it can be seen that this reality It applies a method and needs not rely upon and some or certain events are responded, or specific programming language or framework trigger Load to multimedia content, and then versatility is made it have, and greatly the user experience is improved.Exploitation is improved as a result, Efficiency reduces development cost.
Detailed description of the invention
Fig. 1 is the flow chart for showing the Web-page Multi-media content processing method of the embodiment of the present invention one;
Fig. 2 is the logic diagram for showing the Web-page Multi-media content processing apparatus of the embodiment of the present invention two.
Specific embodiment
Basic conception of the invention is to provide a kind of multimedia content lazyness loading method based on snoop queue: from acquisition The web content data arrived extracts the information of web page element relevant to multimedia content, and records the web page element extracted Information can obtain automatically and accurately the webpage member in browser window based on the information of the web page element of record as a result, The information of element, and the corresponding multimedia content of web page element being located in browser window is loaded into webpage, it loads simultaneously Web page contents in the page other than the multimedia content, and show the web page contents of load, promote user network body It tests.
In addition, compared with existing picture lazyness loading method, Web-page Multi-media contents processing described in the embodiment of the present invention Method versatility, flexibility are stronger, and then reduce development cost, improve development efficiency.
The Web-page Multi-media content processing method and device of the present invention is described in detail embodiment with reference to the accompanying drawing.
Embodiment one
Fig. 1 is the flow chart for showing the Web-page Multi-media content processing method of the embodiment of the present invention one.It can be as shown in Figure 2 Device on execute this method.
Referring to Fig.1, in step S110, web content data is obtained.
Specifically, when the user clicks some web page interlinkage or complete input network address after, by HTTP/HTTPS request come from Web page server obtains corresponding web content data.
In step S120, the information of web page element relevant to multimedia content is extracted from the web content data, and Record the information of the web page element extracted.
It specifically, can be by the way that the information of the web page element extracted be inserted into multimedia content queue to be loaded come complete At the recording process of the information of web page element.
An exemplary embodiment of the present invention, step S120, which may also include that, to be extracted in the web content data To the data of the web page element replace with specified default information.It should be noted that the specified default information can It to be, but is not limited to, specified text information, blank picture or specified picture.Here, the information of the web page element can wrap Include the download address or download link of the multimedia content.
In concrete implementation mode,<img>the src attribute of label is the uniform resource locator (Uniform of picture Resource Locator, URL), that is, quote the absolute path or relative path of the picture.Such as source code " <img Src="/i/eg_chinarose.GIF "/> ", it is a picture about China rose after loaded and displayed.Below with " picture " For be described in detail, extract DOM Document Object Model (Document Object relevant to picture from web content data Model, DOM) object, for example (,) img object, img object is added in picture queue to be loaded, its download link is saved, side Just the processing of subsequent pictures load.And the src attribute of img object is directed toward blank picture or specified picture (such as loading The address of picture) so that browser temporarily prevents to Load Image.
Web page contents in step S130, loading page other than the multimedia content, and show load Web page contents.
At this point, data relevant to the multimedia content in webpage are shown as aforementioned specified default information, without i.e. When load these multimedia content.
In step S140, by individual thread, is obtained from the information of the web page element of record and be located at browser The information of web page element in form, and the corresponding multimedia content of the web page element in browser window will be located at and loaded Into webpage.
An exemplary embodiment of the present invention, step S140 can include: to appointing in the information of the web page element of record The information of one web page element obtains position data of the web page element relative to browser window, if its position is currently In in browser window, then corresponding multimedia content number is obtained from web page server according to the information of the web page element According to, and the corresponding multimedia content of the web page element is loaded into webpage.
It, can be by way of traversing aforementioned multimedia content queue to be loaded in concrete implementation mode, acquisition is located at The information of web page element in browser window, and the net in browser window will be located at according to the information of the web page element of acquisition The corresponding multimedia content of page element is loaded into webpage.In general, obtaining webpage using getBoundingClientRect function In some web page element it is left, upper, right and lower respectively with respect to the position of browser window.Correspondingly, the present embodiment can pass through DOM The getBoundingClientRect function of object obtains position data of the picture relative to browser window, according to acquisition Position data judge whether picture is in browser window.Still by taking " picture " as an example, if picture is located at browser window It is interior, then the download link (i.e. original download address) saved is extracted from picture queue to be loaded, by src attribute from aforementioned blank Picture is substituted for the download link, obtains image content data corresponding with the download link from web page server, and will Image content data are loaded into webpage.
Preferably, the processing of step S140 is executed at predetermined intervals.For example, continuing to execute step after the 200ms of interval Rapid S140.
Due to after web page element load just without again loading, further, the method can also include: from The information of the web page element loaded and corresponding web page element is removed in the information of the web page element of record.
Web-page Multi-media content processing method provided in an embodiment of the present invention, by being mentioned from the web content data got The information of web page element relevant to multimedia content is taken, and records the information of the web page element extracted, is further remembered The information of the web page element of record accurately and timely obtains the information for the web page element being located in browser window, and according to acquisition The information of web page element the corresponding multimedia content of the web page element is loaded into webpage, due to needing not rely upon to certain A or certain events are responded, or specific programming language or framework trigger the load to multimedia content, so that this Inventive embodiments the method has stronger versatility, to reduce development cost, improves development efficiency.Meanwhile it mentioning User network experience is risen.
Embodiment two
Fig. 2 is the logic diagram for showing the Web-page Multi-media content processing apparatus of the embodiment of the present invention two.It can be used for executing The method and step of embodiment as shown in Figure 1.
Referring to Fig. 2, Web-page Multi-media content processing apparatus includes that web page contents obtain module 210, multimedia page element Extraction module 220, web page contents display module 230 and multimedia content loading module 240.
Web page contents obtain module 210 for obtaining web content data.
Multimedia page element extraction module 220 is used to extract from the web content data relevant to multimedia content The information of web page element, and record the information of the web page element extracted.
Further, the multimedia page element extraction module 220 is also used to mention in the web content data The data for the web page element got replace with specified default information.
Web page contents display module 230 is used for the web page contents in loading page other than the multimedia content, and And the web page contents of display load.
Multimedia content loading module 240 is used for through individual thread, from the information of the web page element of record The information for the web page element being located in browser window is obtained, and corresponding by the web page element in browser window is located at Multimedia content is loaded into webpage.
Specifically, the multimedia content loading module 240 can be used in the information to the web page element of record The information of any web page element obtains position data of the web page element relative to browser window, if its position is current It is that corresponding multimedia content is then obtained from web page server according to the information of the web page element in browser window Data, and the corresponding multimedia content of the web page element is loaded into webpage.
Preferably, the multimedia content loading module 240, which can be used for executing at predetermined intervals, described passes through list Only thread, from the information for obtaining the web page element being located in browser window in the information of the web page element of record, and The corresponding multimedia content of the web page element being located in browser window is loaded into the processing in webpage.
Here, the information of the web page element may include the download address or download link of the multimedia content.
Further, the specified default information can be specified text information, blank picture or specified picture.
Optionally, Web-page Multi-media content processing apparatus further include: web page element remove module (not shown) is used for from institute State the information that the web page element loaded and corresponding web page element are removed in the information of the web page element of record.
Web-page Multi-media content processing apparatus provided in an embodiment of the present invention, after obtaining web content data, further The information of web page element relevant to multimedia content is extracted from web content data, and records the letter of the web page element extracted Breath, the information of the web page element in browser window is located at by the acquisition of information of the web page element of record, thus accurately, in time The corresponding multimedia content of web page element being located in browser window is loaded into webpage by ground, greatly improves user network Network experience.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the module, only Only a kind of logical function partition, there may be another division manner in actual implementation.
It, can also be in addition, each functional module in each embodiment of the present invention can integrate in a processing module It is that modules physically exist alone, can also be integrated in two or more modules in a module.Above-mentioned integrated mould Block both can take the form of hardware realization, can also realize in the form of hardware adds software function module.
The above-mentioned integrated module realized in the form of software function module, can store and computer-readable deposit at one In storage media.Above-mentioned software function module is stored in a storage medium, including some instructions are used so that a computer It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the present invention The part steps of embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read- Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. it is various It can store the medium of program code.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (14)

1. a kind of Web-page Multi-media content processing method, which is characterized in that the described method includes:
Web page contents obtaining step: web content data is obtained;
Multimedia page element extracting step: web page element relevant to multimedia content is extracted from the web content data Information, and record the information of the web page element extracted;
Web page contents show step: the web page contents in loading page other than the multimedia content, and show load Web page contents;
Multimedia content load step: it by individual thread, obtains from the information of the web page element of record positioned at clear The information for the web page element look in device form, and the corresponding multimedia content of the web page element in browser window will be located at It is loaded into webpage.
2. the method according to claim 1, wherein the processing of the multimedia page element extracting step is also wrapped It includes: the information of the web page element extracted in the web content data is replaced with into specified default information.
3. according to the method described in claim 2, it is characterized in that, the processing of the multimedia content load step includes:
To the information of any web page element in the information of the web page element of the record, it is opposite to obtain the web page element In the position data of browser window, if its position is presently in browser window, according to the web page element Information obtain corresponding multimedia content data from web page server, and by the corresponding multimedia content of the web page element It is loaded into webpage.
4. according to the method described in claim 3, it is characterized in that, the information of the web page element includes the multimedia content Download address or download link.
5. method according to any one of claims 1 to 4, which is characterized in that the method also includes: from the record The web page element information in remove the information of the web page element loaded and corresponding web page element.
6. according to the method described in claim 5, adding it is characterized in that, executing the multimedia content at predetermined intervals Carry the processing of step.
7. the method according to any one of claim 2~4, which is characterized in that the specified default information is specified Text information, blank picture or specified picture.
8. a kind of Web-page Multi-media content processing apparatus, which is characterized in that described device includes:
Web page contents obtain module, for obtaining web content data;
Multimedia page element extraction module, for extracting webpage member relevant to multimedia content from the web content data The information of element, and record the information of the web page element extracted;
Web page contents display module for the web page contents in loading page other than the multimedia content, and is shown The web page contents of load;
Multimedia content loading module, for obtaining position from the information of the web page element of record by individual thread In the information of the web page element in browser window, and the corresponding multimedia of the web page element in browser window will be located at Content is loaded into webpage.
9. device according to claim 8, which is characterized in that the multimedia page element extraction module is also used to institute The information for stating the web page element extracted in web content data replaces with specified default information.
10. device according to claim 9, which is characterized in that the multimedia content loading module is used for the note The information of any web page element in the information of the web page element of record, obtains the web page element relative to browser window Position data, if its position is presently in browser window, according to the information of the web page element from webpage Server obtains corresponding multimedia content data, and the corresponding multimedia content of the web page element is loaded into webpage In.
11. device according to claim 10, which is characterized in that the information of the web page element includes in the multimedia The download address or download link of appearance.
12. the device according to any one of claim 8~11, which is characterized in that described device further include:
Web page element remove module, for removing the web page element loaded from the information of the web page element of the record And the information of corresponding web page element.
13. device according to claim 12, which is characterized in that the multimedia content loading module is used for scheduled Time interval passes through individual thread described in executing, and obtains from the information of the web page element of record and is located at browser window The information of interior web page element, and the corresponding multimedia content of the web page element being located in browser window is loaded into net Processing in page.
14. the device according to any one of claim 9~11, which is characterized in that the specified default information refers to Fixed text information, blank picture or specified picture.
CN201510834093.2A 2015-11-25 2015-11-25 Web-page Multi-media content processing method and device Active CN105468746B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510834093.2A CN105468746B (en) 2015-11-25 2015-11-25 Web-page Multi-media content processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510834093.2A CN105468746B (en) 2015-11-25 2015-11-25 Web-page Multi-media content processing method and device

Publications (2)

Publication Number Publication Date
CN105468746A CN105468746A (en) 2016-04-06
CN105468746B true CN105468746B (en) 2019-05-03

Family

ID=55606447

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510834093.2A Active CN105468746B (en) 2015-11-25 2015-11-25 Web-page Multi-media content processing method and device

Country Status (1)

Country Link
CN (1) CN105468746B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107301182B (en) * 2016-04-15 2020-06-30 北京京东尚科信息技术有限公司 Method and device for displaying webpage embedded with picture
CN109298905A (en) * 2018-08-15 2019-02-01 深圳点猫科技有限公司 Utilize the method and electronic equipment of the optimization picture lazyness load of front end programming language
CN111125581B (en) * 2019-12-13 2021-03-16 北京金堤科技有限公司 Picture loading method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763357A (en) * 2008-11-13 2010-06-30 北京搜狗科技发展有限公司 Method and system for browser to load internet resources
CN102968509A (en) * 2012-12-17 2013-03-13 腾讯科技(深圳)有限公司 Method and device for multimedia playing in browser

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8150840B2 (en) * 2006-04-19 2012-04-03 Hewlett-Packard Development Company, L.P. Dynamic RSS services

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101763357A (en) * 2008-11-13 2010-06-30 北京搜狗科技发展有限公司 Method and system for browser to load internet resources
CN102968509A (en) * 2012-12-17 2013-03-13 腾讯科技(深圳)有限公司 Method and device for multimedia playing in browser

Also Published As

Publication number Publication date
CN105468746A (en) 2016-04-06

Similar Documents

Publication Publication Date Title
US10515142B2 (en) Method and apparatus for extracting webpage information
US9826052B2 (en) Web page content loading control method and device
US9916285B2 (en) Generating a preview of a web page for a mobile terminal
JP6488508B2 (en) Web page access method, apparatus, device, and program
US9813479B2 (en) Browser with video display history
US20140006934A1 (en) Method for rearranging web page
CN105095280A (en) Caching method and apparatus for browser
US20100083098A1 (en) Streaming Information that Describes a Webpage
CN104820589B (en) A kind of method and its device of dynamic adaptation webpage
CN104035753A (en) Double-WebView customized page display method and system
CN107040584B (en) Method and device for downloading picture by client
CN103139292A (en) Method for processing pictures in hyper text transmission protocol (HTTP) proxy and proxy server and system
WO2013034094A1 (en) Webpage browsing method and device, and storage medium
CN104243273A (en) Method and device for displaying information on instant messaging client and information display system
CN109683978B (en) Stream type layout interface rendering method and device and electronic equipment
US9679075B1 (en) Efficient delivery of animated image files
CN105468746B (en) Web-page Multi-media content processing method and device
CN103856507A (en) Network dynamic picture static display method and device
CN105550179B (en) Webpage collection method and browser plug-in
CN104899212B (en) Web page display method, server and system
CN103761257A (en) Webpage handling method and system based on mobile browser
CN102622381A (en) Method and system for re-typesetting web page
WO2017092455A1 (en) Method for web browsing in mobile terminal, and mobile terminal
Bartuskova et al. Loading speed of modern websites and reliability of online speed test services
CN108108381B (en) Page monitoring method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant