WO2015003664A1 - 一种下载处理方法、装置、服务器及客户端设备 - Google Patents

一种下载处理方法、装置、服务器及客户端设备 Download PDF

Info

Publication number
WO2015003664A1
WO2015003664A1 PCT/CN2014/082178 CN2014082178W WO2015003664A1 WO 2015003664 A1 WO2015003664 A1 WO 2015003664A1 CN 2014082178 W CN2014082178 W CN 2014082178W WO 2015003664 A1 WO2015003664 A1 WO 2015003664A1
Authority
WO
WIPO (PCT)
Prior art keywords
download
page
address
preferred
download address
Prior art date
Application number
PCT/CN2014/082178
Other languages
English (en)
French (fr)
Inventor
张凯宏
万振
傅盛
Original Assignee
贝壳网际(北京)安全技术有限公司
北京金山网络科技有限公司
北京金山安全软件有限公司
珠海市君天电子科技有限公司
可牛网络技术(北京)有限公司
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 贝壳网际(北京)安全技术有限公司, 北京金山网络科技有限公司, 北京金山安全软件有限公司, 珠海市君天电子科技有限公司, 可牛网络技术(北京)有限公司 filed Critical 贝壳网际(北京)安全技术有限公司
Publication of WO2015003664A1 publication Critical patent/WO2015003664A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • 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/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]

Definitions

  • the present invention belongs to the field of Internet technologies, and in particular, to a download processing method, apparatus, server, and client device. Background technique
  • the download page under the download website corresponds to a download object.
  • a download web page is used to download the office software, and the download web page will have a download link of the office software.
  • many download sites are currently used for a variety of purposes, often setting up complex content on the download page, including many interference links.
  • Existing download sites typically display download links in two ways:
  • download sites display promotional links in a conspicuous manner in order to promote interesting software, games or advertisements, misleading users to download, and the real download link, that is, the download link of the real download object is hidden Inconspicuous places, and in general there are more than one real download link. For the user, it is cumbersome to find the download link of the real download object from many interference links.
  • the present invention provides a download processing. Methods, devices, servers, and client devices.
  • An embodiment of the present invention provides a download processing method, including:
  • the acquired preferred download address of the download object so that the client device presents the preferred download address to a user, and the user can download the download through the preferred download address
  • the object does not need to open the download page.
  • An embodiment of the present invention provides a second download processing method, including:
  • the received preferred download address is presented to the user to enable the user to download the download object via the preferred download address without opening the download page.
  • the embodiment of the present invention provides a third download processing method, including:
  • An embodiment of the present invention further provides an apparatus for downloading processing, including:
  • the first operation indication receiving module is configured to receive a first operation indication of the download page sent by the client device, where the download page corresponds to one download object;
  • a page source code and a download address rule obtaining module configured to obtain, according to the first operation instruction, a page source code of the download page and a download address rule corresponding to the download page;
  • the download address obtaining module is configured to obtain a preferred download address of the download object according to the obtained page source code and the download address rule corresponding to the download page;
  • a first preferred download address returning module configured to return the obtained preferred download address of the downloaded object to the client device, so that the client device displays the preferred download address to a user, where the user can The download object is downloaded through the preferred download address without opening the download page.
  • An embodiment of the present invention further provides a second download processing apparatus, including: a first operation instruction receiving module, configured to receive a first operation instruction of the user to download the page, where the download page corresponds to one download object;
  • the first operation indication sending module is configured to send, according to the first operation instruction, a first operation indication of the download page to the server, so that the server acquires a preferred download address of the download object;
  • the download address returning module is configured to receive a preferred download address corresponding to the download object returned by the server; and a second preferred download address display module, configured to display the received preferred download address to the user, so that the user can pass The preferred download address downloads the download object without opening the download page.
  • the present invention also provides a server comprising the first type of download processing means.
  • the present invention also provides a server comprising the second type of download processing device.
  • the present invention also provides a readable storage medium for storing a computer program for performing the above-described download processing method at runtime.
  • the beneficial effects of the above technical solution of the present invention are as follows:
  • the present invention is directed to a download page corresponding to a download object, according to the page source code of the downloaded download page and the download address rule corresponding to the download page, to obtain a preferred download of the download object. Addressing, and displaying the preferred download address to the user, so that the user can directly obtain the preferred download address, avoiding the operation that the user needs to enter the download page and find the preferred download address from the download page, thereby shortening the time for the user to obtain the preferred download address. Improve the user's download efficiency, thus giving users a better browsing experience.
  • FIG. 1 is a flowchart of a download processing method according to a first embodiment of the present invention
  • FIG. 2 is a flowchart of a download processing method according to a second embodiment of the present invention.
  • FIG. 3 is a structural block diagram of a download processing apparatus according to a first embodiment of the present invention.
  • FIG. 4 is a structural block diagram of a download processing apparatus according to a second embodiment of the present invention.
  • FIG. 5 is a schematic diagram of an interface provided by a client device according to an embodiment of the present invention. detailed description
  • the method of the embodiment of the present invention is applicable to a large and medium-sized computer, a personal computer PC, and of course, to other smart devices such as mobile devices, for example, an IOS operating system (IOS is a handheld device operating system developed by Apple Inc.) Mobile device, Android operating system (Android system is a Linux-based free and open source code)
  • IOS is a handheld device operating system developed by Apple Inc.
  • Android is a Linux-based free and open source code
  • the mobile device of the operating system the mobile device of the Windows Phone operating system (Windows Phone is a handheld device operating system developed by Microsoft), which is not limited by the present invention.
  • a flowchart of a download processing method according to an embodiment of the present invention is used on a server side opposite to a mobile terminal or a personal computer PC, and is executed by a server, specifically, a server device installed on a server.
  • the function module performs, specifically including the following steps:
  • Step S101 Receive a first operation indication of a download page sent by the client device, where the download page corresponds to one download object;
  • Step S102 Acquire, according to the first operation instruction, a page source code of the download page and a download address rule corresponding to the download page;
  • Step S103 Obtain a preferred download address of the download object according to the acquired page source code and a download address rule corresponding to the download page.
  • Step S104 Return, to the client device, the acquired preferred download address of the download object, so that the client device displays the preferred download address to a user, and the user can pass the preferred download address.
  • the download object is downloaded without opening the download page.
  • page in the embodiment of the present invention mainly refers to a webpage, and may also be other pages that can be browsed by the user, which is not limited by the present invention.
  • the download address may be the real download address of the download object, or the download address of the download target may be a good quality or a relatively safe download address, such as an official download address, which is not limited by the present invention. It can be arbitrarily set by those skilled in the art.
  • the download object may be software, an audio file, a video file, and any other object that can be downloaded.
  • the office software is the corresponding download object of the page.
  • this download page not only provides the download link of the office software (ie, the download address), but also has many popular links for other software, games or advertisements.
  • the download link of the office software provided on the download page may have multiple, and the user may not easily select the preferred download link to the office software.
  • the embodiment of the present invention provides such a download processing method.
  • the preferred download address of the download object such as the official download address
  • the downloading address "corresponding source code is regularly ruled in the page source code.
  • the code representation manner commonly used for the preferred download address in the website webpage is called the download address rule, that is, Most websites generally have their corresponding download address rules, that is, the pages of these websites follow the corresponding download address of the website. Rules.
  • a certain number of download address rules of the website are collected and set in advance, and a database or a data list of download address rules is established, and for a certain download page of a specific website, the The website corresponding to the webpage is further searched from the pre-set download address rule database or the data list, and the download address rule corresponding to the download webpage is found, and the preferred download address of the download object is found from the page source code of the webpage.
  • the user can display the preferred download address, so that the user can directly obtain the preferred download address, and the user can directly download the download object through the download address, thereby avoiding the user needing to enter the download page and searching for the best among the download addresses in the download page.
  • the operation of downloading the address shortens the time for the user to obtain the preferred download address, improves the download efficiency of the user, and brings a better browsing experience to the user.
  • the server performs an operation of acquiring a download address when receiving the first operation instruction of the client.
  • the first operation indication may trigger the client device to send to the server when the user performs some operation on the download page, and notify the server user to perform some operation on the download page, which is sent by the embodiment of the present invention to the first operation indication.
  • the timing and the first operation are specifically limited.
  • the first operation indication may be sent according to an instruction that is received by the client device to store a download page address, such as an instruction that the user collects a page address having a download object, or may be based on a user search received by the client device to download the page. The instruction is issued.
  • the user performs a search, and the label of the download page is displayed in the search result page.
  • the client device sends a first operation instruction to the server, instructing the server user to select the download page.
  • the client device sends a first operation instruction to the server, informing the server client device that the user downloads the download page.
  • the server obtains the page source code of the download page and its corresponding download address rule according to the first operation instruction, and further obtains the download address of the download object from the page source.
  • step S101 a first operation indication of the download page sent by the client device is received, where the first operation indication carries the address information of the download page.
  • step S102 acquiring the page source of the download page specifically includes:
  • the page address of each download page refers to the unified Resource locator URL address.
  • the first operation indication carries the address information of the download page.
  • the source information acquisition request is sent to the site server corresponding to the download page, and the response information of the webpage source including the download page is obtained.
  • a web page is a basic element of a website. It is a platform for carrying various web applications. It is generally edited by various languages, such as ASP, JSP, ASP.NET, PHP, CGI, etc.
  • the source code will embed the download address.
  • the PHP curl library can be used to simulate a user request, and the site server corresponding to the download page is requested to obtain the html source code of the video page.
  • step S102 the obtaining, according to the first operation instruction, the download address rule corresponding to the download page, specifically includes:
  • the address information of the download page is carried in the first operation indication, and the download address rule corresponding to the address information can be obtained according to the address information of the download page.
  • the page address of each downloaded page refers to a uniform resource locator URL address.
  • the URL address can be used to analyze which website page the download page is, and then the download address rule corresponding to the website, that is, the download address rule corresponding to the download page, is found.
  • the download address rule may correspond to the domain name of the download page.
  • the specific process of querying the preset download address rule to obtain the download address rule corresponding to the address information according to the address information carried in the first operation indication may be:
  • Each download page has a corresponding domain name.
  • the domain name is the address of the unit that is connected to the network through the computer, and is the character address corresponding to the digital IP address on the network. According to the domain name of the download page, you can query the pre-set download address rule to obtain the download address rule corresponding to the domain name.
  • step S103 obtaining a preferred download address of the download object is obtained according to a page source code and a download address rule corresponding to the download page.
  • the download address corresponding to the download page of the present invention conforms to a certain rule in the page source code, that is, the download address rule is satisfied. Therefore, the embodiment of the present invention pre-sets the download address rule.
  • the download address rule corresponding to the download page of this embodiment may be represented by a regular expression. Since regular expressions are used to describe or match a series of strings that conform to a syntax rule, the source code of a web page is also a string with syntax rules. To this end, the preferred download address of the downloaded object can be obtained by matching the regular expression with the page source.
  • Pre-configure a whitelist containing various download sites such as Huajun download, sky download, etc.
  • the source code portion of the official download address is:
  • the regular expression can also be other representations.
  • the source code representation of the preferred download address of each website may be different.
  • the corresponding regular expression is obtained according to the source code of the obtained whitelist website.
  • the method for obtaining the preferred download address of the download object according to the obtained page source code and the download address rule corresponding to the download page includes:
  • the download address rule corresponding to the download page of the present invention may include two or more regular expressions, such as a regular expression corresponding to an official download address, a regular expression corresponding to a mainstream download tool address, and a website recommendation.
  • the regular expression corresponding to the download address may include two or more regular expressions, such as a regular expression corresponding to an official download address, a regular expression corresponding to a mainstream download tool address, and a website recommendation.
  • the regular expression corresponding to the download address may include two or more regular expressions, such as a regular expression corresponding to an official download address, a regular expression corresponding to a mainstream download tool address, and a website recommendation.
  • the present invention obtains a preferred download address of the download object according to the obtained page source code and the download address rule corresponding to the download page, including:
  • the download address rule includes a regular expression corresponding to an official download address, a mainstream download tool address, a website recommended download address, and the like, and the matching order of the regular expression is: The regular expression corresponding to the download address, the regular expression corresponding to the address of the mainstream download tool, and the regular expression corresponding to the recommended download address of the website.
  • the regular expression corresponding to the official download address will be matched first.
  • the regular expression corresponding to the address of the mainstream download tool is matched, and if the download address is not matched, Then match the regular expression corresponding to the recommended download address of the website until the download address is found. In turn, the found download address can be returned to the client device for display to the user.
  • the obtained page source code and the at least two regular expressions may also be respectively obtained from the Finding a source code matching each of the at least two regular expressions in the page source to obtain a corresponding one of each of the at least two regular expressions, The preferred download address of the download object, and then the download addresses are presented to the user for user selection to enhance the user experience.
  • a regular expression can be configured for each website having a download site, and a database or a list of correspondence between the website and the regular expression can be established.
  • each website may correspond to a regular expression, or may correspond to multiple regular expressions.
  • a regular expression may also correspond to multiple websites.
  • the regular expression of this embodiment may correspond to the domain name according to the download site. Since the preferred download address of each website has multiple addresses, there are a plurality of regular expressions, for example, including a regular expression corresponding to the official download address, the mainstream download tool address, and the website recommended download address. At this time, the regular expression needs to be prioritized, and the source code of the webpage corresponding to the object to be downloaded is matched in turn.
  • the order in which the preferred download address is recommended is generally the official download address, the download address of the mainstream download tool (such as QQ whirlwind, etc.), and the website recommended download address (Unicom, Telecom, Tietong main station, etc.). That is, firstly, according to the regular expression that obtains the official download address, the official download address is matched. When the official download address is matched, the official download address is used as the preferred download address; if the official download address is not matched, the download address is obtained according to the download of the mainstream download tool. The regular expression matches the download address of the mainstream download tool.
  • the download address of the mainstream download tool is used as the preferred download address; if the official download address and the download address of the mainstream download tool do not exist, according to the user's IP address, select one of the main download addresses (usually the first download address) in Telecom, China Unicom or China Railcom as the preferred download address.
  • the download resource of the official download address is better than other download addresses. Therefore, the recommended download address is recommended in the order of the official download address to the download address of the mainstream download tool to the recommended download address of the website, which is more in line with the actual situation. It can also improve user download efficiency.
  • the order of the above regular expression is not limited to the above embodiment, and may be set according to actual conditions.
  • the order may be a regular expression corresponding to a website recommended download address, a regular expression corresponding to an official download address, and a mainstream. Download the regular expression corresponding to the tool address.
  • the preferred download address can be directly returned to the client device, so that the client device can display the preferred download address to the user.
  • the client device can pop up a corresponding information of the download page.
  • the window is slightly displayed, and the preferred download address is displayed in the window.
  • the client device can directly display the preferred download address at a certain position of the current user interface.
  • the user of the client device does not need to open the download page, and can download the download object directly through the displayed preferred download address.
  • the preferred download address may be first stored, and when the client device requests the preferred download address, the preferred download address is returned to the client device, that is, in step S104, Before returning the obtained preferred download address of the download object to the client device, the method further includes: receiving a download address acquisition request sent by the client device;
  • Returning the obtained preferred download address of the downloaded object to the client device includes: returning a response message to the client device according to the download address obtaining request, where the response message includes the downloading The preferred download address for the object.
  • the server may first store the download address on the server or other location outside the server.
  • the server may return the preferred download address of the download object to the client. device.
  • the client device can send a preferred download address of the download object when the user performs some operation on the download page, for example, when the user selects the title corresponding to the download page.
  • the title or URL of the download page is displayed in an interface.
  • the client device sends a download address acquisition request to the server.
  • the server returns a preferred download address including the download object to the client device, so that the client device displays the preferred download address to the user.
  • the client device may pop up the corresponding download page.
  • the received preferred download address is displayed in the thumbnail information window, and may also be in the form of a WEB folder.
  • the display area is displayed in the preview area of the WEB folder.
  • the preferred download address received.
  • the manner in which the download address is preferably displayed is not limited to the above two methods.
  • the present invention further provides a second download processing method, which can be used on a mobile terminal or a personal computer PC side, and is executed by a mobile terminal or a PC, specifically, by a mobile terminal or a client device or a function module installed on a PC.
  • a second download processing method which can be used on a mobile terminal or a personal computer PC side, and is executed by a mobile terminal or a PC, specifically, by a mobile terminal or a client device or a function module installed on a PC.
  • a second download processing method which can be used on a mobile terminal or a personal computer PC side, and is executed by a mobile terminal or a PC, specifically, by a mobile terminal or a client device or a function module installed on a PC.
  • Step S201 Receive a first operation instruction of the user to download the page, where the download page corresponds to one download object;
  • Step S202 Send, according to the first operation instruction, a first operation instruction of the download page to the server, so that Determining, by the server, a preferred download address of the download object;
  • Step S203 Receive a preferred download address corresponding to the download object returned by the server;
  • Step S204 Present the received preferred download address to the user, so that the user can download the download object through the preferred download address without opening the download page.
  • the first operation instruction is performed by the user for the download page
  • the first operation instruction may be an operation instruction that the user performs some operation on the download page, and may be the user storage download page address received by the client device. Instructing, for example, that the user collects an indication of the page address of the download object, for example, the user selects a label of the download page displayed on the screen or a selected operation instruction of the title link, and when the user collects the first video page, the page of the first video page is stored. The favorite instruction at the address.
  • the first operation indication is sent by the client device to the server according to the first operation instruction received by the client device, and the first operation indication may carry the page address of the download page operated by the user.
  • the address is a URL address
  • the server can analyze the webpage of the website by using the URL address, and then find the download address rule with the website from the page source, that is, the download corresponding to the download page. Address rules.
  • the displaying, by the user, the received preferred download address to the user includes:
  • the thumbnail information window corresponding to the download page is popped up, and the received preferred download address is displayed in the thumbnail information window.
  • the method further includes:
  • the first interface includes a page address area and a preview area, where the page address area displays a page list, the page list includes identification information of the download page, and the identifier information includes the downloading The title of the page and/or the address of the downloaded page;
  • the preferred download address corresponding to the download object returned by the receiving server includes:
  • the second operation instruction may be an instruction for the user to select the download page.
  • the instruction is to select the first video page by the user by clicking a horizontal blank area after the title of the download page in the page address area.
  • the client device requests the server to obtain the preferred download address, and the server returns the obtained preferred download address to the client device through the response message.
  • the present invention for presenting the received preferred download address to the user includes:
  • the received preferred download address is displayed in the preview area.
  • the method further includes: detecting a click operation of the user on the preferred download address of the display;
  • the download object is downloaded according to the preferred download address.
  • the web favorite client When the web favorite client receives the message of the user's favorite download page (equivalent to the first operation instruction), sends a request (equivalent to the first operation instruction) to the web favorites server, where the request includes the downloaded page of the user's favorite The page address (the address URL of the download page), the web favorite server simulates the user request using the PHP curl library according to the page address of the user's favorite page, and requests the download site server to obtain the html source code of the download page. That is, when the user collects a download page, the web favorites server obtains the html source code of the user's favorite download page from the corresponding download site.
  • FIG. 5 is an exemplary schematic diagram of the main interface of the web favorites, including three content columns, the folder bar on the far left, the page address bar in the middle, and the preview bar on the far right.
  • the page address bar displays the list of page addresses included in the folder selected by the user in the folder bar.
  • the address in the page address list is usually displayed in the form of an address name, that is, when the user selects a folder in the folder bar.
  • the address contained in the folder is displayed in the address bar as a list; the preview bar displays the preview information of the web page corresponding to the address selected by the user in the page address bar.
  • the download page corresponding to the URL can be opened.
  • the web favorites client sends a download address acquisition request to the server, and the server returns the preferred download address to the web collection.
  • the web favorites client displays a preferred download address of the download page in the preview bar on the right side.
  • the present invention further provides a third download processing method, which specifically includes the following steps:
  • Step 1 According to the page address of the download page, obtain the page source code of the download page and the download address rule corresponding to the download page, where the download page corresponds to a download object;
  • Step 2 Acquire a preferred download address of the downloaded object according to the obtained page source code and the download address rule corresponding to the download page.
  • the foregoing method provided by the embodiment of the present invention may be used on a mobile terminal or a PC side of a personal computer, and is executed by a mobile terminal or a PC, and specifically executed by a mobile terminal or a client device or a function module installed on a PC. It can be used on the server side opposite to the mobile terminal or personal computer PC, and is executed by the server, specifically by the server device or function module installed by the server.
  • the download address rule corresponding to the download page is represented by a regular expression
  • the preferred download address of the download object including:
  • a block diagram of a download processing apparatus includes: a first operation indication receiving module 101, configured to receive a first operation indication of a download page sent by a client device, where The download page corresponds to a download object;
  • the page source and download address rule obtaining module 201 is configured to obtain, according to the first operation instruction, a page source code of the download page and a download address rule corresponding to the download page;
  • the preferred download address acquisition module 301 is configured to obtain a preferred download address of the download object according to the obtained page source code and the download address rule corresponding to the download page.
  • a first preferred download address returning module 401 configured to return the obtained preferred download address of the downloaded object to the client device, so that the client device displays the preferred download address to a user, the user
  • the download object can be downloaded through the preferred download address without opening the download page.
  • the present invention is directed to a download page corresponding to the download object, according to the page source code of the downloaded download page and the download address rule corresponding to the download page, to obtain a preferred download address of the download object, and present the preferred download address to the user.
  • the user can directly obtain the preferred download address, avoiding the user's need to enter the download page and find the preferred download address from the download page, shortening the time for the user to obtain the preferred download address, and improving the download efficiency of the user, thereby bringing the user Come to a better browsing experience.
  • the first operation indication carries the address information of the download page
  • the address rule obtaining module 201 is specifically configured to: query a preset download address rule according to the address information carried in the first operation indication, to obtain a download address rule corresponding to the address information.
  • the page source code and download address rule obtaining module 201 is specifically configured to: determine, according to the address information carried in the first operation indication, a domain name of the download page, and a download page according to the determined For the domain name, query the pre-set download address rule to obtain the download address rule corresponding to the domain name.
  • the page source code and download address rule obtaining module 201 is specifically configured to: send, according to the address information carried in the first operation indication, a source code acquisition request to a site server corresponding to the download page; and The response information sent by the site server, where the response information includes a webpage source code of the download page.
  • the download address rule corresponding to the download page is represented by a regular expression
  • the preferred download address obtaining module 301 is specifically configured to: according to the regular expression indicating the download address rule, from the obtained page source code A source code matching the regular expression is found to obtain a preferred download address of the download object.
  • the download address rule corresponding to the download page is set to include at least two regular expressions
  • the preferred download address obtaining module 301 is specifically configured to: match according to the preset at least two regular expressions Sequence, first searching for source code matching the sequential regular expression from the obtained page source code; if no source code matching the prior-order regular expression is found, according to the preset Matching order of two regular expressions, searching for source code matching the sequential regular expression from the obtained page source code, until finding the source code matching the regular expression, thereby obtaining the download object Preferred download address.
  • the download address rule corresponding to the download page includes at least two regular expressions
  • the preferred download address obtaining module is specifically configured to:
  • the download processing device further includes: a download address obtaining request module, configured to: before the first preferred download address returning module returns the obtained preferred download address of the download object to the client device, Receiving a download address acquisition request sent by the client device;
  • a download address obtaining request module configured to: before the first preferred download address returning module returns the obtained preferred download address of the download object to the client device, Receiving a download address acquisition request sent by the client device;
  • the first preferred download address returning module is specifically configured to: return a response message to the client device according to the download address obtaining request, where the response message includes a preferred download address corresponding to the download object.
  • the present invention also provides a second download processing apparatus, which includes:
  • the first operation instruction receiving module 102 is configured to receive a first operation instruction of the user to download the page, where the download page corresponds to one download object;
  • the first operation indication sending module 202 is configured to send, according to the first operation instruction, a first operation indication of the download page to the server, so that the server acquires a preferred download address of the download object;
  • the preferred download address returning module 302 is configured to receive a preferred download address corresponding to the download object returned by the server;
  • the second preferred download address display module 402 is configured to present the received preferred download address to the user to enable the user to download the download object through the preferred download address without opening the download page.
  • the second preferred download address display module 402 is specifically configured to: pop up a thumbnail information window corresponding to the download page, where the received preferred download address is displayed in the thumbnail information window.
  • the device further includes:
  • a first interface providing module configured to provide a first interface, where the first interface includes a page address area and a preview area, before the preferred download address returning module receives a preferred download address corresponding to the download object returned by the server, where Displaying a page list in the page address area, where the page list includes identification information of the download page, where the identifier information includes a title of the download page and/or an address of the download page.
  • a second operation instruction receiving module configured to receive a second operation instruction of the user for the identification information of the download page, and a download address acquisition request module, configured to send a download address acquisition request to the server according to the second operation instruction ;
  • the preferred download address returning module is specifically configured to: receive, by the receiving server, a response message that is returned according to the download address, where the response message includes a preferred download address corresponding to the download object;
  • the second preferred download address display module is specifically configured to: display the received preferred download address in the preview area.
  • the download processing device further includes:
  • a click operation detection module configured to detect, by the second preferred download address display module, the click operation of the preferred download address of the display after the second preferred download address display module displays the received preferred download address in the preview area;
  • An embodiment of the present invention further provides a server, including the foregoing first download processing apparatus.
  • the embodiment of the invention further provides a client device, which comprises the above second download processing device.
  • the present invention also provides a browser comprising the download processing device, the download processing device being embedded in the browser.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • a PC browser can be IE browser, Mozilla Firefox, Apple Safari, Opera Google Chrome, GreenBrowser browser, 360 security browser, Sogou high speed browser, Tencent TT, Maxthon browser, Baidu browser, Tencent QQ browser, etc., the browser has embedded the above download processing device, the browser is as follows Steps to proceed:
  • Step 1 receiving a first operation indication of the download page sent by the client device, where the download page corresponds to one download object;
  • Step 2 Obtain, according to the first operation indication, a page source code of the download page and a download address rule corresponding to the download page;
  • Step 3 Obtain a preferred download address of the downloaded object according to the obtained page source code and a download address rule corresponding to the download page.
  • Step 4 Return the obtained preferred download address of the downloaded object to the client device, so that the client device displays the preferred download address to the user, and the user can download through the preferred download address.
  • the download object does not need to open the download page.
  • the preferred download address of the download object is obtained, and the preferred download address is displayed to the user, so that the user
  • the user can directly obtain the preferred download address, which avoids the user's need to enter the download page and find the preferred download address from the download page, shortens the time for the user to obtain the preferred download address, improves the download efficiency of the user, and thus provides better users. Browsing experience.
  • Embodiment 2 is a diagrammatic representation of Embodiment 1:
  • Step 1 Receive a first operation instruction of the download page sent by the client device, where the download page corresponds to a download object;
  • Step 2 Obtain, according to the first operation indication, a page source code of the download page and a download address rule corresponding to the download page;
  • Step 3 Obtain a preferred download address of the downloaded object according to the obtained page source code and a download address rule corresponding to the download page.
  • Step 4 Return the obtained preferred download address of the downloaded object to the client device, so that the client device displays the preferred download address to the user, and the user can download through the preferred download address. Said Download the object without opening the download page.
  • the mobile phone browser obtains the preferred download address of the download object according to the obtained page source code of the downloaded page and the download address rule corresponding to the download page, and displays the preferred download address to the user, so that the user
  • the user can directly obtain the preferred download address, which avoids the user's need to enter the download page and find the preferred download address from the download page, shortens the time for the user to obtain the preferred download address, improves the download efficiency of the user, and thus provides better users. Browsing experience.
  • the embodiment of the present invention further provides a readable storage medium for storing a computer program, which is used to execute the download processing method disclosed in the above embodiment of the present invention.
  • the download address is obtained, so that the user can directly obtain the preferred download address, which avoids the user's need to enter the download page and find the preferred download address from the download page, shortens the time for the user to obtain the preferred download address, and improves the download efficiency of the user. Give users a better browsing experience.
  • the modules may be implemented in software for execution by various types of processors.
  • an identified executable code module can comprise one or more physical or logical blocks of computer instructions, which can be constructed, for example, as an object, procedure, or function. Nonetheless, the executable code of the identified modules need not be physically located together, but may include different instructions stored in different physicalities. When these instructions are logically combined, they form a module and implement the specified purpose of the module. .
  • the executable code module can be a single instruction or a number of instructions, and can even be distributed over multiple different code segments, distributed among different programs, and distributed across multiple memory devices.
  • operational data can be identified within the module and can be implemented in any suitable form and organized within any suitable type of data structure. The operational data may be collected as a single data set, or may be distributed over different locations (including on different storage devices), and may at least partially exist as an electronic signal on a system or network.
  • the module can be implemented by software, considering the level of the existing hardware process, the module can be implemented in software. Without considering the cost, a person skilled in the art can construct a corresponding hardware circuit to implement the corresponding function.
  • the hardware circuitry includes conventional Very Large Scale Integration (VLSI) circuits or gate arrays as well as existing semiconductors such as logic chips, transistors, or other discrete components.
  • VLSI Very Large Scale Integration
  • Modules can also be implemented with programmable hardware devices such as field programmable gate arrays, programmable array logic, programmable logic devices, and the like.
  • the sequence numbers of the steps are not used to limit the sequence of the steps. For those skilled in the art, the steps of the steps are changed without any creative work. It is also within the scope of the invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

一种下载处理方法、装置、服务器及客户端设备被公开,其中方法包括:接收客户端设备发送的下载页面的第一操作指示,下载页面对应一个下载对象;根据第一操作指示,获取下载页面的页面源码和下载页面对应的下载地址规则;根据获取的页面源码和下载页面对应的下载地址规则,获取下载对象的优选下载地址;向客户端设备返回获取的下载对象的优选下载地址,以使客户端设备向用户展示优选下载地址。

Description

一种下载处理方法、 装置、 服务器及客户端设备
技术领域
本发明属于互联网技术领域, 特别是涉及一种下载处理方法、 装置、 服务器及客户端 设备。 背景技术
通常来讲, 下载网站下的下载网页都对应一个下载对象, 例如, 一个下载网页用于下 载 office 软件, 这个下载网页中将具有 office 软件的下载链接。 但是目前很多下载站点出 于各种各样的目的, 经常在下载页面上设置繁杂的内容, 包含很多干扰链接。 现有的下载 站点通常以以下两种方式展示下载链接:
一种方式是, 一些下载站点为了推广有利益关系的软件、 游戏或广告, 将推广链接以 醒目的方式显示, 误导用户下载, 而真正的下载链接, 即真正下载对象的下载链接却隐藏 在很不显眼的地方, 而且一般情况下真正的下载链接也不止一个。 对于用户而言, 从众多 干扰链接中查找到真正下载对象的下载链接是比较麻烦的事情。
另一种方式是, 一些下载站点为了增加 PV (页面浏览量, Page View), 往往将软件描述 页面和软件下载页面分成两个页面, 这样, 用户需要点击软件下载页面的链接进入下级页 面, 从下级页面上查找软件的下载链接。 例如, 对于华军下载, 当用户点击"下载地址"按 钮时进入下级页面, 在下级页面中出现很多下载链接(即下载地址), 而用户所关心的只是 一个比较官方的、 且下载速度较快的优选下载地址, 但是一般情况下, 用户并不知道哪个 下载地址是优选下载地址, 因此只能随便选择一个进行下载, 不但降低用户的下载效率, 而且会给用户造成很大的困扰。 发明内容
为了解决现有的浏览器中进行下载时受到无关内容的干扰, 降低用户的下载效率, 会 给用户造成很大的困扰, 用户很难获得较好的浏览体验, 本发明提供了一种下载处理方法、 装置、 服务器及客户端设备。
本发明的实施例提供一种下载处理方法, 包括:
接收客户端设备发送的下载页面的第一操作指示, 所述下载页面对应一个下载对象; 根据所述第一操作指示, 获取所述下载页面的页面源码和所述下载页面对应的下载地 址规则;
根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下载对象的 优选下载地址;
向所述客户端设备返回所述获取的所述下载对象的优选下载地址, 以使所述客户端设 备向用户展示所述优选下载地址, 所述用户能够通过所述优选下载地址下载所述下载对象 而无需打开所述下载页面。
本发明的实施例提供第二种下载处理方法, 包括:
接收用户对下载页面的第一操作指令, 所述下载页面对应一个下载对象;
根据所述第一操作指令, 向服务器发送所述下载页面的第一操作指示, 以使所述服务 器获取所述下载对象的优选下载地址;
接收服务器返回的所述下载对象对应的优选下载地址;
向用户展示所述接收的优选下载地址, 以使所述用户能够通过所述优选下载地址下载 所述下载对象而无需打开所述下载页面。
本发明的实施例提供第三种下载处理方法, 包括:
根据下载页面的页面地址, 获取所述下载页面的页面源码和所述下载页面对应的下载 地址规则, 所述下载页面对应一个下载对象;
根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下载对象的 优选下载地址。
本发明的实施例还提供了第一种下载处理的装置, 包括:
第一操作指示接收模块, 用于接收客户端设备发送的下载页面的第一操作指示, 所述 下载页面对应一个下载对象;
页面源码和下载地址规则获取模块, 用于根据所述第一操作指示, 获取所述下载页面 的页面源码和所述下载页面对应的下载地址规则;
优选下载地址获取模块, 用于根据所述获取的页面源码和所述下载页面对应的下载地 址规则, 获取所述下载对象的优选下载地址;
第一优选下载地址返回模块, 用于向所述客户端设备返回所述获取的所述下载对象的 优选下载地址, 以使所述客户端设备向用户展示所述优选下载地址, 所述用户能够通过所 述优选下载地址下载所述下载对象而无需打开所述下载页面。
本发明的实施例还提供了第二种下载处理的装置, 包括: 第一操作指令接收模块, 用于接收用户对下载页面的第一操作指令, 所述下载页面对 应一个下载对象;
第一操作指示发送模块, 用于根据所述第一操作指令, 向服务器发送所述下载页面的 第一操作指示, 以使所述服务器获取所述下载对象的优选下载地址;
优选下载地址返回模块, 用于接收服务器返回的所述下载对象对应的优选下载地址; 第二优选下载地址展示模块, 用于向用户展示所述接收的优选下载地址, 以使所述用 户能够通过所述优选下载地址下载所述下载对象而无需打开所述下载页面。
本发明还提供了一种服务器, 包括所述的第一种下载处理装置。
本发明还提供了一种服务器, 包括所述的第二种下载处理装置。
本发明还提供了一种可读存储介质, 用于存储计算机程序, 所述计算机程序在运行时 用于执行上述下载处理方法。
本发明的上述技术方案的有益效果如下: 本发明针对对应于下载对象的下载页面, 根 据获取的下载页面的页面源码和所述下载页面对应的下载地址规则, 以获取所述下载对象 的优选下载地址, 并向用户展示所述优选下载地址, 使得用户能够直接获取优选下载地址, 避免了用户需要进入下载页面并从下载页面中查找优选下载地址的操作, 缩短了用户获取 优选下载地址的时间, 提高了用户的下载效率, 从而给用户带来较好的浏览体验。 附图说明
图 1为本发明第一种实施例的下载处理方法的流程图;
图 2为本发明第二种实施例的下载处理方法的流程图;
图 3为本发明第一种实施例的下载处理装置的结构框图;
图 4为本发明第二种实施例的下载处理装置的结构框图;
图 5为本发明实施例中一种客户端设备提供的界面的示例性示意图。 具体实施方式
为使本发明要解决的技术问题、 技术方案和优点更加清楚, 下面将结合附图及具体实 施例进行详细描述。
需要说明的是, 本发明的实施例的方法适用于大中型计算机、 个人计算机 PC, 当然也 适用于移动设备等其他智能设备, 例如, IOS操作*** (IOS是由苹果公司开发的手持设备 操作***) 的移动设备、安卓操作*** (Android***是一种基于 Linux的自由及开放源代码 的操作***)的移动设备, Windows Phone操作*** (Windows Phone是由微软开发的手持 设备操作***) 的移动设备, 本发明对此不作限定。
如图 1所示, 为本发明一种实施例的下载处理方法的流程图, 用于与移动终端或个人 计算机 PC 相对的服务器侧, 由服务器执行, 具体而言由服务器上安装的服务端设备或功 能模块执行, 具体包括如下步骤:
步骤 S 101 : 接收客户端设备发送的下载页面的第一操作指示, 所述下载页面对应一个 下载对象;
步骤 S102:根据所述第一操作指示,获取所述下载页面的页面源码和所述下载页面对 应的下载地址规则;
步骤 S103 :根据所述获取的页面源码和所述下载页面对应的下载地址规则,获取所述 下载对象的优选下载地址;
步骤 S 104: 向所述客户端设备返回所述获取的所述下载对象的优选下载地址, 以使所 述客户端设备向用户展示所述优选下载地址, 所述用户能够通过所述优选下载地址下载所 述下载对象而无需打开所述下载页面。
需要说明的是, 本发明实施例中所谓页面, 主要是指网页, 当然也可以是能够被用户 浏览的其它页面, 本发明对此不作限定。
本发明实施例中, 优选下载地址可以是下载对象真正的下载地址、 也可以使下载对象 真正的下载地址中质量较好、 或者较为安全的下载地址, 例如官方下载地址, 本发明对此 不作限定, 本领域技术人员可以任意设置。
本发明实施例中, 下载对象可以为软件、 音频文件、 视频文件以及其他任意一种能够 被下载的对象。 举例说明, 当一个页面为 office软件的下载页面时, office软件就是该页面 对应的下载对象。 通常来讲, 现有技术中, 这个下载页面中不仅仅只提供 office软件的下 载链接(即下载地址), 还可能具有很多其他软件、 游戏或广告的推广链接。 而且, 下载页 面所提供的 office软件的下载链接可能具有多个,用户不容易选择到 office软件的优选下载 链接。 为了解决这个问题, 本发明实施例提供了这种下载处理方法。
通常来讲, 在大部分网站 (例如下载网站) 的下载网页的页面源码中, 下载对象的优 选下载地址, 例如官方下载地址都有其常规使用的一种或几种代码表示方式, 即 "优选下 载地址"对应的源码在页面源码中是有规律可循的, 本发明实施例中将网站网页中针对优 选下载地址常规使用的代码表示方式即这种规律称之为下载地址规则, 也就是说, 大部分 网站一般都有其对应的下载地址规则, 亦即这些网站的网页都遵循该网站对应的下载地址 规则。
基于此, 本发明实施例中, 预先收集并设置了一定数目的网站的下载地址规则, 建立 一个下载地址规则的数据库或数据列表, 针对于特定网站的某个下载网页来讲, 可确定出 该网页对应的网站, 进而从预先设置的下载地址规则数据库或数据列表中, 查找到该网站 即该下载网页对应的下载地址规则, 进而从该网页的页面源码中查找到其下载对象的优选 下载地址, 进而可以向用户展示所述优选下载地址, 使得用户能够直接获取优选下载地址, 用户可以直接通过该下载地址下载下载对象, 避免了用户需要进入下载页面并从下载页面 中众多下载地址中查找优选下载地址的操作, 缩短了用户获取优选下载地址的时间, 提高 了用户的下载效率, 从而给用户带来较好的浏览体验。
本发明实施例中, 步骤 S101中, 服务器在收到客户端的第一操作指示时, 执行获取下 载地址的操作。 这里, 第一操作指示可以在用户针对下载页面进行某种操作时触发客户端 设备向服务器发送的, 告知服务器用户执行了针对下载页面的某种操作, 本发明实施例对 第一操作指示发送的时机和第一操作具体为何操作不做限定。 具体的, 该第一操作指示可 以根据是客户端设备接收的用户存储下载页面地址的指令发出, 如用户收藏具有下载对象 的页面地址的指令, 也可以根据客户端设备接收的用户搜索下载页面的指令发出。 例如, 用户进行搜索, 下载页面的标签显示在搜索结果页中, 当用户选中搜索结果页中的下载页 面的标签时, 客户端设备向服务器发送第一操作指示, 指示服务器用户选中了下载页面。 再例如, 在用户收藏下载页面时, 即存储下载页面的页面地址时, 客户端设备向服务器发 送第一操作指示, 告知服务器客户端设备用户收藏了该下载页面。 此时, 服务器就会根据 所述第一操作指示, 来获取所述下载页面的页面源码和其对应的下载地址规则, 并进而从 所述页面源码中获得下载对象的下载地址。
具体的, 在步骤 S101中, 接收客户端设备发送的下载页面的第一操作指示, 该第一操 作指示中携带有所述下载页面的地址信息。
这时, 步骤 S102中, 根据所述第一操作指示, 获取所述下载页面的页面源码具体包 括:
根据所述第一操作指示中携带的地址信息, 向所述下载页面对应的站点服务器发送源 码获取请求;
接收所述站点服务器发送的响应信息, 其中, 所述响应信息中包括所述下载页面的网 页源码。
需要说明的, 本发明实施例中, 当页面为网页时, 每个下载页面的页面地址是指统一 资源定位符 URL地址。
由于第一操作指示中携带有所述下载页面的地址信息, 为此, 向所述下载页面对应的 站点服务器发送源码获取请求, 就可以获取包括所述下载页面的网页源码的响应信息。 网 页是构成网站的基本元素, 是承载各种网站应用的平台, 一般是由各种语言进行编辑实现 的, 例如 ASP, JSP, ASP.NET, PHP, CGI等脚本语言, 下载对象对应的网页的源码会将 下载地址嵌入其中。
具体的, 可使用 PHP的 curl库模拟用户请求, 向下载页面对应的站点服务器请求获 取该视频页面的 html源码。
步骤 S102中, 所述根据所述第一操作指示, 获取所述下载页面对应的下载地址规则, 具体包括:
根据所述第一操作指示中携带的地址信息, 查询预先设置的下载地址规则, 以获取所 述地址信息对应的下载地址规则。 由于第一操作指示中携带有所述下载页面的地址信息, 为此, 根据该下载页面的地址信息就可以获取该地址信息对应的下载地址规则。
本发明实施例中, 当页面为网页时, 每个下载页面的页面地址是指统一资源定位符 URL地址。 通过 URL地址可以分析出该下载页面为哪个网站的网页, 进而找到与该网站 的下载地址规则, 即与下载页面对应的下载地址规则。
具体的, 下载地址规则可以与下载页面的域名相对应。 这时, 所述根据所述第一操作 指示中携带的地址信息, 查询预先设置的下载地址规则, 以获取所述地址信息对应的下载 地址规则的具体过程可以是:
根据所述第一操作指示中携带的地址信息, 确定所述下载页面的域名;
根据所述确定的下载页面的域名, 查询预先设置的下载地址规则, 以获取所述域名对 应的下载地址规则。
每个下载页面都具有相应的域名, 域名是一个通过计算机登上网络的单位在该网中的 地址, 是与网络上的数字型 IP地址相对应的字符型地址。 根据下载页面的域名可以查询到 预先设置的下载地址规则, 从而可以获取该域名对应的下载地址规则。
步骤 S103 中, 获取所述下载对象的优选下载地址是根据页面源码和所述下载页面对 应的下载地址规则得到的。
本发明的下载页面对应的下载地址在页面源码中是符合一定的规律的, 即满足下载地 址规则的。 因此, 本发明实施例预先设定了下载地址规则, 在需要获取下载地址时, 根据 该规则从页面源码中将下载地址找到并提取出来。 本实施例的下载页面对应的下载地址规则可以通过正则表达式进行表示的。 由于正则 表达式是用来描述或者匹配一系列符合某个句法规则的字符串, 而网页的源码也是具有句 法规则的字符串。 为此, 利用正则表达式与页面源码进行匹配就可以获取下载对象的优选 下载地址。
本实施例的正则表达式的获取过程, 详细描述如下:
预先配置一个包含各个下载站点的白名单, 如华军下载、 天空下载等, 收集从白名单 中各个下载站点的页面源码中找到下载地址的规则, 并通过正则表达式表示, 即根据白名 单中各个下载站点的网页源码, 配置从下载页面获取各个下载地址的正则表达式。
例如, 在下载页面的页面源码中, 官方下载地址的源码部分为:
<p><a class="other" href="http:〃 down.360safe.com/cse/360cse_7.3.0.116.exe"><i style="b ackground:url(/images/index.3.0/other.jpg) no-repeafx/ ^方下载 l</ax/p>
根据上述官方下载地址的源码, 依据其源码格式配置获取优选下载地址的正则表达 式: /href=\"([A;]+)\"\sclass=\"other\" .+?官方下载 /s。
当然该正则表达式还可以是其他的表示形式, 每种网站的优选下载地址的源码表示方 式可能存在不同, 相应的正则表达式是根据获取的白名单网站的源码得到的。
本发明根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下载 对象的优选下载地址具体包括:
根据所述表示下载地址规则的正则表达式, 从所述获取的页面源码中查找到匹配所述 正则表达式的源码, 以获取到所述下载对象的优选下载地址。
本发明的下载页面对应的下载地址规则可包括两个或者两个以上的正则表达式, 例如 与官方下载地址相对应的正则表达式、 与主流下载工具地址相对应的正则表达式、 与网站 推荐下载地址相对应的正则表达式。
在一种实现方式中, 本发明根据所述获取的页面源码和所述下载页面对应的下载地址 规则, 获取所述下载对象的优选下载地址包括:
根据预先设定的所述至少两个正则表达式的匹配顺序, 首先从所述获取的页面源码中 查找匹配所述顺序在先的正则表达式的源码;
如果没有查找到匹配所述顺序在先的正则表达式的源码, 根据预先设定的所述至少两 个正则表达式的匹配顺序, 从所述获取的页面源码中查找匹配所述顺序其次的正则表达式 的源码, 直到查找到匹配所述正则表达式的源码, 从而获取到所述下载对象的优选下载地 址。 在本发明的一个实施例中, 下载地址规则中包括与官方下载地址、主流下载工具地址、 网站推荐下载地址等分别相对应的正则表达式, 而所述正则表达式的匹配顺序为: 与官方 下载地址相对应的正则表达式、 与主流下载工具地址相对应的正则表达式、 与网站推荐下 载地址相对应的正则表达式。 在获取下载地址时, 将先匹配与官方下载地址相对应的正则 表达式, 如果未匹配到下载地址, 接下来匹配与主流下载工具地址相对应的正则表达式, 如果未匹配到下载地址, 接下来匹配与网站推荐下载地址相对应的正则表达式, 直到查找 到下载地址。 进而可将查找到的下载地址返回给客户端设备展示给用户。
作为一种可选方式,当所述下载页面对应的下载地址规则包括至少两个正则表达式时, 也可以根据所述获取的页面源码和所述至少两个正则表达式, 分别从所述获取的页面源码 中查找到匹配所述至少两个正则表达式中每个所述正则表达式的源码, 以获取到与所述至 少两个正则表达式中每个所述正则表达式分别对应的、 所述下载对象的优选下载地址, 进 而将这些下载地址都展现给用户, 供用户选择, 提升用户体验。
为了实现准确获取各个网站的优选下载地址, 可以针对每个具有下载站点的网站都分 别配置一个正则表达式, 建立一个网站和正则表达式的对应关系的数据库或者列表。
通常情况下, 每一个网站可能对应一个正则表达式, 也可能对应多个正则表达式, 如 下载站点的源码中有多个下载对象的下载地址的源码表示方式, 则需要配置多个正则表达 式。 当然, 某个正则表达式也可能对应多个网站。
本实施例的正则表达式可与根据下载站点的域名相对应。 由于每个网站的优选下载地 址有多个地址, 为此, 正则表达式也存在多个的情况, 例如包括与官方下载地址、 主流下 载工具地址、 网站推荐下载地址分别相对应的正则表达式。 此时, 需要将所述正则表达式 设定优先顺序, 依次去匹配所述待下载对象所对应网页的源码。
推荐优选下载地址的顺序一般是官方下载地址、 主流下载工具下载地址 (如 QQ旋风 等)、 网站推荐下载地址 (联通、 电信、 铁通主站等)。 即首先根据获取官方下载地址的正 则表达式匹配官方下载地址, 当匹配到官方下载地址时, 将官方下载地址作为优选下载地 址; 如果匹配不到官方下载地址, 则根据获取主流下载工具下载地址的正则表达式匹配主 流下载工具下载地址, 当匹配到主流下载工具下载地址时, 则将主流下载工具下载地址作 为优选下载地址; 如果官方下载地址和主流下载工具下载地址都不存在时, 根据用户的 ip 地址,选择电信、联通或铁通中的一个主下载地址 (一般为第一个下载地址)作为优选下载地 址。 一般情况下, 官方下载地址的下载资源优于其他下载地址, 因此按照官方下载地址到 主流下载工具下载地址到网站推荐下载地址的顺序推荐优选下载地址, 比较符合实际情况, 也可以提高用户下载效率。
上述正则表达式的顺序不局限于上述实施例, 也可以根据实际情况进行设置, 例如顺 序可以是与网站推荐下载地址相对应的正则表达式、与官方下载地址相对应的正则表达式、 与主流下载工具地址相对应的正则表达式。
在服务器获取了下载对象的优选下载地址后, 可以直接将优选下载地址返回客户端设 备, 使得客户端设备可以将该优选下载地址展示给用户, 例如客户端设备可以弹出一个下 载页面对应的信息缩略窗口, 在该窗口中显示优选下载地址, 或者, 客户端设备还可以在 当前用户界面的某个位置, 直接显示出优选下载地址。 而且, 客户端设备的用户不需要打 开下载页面, 能够通过所显示的优选下载地址直接下载下载对象。
此外, 在服务器获取了下载对象的优选下载地址后, 也可以先将优选下载地址存储, 在客户端设备请求优选下载地址时, 再将优选下载地址返回给客户端设备, 即在步骤 S104 中, 向所述客户端设备返回所述获取的所述下载对象的优选下载地址前, 所述方法还包括: 接收所述客户端设备发送的下载地址获取请求;
所述向所述客户端设备返回所述获取的所述下载对象的优选下载地址包括: 根据所述下载地址获取请求, 向所述客户端设备返回响应消息, 所述响应消息中包括 所述下载对象对应的优选下载地址。
服务器获取了下载对象的优选下载地址后, 可以先存储在服务器上或服务器之外的其 他位置, 当接收到客户端设备发送的下载地址获取请求时, 才将下载对象的优选下载地址 返回客户端设备。
举例而言, 客户端设备可以在用户针对下载页面执行某种操作时, 发送下载对象的优 选下载地址,例如,在用户选中了下载页面对应的标题时。具体的,下载页面的标题或 URL 显示在一界面中, 当用户在该界面中通过鼠标选中下载页面的标题或 URL时, 客户端设备 向服务器发送下载地址获取请求。
本发明实施例中在服务器向客户端设备返回包含下载对象的优选下载地址, 以使客户 端设备向用户展示所述优选下载地址, 具体地, 客户端设备可以是弹出所述下载页面对应 的缩略信息窗口, 所述缩略信息窗口中显示有所述接收的优选下载地址, 还可以是 WEB 文件夹的形式, 当用户选中该下载地址对应网页时, 在 WEB 文件夹的预览区中展示所述 接收的优选下载地址。 当然, 优选下载地址进行展示的方式不局限于以上两种方式。
相应的, 本发明还提供了第二种下载处理方法, 可用于移动终端或个人计算机 PC侧, 由移动终端或 PC执行, 具体而言由移动终端或 PC上安装的客户端设备或功能模块执行, 包括:
步骤 S201 : 接收用户对下载页面的第一操作指令, 所述下载页面对应一个下载对象; 步骤 S202: 根据所述第一操作指令, 向服务器发送所述下载页面的第一操作指示, 以 使所述服务器获取所述下载对象的优选下载地址;
其中, 服务器获得优选下载地址可参见前述实施例, 这里不再赘述。
步骤 S203: 接收服务器返回的所述下载对象对应的优选下载地址;
步骤 S204: 向用户展示所述接收的优选下载地址, 以使所述用户能够通过所述优选下 载地址下载所述下载对象而无需打开所述下载页面。
步骤 S201中, 该第一操作指令是用户针对下载页面进行的, 第一操作指令可以是用户 这里用户针对下载页面进行某种操作的操作指令, 可以是客户端设备接收的用户存储下载 页面地址的指示, 如用户收藏具有下载对象的页面地址的指示, 例如用户选中显示在屏幕 上的下载页面的标签或标题链接的选中操作指令, 用户收藏第一视频页面时, 即存储第一 视频页面的页面地址时的收藏指令。
步骤 S202中, 该第一操作指示根据客户端设备接收到的第一操作指令, 客户端设备 向服务器发出的, 该第一操作指示可以携带用户所操作的下载页面的页面地址。 当页面为 网页时, 该地址为 URL地址, 服务器可以通过 URL地址可以分析出该下载页面为哪个网 站的网页, 进而从页面源码中找到与该网站的下载地址规则, 即与下载页面对应的下载地 址规则。
可选的, 本发明的所述向用户展示所述接收的优选下载地址包括:
弹出所述下载页面对应的缩略信息窗口, 所述缩略信息窗口中显示有所述接收的优选 下载地址。
可选的, 本发明的在所述接收服务器返回的所述下载对象对应的优选下载地址前, 所 述方法还包括:
提供第一界面, 所述第一界面包括页面地址区和预览区, 所述页面地址区中显示页面 列表, 所述页面列表中包括所述下载页面的标识信息, 所述标识信息包括所述下载页面的 标题和 /或所述下载页面的地址;
接收用户对所述下载页面的标识信息的第二操作指令;
根据所述第二操作指令, 向所述服务器发送下载地址获取请求;
所述接收服务器返回的所述下载对象对应的优选下载地址包括:
接收服务器根据所述下载地址获取请求返回的响应消息, 所述响应消息中包括所述下 载对象对应的优选下载地址。
其中, 第二操作指令可以是用户选择该下载页面的指令, 例如, 该指令为用户通过鼠 标在页面地址区中点击下载页面的标题后的横向空白区域, 将第一视频页面选中。 这时, 客户端设备向服务器请求获取优选下载地址, 服务器将获取到的优选下载地址通过响应消 息返回给客户端设备。
本发明的所述向用户展示所述接收的优选下载地址包括:
在所述预览区中展示所述接收的优选下载地址。
本发明在所述预览区中展示所述接收的优选下载地址后, 所述方法还包括: 检测用户对所述展示的优选下载地址的点击操作;
当检测到所述点击操作时, 根据所述优选下载地址下载所述下载对象。
以下以本发明的下载处理方法在 web收藏夹中的应用为例进行详细说明:
当 web收藏夹客户端接收到用户收藏下载页面的消息 (相当于第一操作指令)时,向 web 收藏夹服务器发出请求 (相当于第一操作指示),该请求中包含用户收藏的下载页面的页面地 址 (下载页面的地址 URL), web收藏夹服务器根据用户收藏的页面的页面地址, 使用 PHP 的 curl库模拟用户请求, 向下载站点服务器请求获取该下载页面的 html源码。 也就是当用 户收藏一个下载页面时, web 收藏夹服务器就会从相应的下载站点获取用户收藏的下载页 面的 html源码。 另外, 根据下载页面的页面地址确定下载页面对应的下载站点的域名, 根 据该域名到预先设置的下载地址规则库或者列表中, 获得相应的正则表达式。 图 5为 web 收藏夹的主界面的一种示例性示意图, 包括三个内容栏, 最左边为文件夹栏, 中间为页面 地址栏, 最右边为预览栏。 其中文件夹栏中, 显示默认或者用户建立的若干个文件夹, 文 件夹中保存有用户收藏的页面地址。 页面地址栏中显示用户在文件夹栏中选中的文件夹中 包含的页面地址列表, 页面地址列表中的地址通常以地址名称的形式显示出来, 即当用户 在文件夹栏中选中一个文件夹时, 该文件夹中包含的地址以列表的形式显示在地址栏中; 预览栏中显示用户在页面地址栏中选中的地址所对应的网页的预览信息。 当用户点击到页 面地址栏中的一个下载页面的网址时, 即可打开网址对应的下载页面。 当用户在地址栏中 点击某个下载页面网址周围横向空白区域时 (即选中用户收藏的下载页面网址), web收藏夹 客户端向服务器发送下载地址获取请求,服务器将优选下载地址返回给 web收藏夹客户端, web 收藏夹客户端在右侧的预览栏中显示一个该下载页面的优选下载地址, 在用户点击右 侧预览栏中的下载地址时, 即可完成下载, 避免了用户需要进入下载页面并从下载页面中 查找真正或优选下载地址的操作。 相应的, 本发明还提供第三种下载处理方法, 具体包括以下步骤:
步骤 1 : 根据下载页面的页面地址, 获取所述下载页面的页面源码和所述下载页面对 应的下载地址规则, 所述下载页面对应一个下载对象;
步骤 2: 根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下 载对象的优选下载地址。
需要说明的是, 本发明实施例提供的上述方法可用于移动终端或个人计算机 PC 侧, 由移动终端或 PC执行, 具体而言由移动终端或 PC上安装的客户端设备或功能模块执行, 也可用于与移动终端或个人计算机 PC 相对的服务器侧, 由服务器执行, 具体而言由服务 器安装的服务端设备或功能模块执行。
具体地, 所述下载页面对应的下载地址规则通过正则表达式表示;
所述根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下载对 象的优选下载地址包括:
根据所述表示下载地址规则的正则表达式, 从所述获取的页面源码中查找到匹配所述 正则表达式的源码, 以获取到所述下载对象的优选下载地址。
如图 3所示, 为本发明一种实施例提供的下载处理装置的结构框图, 包括: 第一操作指示接收模块 101, 用于接收客户端设备发送的下载页面的第一操作指示, 所述下载页面对应一个下载对象;
页面源码和下载地址规则获取模块 201, 用于根据所述第一操作指示, 获取所述下载 页面的页面源码和所述下载页面对应的下载地址规则;
优选下载地址获取模块 301, 用于根据所述获取的页面源码和所述下载页面对应的下 载地址规则, 获取所述下载对象的优选下载地址;
第一优选下载地址返回模块 401, 用于向所述客户端设备返回所述获取的所述下载对 象的优选下载地址, 以使所述客户端设备向用户展示所述优选下载地址, 所述用户能够通 过所述优选下载地址下载所述下载对象而无需打开所述下载页面。
本发明针对对应于下载对象的下载页面, 根据获取的下载页面的页面源码和所述下载 页面对应的下载地址规则, 以获取所述下载对象的优选下载地址, 并向用户展示所述优选 下载地址, 使得用户能够直接获取优选下载地址, 避免了用户需要进入下载页面并从下载 页面中查找优选下载地址的操作, 缩短了用户获取优选下载地址的时间, 提高了用户的下 载效率, 从而给用户带来较好的浏览体验。
优选地, 所述第一操作指示中携带有所述下载页面的地址信息, 所述页面源码和下载 地址规则获取模块 201具体用于: 根据所述第一操作指示中携带的地址信息, 查询预先设 置的下载地址规则, 以获取所述地址信息对应的下载地址规则。
优选地, 所述页面源码和下载地址规则获取模块 201具体用于: 根据所述第一操作指 示中携带的地址信息, 确定所述下载页面的域名, 以及用于根据所述确定的下载页面的域 名, 查询预先设置的下载地址规则, 以获取所述域名对应的下载地址规则。
优选地, 所述页面源码和下载地址规则获取模块 201具体用于: 根据所述第一操作指 示中携带的地址信息, 向所述下载页面对应的站点服务器发送源码获取请求; 以及用于接 收所述站点服务器发送的响应信息, 其中, 所述响应信息中包括所述下载页面的网页源码。
优选地, 所述下载页面对应的下载地址规则通过正则表达式表示, 所述优选下载地址 获取模块 301具体用于: 根据所述表示下载地址规则的正则表达式, 从所述获取的页面源 码中查找到匹配所述正则表达式的源码, 以获取到所述下载对象的优选下载地址。
优选地, 所述下载页面对应的下载地址规则设定为包括至少两个正则表达式, 所述优 选下载地址获取模块 301具体用于:根据预先设定的所述至少两个正则表达式的匹配顺序, 首先从所述获取的页面源码中查找匹配所述顺序在先的正则表达式的源码; 如果没有查找 到匹配所述顺序在先的正则表达式的源码, 根据预先设定的所述至少两个正则表达式的匹 配顺序, 从所述获取的页面源码中查找匹配所述顺序其次的正则表达式的源码, 直到查找 到匹配所述正则表达式的源码, 从而获取到所述下载对象的优选下载地址。
优选地, 所述下载页面对应的下载地址规则包括至少两个正则表达式;
所述优选下载地址获取模块具体用于:
根据所述获取的页面源码和所述至少两个正则表达式, 分别从所述获取的页面源码中 查找到匹配所述至少两个正则表达式中每个所述正则表达式的源码, 以获取到与所述至少 两个正则表达式中每个所述正则表达式分别对应的、 所述下载对象的优选下载地址。
优选地, 所述下载处理装置还包括: 下载地址获取请求模块, 用于在所述第一优选下 载地址返回模块向所述客户端设备返回所述获取的所述下载对象的优选下载地址前, 接收 所述客户端设备发送的下载地址获取请求;
所述第一优选下载地址返回模块具体用于: 根据所述下载地址获取请求, 向所述客户 端设备返回响应消息, 所述响应消息中包括所述下载对象对应的优选下载地址。
本发明还提供了第二种下载处理装置, 其特征在于, 包括:
第一操作指令接收模块 102, 用于接收用户对下载页面的第一操作指令, 所述下载页 面对应一个下载对象; 第一操作指示发送模块 202, 用于根据所述第一操作指令, 向服务器发送所述下载页 面的第一操作指示, 以使所述服务器获取所述下载对象的优选下载地址;
优选下载地址返回模块 302, 用于接收服务器返回的所述下载对象对应的优选下载地 址;
第二优选下载地址展示模块 402, 用于向用户展示所述接收的优选下载地址, 以使所 述用户能够通过所述优选下载地址下载所述下载对象而无需打开所述下载页面。
优选地, 所述第二优选下载地址展示模块 402具体用于: 弹出所述下载页面对应的缩 略信息窗口, 所述缩略信息窗口中显示有所述接收的优选下载地址。
优选地, 所述装置还包括:
第一界面提供模块, 用于在所述优选下载地址返回模块接收服务器返回的所述下载对 象对应的优选下载地址之前, 提供第一界面, 所述第一界面包括页面地址区和预览区, 所 述页面地址区中显示页面列表, 所述页面列表中包括所述下载页面的标识信息, 所述标识 信息包括所述下载页面的标题和 /或所述下载页面的地址,
第二操作指令接收模块, 用于接收用户对所述下载页面的标识信息的第二操作指令; 下载地址获取请求模块, 用于根据所述第二操作指令, 向所述服务器发送下载地址获 取请求;
优选下载地址返回模块具体用于: 接收服务器根据所述下载地址获取请求返回的响应 消息, 所述响应消息中包括所述下载对象对应的优选下载地址;
第二优选下载地址展示模块具体用于:在所述预览区中展示所述接收的优选下载地址。 优选地, 所述下载处理装置还包括:
点击操作检测模块, 用于在所述第二优选下载地址展示模块在所述预览区中展示所述 接收的优选下载地址后, 检测用户对所述展示的优选下载地址的点击操作;
下载模块, 用于当检测到所述点击操作时, 根据所述优选下载地址下载所述下载对象。 本发明实施例还提供一种服务器, 包括上述第一种下载处理装置。
本发明实施例还提供一种客户端设备, 包括上述第二种下载处理装置。
本发明还提供了一种浏览器, 包括所述的下载处理装置, 所述下载处理装置嵌入在所 述浏览器中。
实施例一:
以 PC浏览器为例进行说明,可以是 IE浏览器、 Mozilla的 Firefox、Apple的 Safari, Opera Google Chrome, GreenBrowser浏览器、 360安全浏览器、 搜狗高速浏览器、 腾讯 TT、 傲 游浏览器、 百度浏览器、腾讯 QQ浏览器等等, 该浏览器中嵌入了上述下载处理装置, 浏览 器按照如下步骤进行操作:
步骤一: 接收客户端设备发送的下载页面的第一操作指示, 所述下载页面对应一个下 载对象;
步骤二: 根据所述第一操作指示, 获取所述下载页面的页面源码和所述下载页面对应 的下载地址规则;
步骤三: 根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下 载对象的优选下载地址;
步骤四: 向所述客户端设备返回所述获取的所述下载对象的优选下载地址, 以使所述 客户端设备向用户展示所述优选下载地址, 所述用户能够通过所述优选下载地址下载所述 下载对象而无需打开所述下载页面。
本实施例在 PC 浏览器中根据获取的下载页面的页面源码和所述下载页面对应的下载 地址规则, 以获取所述下载对象的优选下载地址, 并向用户展示所述优选下载地址, 使得 用户能够直接获取优选下载地址, 避免了用户需要进入下载页面并从下载页面中查找优选 下载地址的操作, 缩短了用户获取优选下载地址的时间, 提高了用户的下载效率, 从而给 用户带来较好的浏览体验。
实施例二:
以手机浏览器为例进行说明, 在手机浏览器中嵌入了上述下载处理装置, 本发明的手 机浏览器还可以对网页的内容进行调整, 根据不同型号手机的参数对显示内容进行调整, 以适合手机屏幕显示。 当用户利用该手机浏览器进行浏览页面时, 按照如下步骤进行操作: 步骤一: 接收客户端设备发送的下载页面的第一操作指示, 所述下载页面对应一个下 载对象;
步骤二: 根据所述第一操作指示, 获取所述下载页面的页面源码和所述下载页面对应 的下载地址规则;
步骤三: 根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下 载对象的优选下载地址;
步骤四: 向所述客户端设备返回所述获取的所述下载对象的优选下载地址, 以使所述 客户端设备向用户展示所述优选下载地址, 所述用户能够通过所述优选下载地址下载所述 下载对象而无需打开所述下载页面。
本实施例在手机浏览器中根据获取的下载页面的页面源码和所述下载页面对应的下载 地址规则, 以获取所述下载对象的优选下载地址, 并向用户展示所述优选下载地址, 使得 用户能够直接获取优选下载地址, 避免了用户需要进入下载页面并从下载页面中查找优选 下载地址的操作, 缩短了用户获取优选下载地址的时间, 提高了用户的下载效率, 从而给 用户带来较好的浏览体验。
本发明实施例还提供了一种可读存储介质, 用于存储计算机程序, 所述计算机程序在 运行时用于执行本发明上述实施例所公开的下载处理方法。
应用上述技术方案, 针对对应于下载对象的下载页面, 根据获取的下载页面的页面源 码和所述下载页面对应的下载地址规则, 以获取所述下载对象的优选下载地址, 并向用户 展示所述优选下载地址, 使得用户能够直接获取优选下载地址, 避免了用户需要进入下载 页面并从下载页面中查找优选下载地址的操作, 缩短了用户获取优选下载地址的时间, 提 高了用户的下载效率, 从而给用户带来较好的浏览体验。
此说明书中所描述的许多功能部件都被称为模块, 以便更加特别地强调其实现方式的 独立性。
本发明实施例中, 模块可以用软件实现, 以便由各种类型的处理器执行。 举例来说, 一个标识的可执行代码模块可以包括计算机指令的一个或多个物理或者逻辑块,举例来说, 其可以被构建为对象、 过程或函数。 尽管如此, 所标识模块的可执行代码无需物理地位于 一起, 而是可以包括存储在不同物理上的不同的指令, 当这些指令逻辑上结合在一起时, 其构成模块并且实现该模块的规定目的。
实际上, 可执行代码模块可以是单条指令或者是许多条指令, 并且甚至可以分布在多 个不同的代码段上, 分布在不同程序当中, 以及跨越多个存储器设备分布。 同样地, 操作 数据可以在模块内被识别, 并且可以依照任何适当的形式实现并且被组织在任何适当类型 的数据结构内。所述操作数据可以作为单个数据集被收集,或者可以分布在不同位置上(包 括在不同存储设备上), 并且至少部分地可以仅作为电子信号存在于***或网络上。
在模块可以利用软件实现时, 考虑到现有硬件工艺的水平, 所以可以以软件实现的模 块, 在不考虑成本的情况下, 本领域技术人员都可以搭建对应的硬件电路来实现对应的功 能, 所述硬件电路包括常规的超大规模集成 (VLSI) 电路或者门阵列以及诸如逻辑芯片、 晶体管之类的现有半导体或者是其它分立的元件。 模块还可以用可编程硬件设备, 诸如现 场可编程门阵列、 可编程阵列逻辑、 可编程逻辑设备等实现。 在本发明各方法实施例中, 所述各步骤的序号并不能用于限定各步骤的先后顺序, 对 于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 对各步骤的先后变化也在本 发明的保护范围之内。
以上所述是本发明的优选实施方式, 应当指出, 对于本技术领域的普通技术人员来说, 在不脱离本发明所述原理的前提下, 还可以作出若干改进和润饰, 这些改进和润饰也应视 为本发明的保护范围。

Claims

权利要求书
1. 一种下载处理方法, 其特征在于, 包括:
接收客户端设备发送的下载页面的第一操作指示, 所述下载页面对应一个下载对象; 根据所述第一操作指示, 获取所述下载页面的页面源码和所述下载页面对应的下载地 址规则;
根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下载对象的 优选下载地址;
向所述客户端设备返回所述获取的所述下载对象的优选下载地址, 以使所述客户端设 备向用户展示所述优选下载地址, 所述用户能够通过所述优选下载地址下载所述下载对象 而无需打开所述下载页面。
2. 根据权利要求 1所述的下载处理方法, 其特征在于,
所述第一操作指示中携带有所述下载页面的地址信息;
所述根据所述第一操作指示, 获取所述下载页面对应的下载地址规则包括: 根据所述第一操作指示中携带的地址信息, 查询预先设置的下载地址规则, 以获取所 述地址信息对应的下载地址规则。
3. 根据权利要求 2所述的下载处理方法, 其特征在于,
所述根据所述第一操作指示中携带的地址信息, 查询预先设置的下载地址规则, 以获 取所述地址信息对应的下载地址规则包括:
根据所述第一操作指示中携带的地址信息, 确定所述下载页面的域名;
根据所述确定的下载页面的域名, 查询预先设置的下载地址规则, 以获取所述域名对 应的下载地址规则。
4. 根据权利要求 2或 3所述的下载处理方法, 其特征在于,
所述根据所述第一操作指示, 获取所述下载页面的页面源码包括:
根据所述第一操作指示中携带的地址信息, 向所述下载页面对应的站点服务器发送源 码获取请求;
接收所述站点服务器发送的响应信息, 其中, 所述响应信息中包括所述下载页面的网 页源码。
5. 根据权利要求 1-4中任一项所述的下载处理方法, 其特征在于, 所述下载页面对应 的下载地址规则通过正则表达式表示; 所述根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下载对 象的优选下载地址包括:
根据所述表示下载地址规则的正则表达式, 从所述获取的页面源码中查找到匹配所述 正则表达式的源码, 以获取到所述下载对象的优选下载地址。
6. 根据权利要求 5所述的下载处理方法, 其特征在于,
所述下载页面对应的下载地址规则包括至少两个正则表达式;
所述根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下载对 象的优选下载地址包括:
根据预先设定的所述至少两个正则表达式的匹配顺序, 首先从所述获取的页面源码中 查找匹配所述顺序在先的正则表达式的源码;
如果没有查找到匹配所述顺序在先的正则表达式的源码, 根据预先设定的所述至少两 个正则表达式的匹配顺序, 从所述获取的页面源码中查找匹配所述顺序其次的正则表达式 的源码, 直到查找到匹配所述正则表达式的源码, 从而获取到所述下载对象的优选下载地 址。
7. 根据权利要求 6所述的下载处理方法, 其特征在于,
所述下载页面对应的下载地址规则包括与官方下载地址、 主流下载工具地址、 网站推 荐下载地址分别相对应的正则表达式;
所述正则表达式的匹配顺序为: 与官方下载地址相对应的正则表达式、 与主流下载工 具地址相对应的正则表达式、 与网站推荐下载地址相对应的正则表达式。
8. 根据权利要求 5所述的下载处理方法, 其特征在于,
所述下载页面对应的下载地址规则包括至少两个正则表达式;
所述根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下载对 象的优选下载地址包括:
根据所述获取的页面源码和所述至少两个正则表达式, 分别从所述获取的页面源码中 查找到匹配所述至少两个正则表达式中每个所述正则表达式的源码, 以获取到与所述至少 两个正则表达式中每个所述正则表达式分别对应的、 所述下载对象的优选下载地址。
9. 根据权利要求 1-8中任一项所述的下载处理方法, 其特征在于, 在所述向所述客户 端设备返回所述获取的所述下载对象的优选下载地址前, 所述方法还包括:
接收所述客户端设备发送的下载地址获取请求;
所述向所述客户端设备返回所述获取的所述下载对象的优选下载地址包括: 根据所述下载地址获取请求, 向所述客户端设备返回响应消息, 所述响应消息中包括 所述下载对象对应的优选下载地址。
10. 一种下载处理方法, 其特征在于, 包括:
接收用户对下载页面的第一操作指令, 所述下载页面对应一个下载对象;
根据所述第一操作指令, 向服务器发送所述下载页面的第一操作指示, 以使所述服务 器获取所述下载对象的优选下载地址;
接收服务器返回的所述下载对象对应的优选下载地址;
向用户展示所述接收的优选下载地址, 以使所述用户能够通过所述优选下载地址下载 所述下载对象而无需打开所述下载页面。
11. 根据权利要求 10所述的下载处理方法, 其特征在于,
所述向用户展示所述接收的优选下载地址包括:
弹出所述下载页面对应的缩略信息窗口, 所述缩略信息窗口中显示有所述接收的优选 下载地址。
12. 根据权利要求 10或 11所述的下载处理方法, 其特征在于,
在所述接收服务器返回的所述下载对象对应的优选下载地址前, 所述方法还包括: 提供第一界面, 所述第一界面包括页面地址区和预览区, 所述页面地址区中显示页面 列表, 所述页面列表中包括所述下载页面的标识信息, 所述标识信息包括所述下载页面的 标题和 /或所述下载页面的地址;
接收用户对所述下载页面的标识信息的第二操作指令;
根据所述第二操作指令, 向所述服务器发送下载地址获取请求;
所述接收服务器返回的所述下载对象对应的优选下载地址包括:
接收服务器根据所述下载地址获取请求返回的响应消息, 所述响应消息中包括所述下 载对象对应的优选下载地址;
所述向用户展示所述接收的优选下载地址包括:
在所述预览区中展示所述接收的优选下载地址。
13. 根据权利要求 12所述的下载处理方法, 其特征在于, 所述在所述预览区中展示所 述接收的优选下载地址后, 所述方法还包括:
检测用户对所述展示的优选下载地址的点击操作;
当检测到所述点击操作时, 根据所述优选下载地址下载所述下载对象。
14. 一种下载处理装置, 其特征在于, 包括: 第一操作指示接收模块, 用于接收客户端设备发送的下载页面的第一操作指示, 所述 下载页面对应一个下载对象;
页面源码和下载地址规则获取模块, 用于根据所述第一操作指示, 获取所述下载页面 的页面源码和所述下载页面对应的下载地址规则;
优选下载地址获取模块, 用于根据所述获取的页面源码和所述下载页面对应的下载地 址规则, 获取所述下载对象的优选下载地址;
第一优选下载地址返回模块, 用于向所述客户端设备返回所述获取的所述下载对象的 优选下载地址, 以使所述客户端设备向用户展示所述优选下载地址, 所述用户能够通过所 述优选下载地址下载所述下载对象而无需打开所述下载页面。
15. 根据权利要求 14所述的下载处理装置, 其特征在于, 所述第一操作指示中携带有 所述下载页面的地址信息;
所述页面源码和下载地址规则获取模块具体用于: 根据所述第一操作指示中携带的地 址信息, 查询预先设置的下载地址规则, 以获取所述地址信息对应的下载地址规则。
16. 根据权利要求 15所述的下载处理装置, 其特征在于, 所述页面源码和下载地址 规则获取模块具体用于: 根据所述第一操作指示中携带的地址信息, 确定所述下载页面的 域名, 以及根据所述确定的下载页面的域名, 查询预先设置的下载地址规则, 以获取所述 域名对应的下载地址规则。
17. 根据权利要求 15或 16所述的下载处理装置, 其特征在于, 所述页面源码和下载 地址规则获取模块具体用于: 根据所述第一操作指示中携带的地址信息, 向所述下载页面 对应的站点服务器发送源码获取请求;
接收所述站点服务器发送的响应信息, 其中, 所述响应信息中包括所述下载页面的网 页源码。
18. 根据权利要求 14-17中任一项所述的下载处理装置, 其特征在于, 所述下载页面 对应的下载地址规则通过正则表达式表示;
所述优选下载地址获取模块具体用于: 根据所述表示下载地址规则的正则表达式, 从 所述获取的页面源码中查找到匹配所述正则表达式的源码, 以获取到所述下载对象的优选 下载地址。
19. 根据权利要求 18所述的下载处理装置, 其特征在于, 所述下载页面对应的下载 地址规则设定为包括至少两个正则表达式; 所述优选下载地址获取模块具体用于: 根据预先设定的所述至少两个正则表达式的匹 配顺序, 首先从所述获取的页面源码中查找匹配所述顺序在先的正则表达式的源码; 如果没有查找到匹配所述顺序在先的正则表达式的源码, 根据预先设定的所述至少两 个正则表达式的匹配顺序, 从所述获取的页面源码中查找匹配所述顺序其次的正则表达式 的源码, 直到查找到匹配所述正则表达式的源码, 从而获取到所述下载对象的优选下载地 址。
20. 根据权利要求 18所述的下载处理装置, 其特征在于,
所述下载页面对应的下载地址规则包括至少两个正则表达式;
所述优选下载地址获取模块具体用于:
根据所述获取的页面源码和所述至少两个正则表达式, 分别从所述获取的页面源码中 查找到匹配所述至少两个正则表达式中每个所述正则表达式的源码, 以获取到与所述至少 两个正则表达式中每个所述正则表达式分别对应的、 所述下载对象的优选下载地址。
21. 根据权利要求 14-20 中任一项所述的下载处理装置, 其特征在于, 还包括下载地 址获取请求模块, 用于在所述第一优选下载地址返回模块向所述客户端设备返回所述获取 的所述下载对象的优选下载地址前, 接收所述客户端设备发送的下载地址获取请求; 所述第一优选下载地址返回模块具体用于: 根据所述下载地址获取请求, 向所述客户 端设备返回响应消息, 所述响应消息中包括所述下载对象对应的优选下载地址。
22. 一种下载处理装置, 其特征在于, 包括:
第一操作指令接收模块, 用于接收用户对下载页面的第一操作指令, 所述下载页面对 应一个下载对象;
第一操作指示发送模块, 用于根据所述第一操作指令, 向服务器发送所述下载页面的 第一操作指示, 以使所述服务器获取所述下载对象的优选下载地址;
优选下载地址返回模块, 用于接收服务器返回的所述下载对象对应的优选下载地址; 第二优选下载地址展示模块, 用于向用户展示所述接收的优选下载地址, 以使所述用 户能够通过所述优选下载地址下载所述下载对象而无需打开所述下载页面。
23. 根据权利要求 22所述的下载处理装置, 其特征在于, 所述第二优选下载地址展示 模块具体用于: 弹出所述下载页面对应的缩略信息窗口, 所述缩略信息窗口中显示有所述 接收的优选下载地址。
24. 根据权利要求 22或 23所述的下载处理装置, 其特征在于, 还包括:
第一界面提供模块, 用于在所述优选下载地址返回模块接收服务器返回的所述下载对 象对应的优选下载地址之前, 提供第一界面, 所述第一界面包括页面地址区和预览区, 所 述页面地址区中显示页面列表, 所述页面列表中包括所述下载页面的标识信息, 所述标识 信息包括所述下载页面的标题和 /或所述下载页面的地址,
第二操作指令接收模块, 用于接收用户对所述下载页面的标识信息的第二操作指令; 下载地址获取请求模块, 用于根据所述第二操作指令, 向所述服务器发送下载地址获 取请求;
优选下载地址返回模块具体用于: 接收服务器根据所述下载地址获取请求返回的响应 消息, 所述响应消息中包括所述下载对象对应的优选下载地址;
第二优选下载地址展示模块具体用于:在所述预览区中展示所述接收的优选下载地址。
25. 根据权利要求 24所述的下载处理装置, 其特征在于, 还包括:
点击操作检测模块, 用于在所述第二优选下载地址展示模块在所述预览区中展示所述 接收的优选下载地址后, 检测用户对所述展示的优选下载地址的点击操作;
下载模块, 用于当检测到所述点击操作时, 根据所述优选下载地址下载所述下载对象。
26. 一种服务器, 其特征在于, 包括权利要求 14-21任一项所述的下载处理装置。
27.—种客户端设备, 其特征在于, 包括权利要求 22-25任一项所述的下载处理装置。
28.—种下载处理方法, 其特征在于, 包括:
根据下载页面的页面地址, 获取所述下载页面的页面源码和所述下载页面对应的下载 地址规则, 所述下载页面对应一个下载对象;
根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下载对象的 优选下载地址。
29.根据权利要求 28 所述的下载处理方法, 其特征在于, 所述下载页面对应的下载地 址规则通过正则表达式表示;
所述根据所述获取的页面源码和所述下载页面对应的下载地址规则, 获取所述下载对 象的优选下载地址包括:
根据所述表示下载地址规则的正则表达式, 从所述获取的页面源码中查找到匹配所述 正则表达式的源码, 以获取到所述下载对象的优选下载地址。
30. 一种可读存储介质, 其特征在于, 用于存储计算机程序, 所述计算机程序在运行时 用于执行权利要求 1-9中任一项所述的下载处理方法,或权利要求 10-13中任一项所述的下 载处理方法, 或权利要求 28或 29所述的下载处理方法。
PCT/CN2014/082178 2013-07-12 2014-07-14 一种下载处理方法、装置、服务器及客户端设备 WO2015003664A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310294172.XA CN104283865A (zh) 2013-07-12 2013-07-12 一种下载处理方法、装置、服务器及客户端设备
CN201310294172.X 2013-07-12

Publications (1)

Publication Number Publication Date
WO2015003664A1 true WO2015003664A1 (zh) 2015-01-15

Family

ID=52258350

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/082178 WO2015003664A1 (zh) 2013-07-12 2014-07-14 一种下载处理方法、装置、服务器及客户端设备

Country Status (2)

Country Link
CN (1) CN104283865A (zh)
WO (1) WO2015003664A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260219A (zh) * 2015-11-17 2016-01-20 魅族科技(中国)有限公司 一种软件下载方法及终端
CN109885744A (zh) * 2019-01-07 2019-06-14 平安科技(深圳)有限公司 网页数据爬取方法、装置、***、计算机设备及存储介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105989091B (zh) * 2015-02-12 2019-12-24 阿里巴巴集团控股有限公司 用于页面显示的js文件加载方法、装置及***
CN105022832B (zh) * 2015-08-07 2018-11-13 广东欧珀移动通信有限公司 App应用程序安全下载的方法、移动终端及下载服务器
CN105893428A (zh) * 2015-12-07 2016-08-24 乐视移动智能信息技术(北京)有限公司 广告过滤方法、装置及移动终端
CN105574106B (zh) * 2015-12-14 2018-10-12 元力云网络有限公司 一种大数据平台的网络信息分析处理方法
CN105574149A (zh) * 2015-12-16 2016-05-11 惠州Tcl移动通信有限公司 一种移动终端及其页面下载内容自动显示的方法和***

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090013034A1 (en) * 2007-01-19 2009-01-08 International Business Machines Corporation Method, server, client and system for controlling download and display of web pages
CN101369280A (zh) * 2008-10-10 2009-02-18 深圳市茁壮网络技术有限公司 一种数字电视终端网页浏览的方法和装置
CN102760162A (zh) * 2012-06-11 2012-10-31 北京搜狗信息服务有限公司 展现和获取下载链接的方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090013034A1 (en) * 2007-01-19 2009-01-08 International Business Machines Corporation Method, server, client and system for controlling download and display of web pages
CN101369280A (zh) * 2008-10-10 2009-02-18 深圳市茁壮网络技术有限公司 一种数字电视终端网页浏览的方法和装置
CN102760162A (zh) * 2012-06-11 2012-10-31 北京搜狗信息服务有限公司 展现和获取下载链接的方法及装置

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105260219A (zh) * 2015-11-17 2016-01-20 魅族科技(中国)有限公司 一种软件下载方法及终端
CN105260219B (zh) * 2015-11-17 2019-03-19 魅族科技(中国)有限公司 一种软件下载方法及终端
CN109885744A (zh) * 2019-01-07 2019-06-14 平安科技(深圳)有限公司 网页数据爬取方法、装置、***、计算机设备及存储介质
CN109885744B (zh) * 2019-01-07 2024-05-10 平安科技(深圳)有限公司 网页数据爬取方法、装置、***、计算机设备及存储介质

Also Published As

Publication number Publication date
CN104283865A (zh) 2015-01-14

Similar Documents

Publication Publication Date Title
WO2015003664A1 (zh) 一种下载处理方法、装置、服务器及客户端设备
JP6487201B2 (ja) 推奨ページを生成するための方法及び装置
KR102006396B1 (ko) 브라우징 액티비티에 기초하여 정합 애플리케이션을 식별하는 기법
US8468145B2 (en) Indexing of URLs with fragments
US8291312B1 (en) Displaying web pages without downloading static files
US10515142B2 (en) Method and apparatus for extracting webpage information
US10262341B2 (en) Resource downloading method and device
WO2016201819A1 (zh) 检测恶意文件的方法和装置
CN103699669B (zh) 一种浏览器中进行消息推送的方法和一种浏览器终端
WO2013044744A1 (zh) 一种下载资源提供方法及装置
CN106339398A (zh) 一种网页页面的预读取方法、装置及智能终端设备
US10110966B2 (en) Method, device, server and client device for video processing
CN102968451B (zh) 浏览器格式页面中加载网址数据的方法和客户端
CN102880654B (zh) 一种信息终端浏览器的收藏夹动态更新方法
CN104063460A (zh) 一种在浏览器中加载网页的方法和装置
CN111104587A (zh) 网页显示方法、装置和服务器
WO2014000537A1 (zh) 一种钓鱼网站查找***及方法
CN101963992A (zh) 提高网页显示速度的方法及浏览器
CN103246699A (zh) 一种基于浏览器的数据访问控制方法和装置
CN104090887A (zh) 歌曲搜索方法及装置
CN107203470B (zh) 页面调试方法和装置
WO2018133772A1 (zh) 网页资源的获取方法和装置、存储介质、电子装置
CN102955850A (zh) 加载排序网址的方法和装置
WO2012151752A1 (en) Annotating search results with images
CN103793495A (zh) 应用信息检索方法及***和应用信息获取方法及***

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14823692

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205N DATED 22/03/2016)

122 Ep: pct application non-entry in european phase

Ref document number: 14823692

Country of ref document: EP

Kind code of ref document: A1