CN112202865A - Picture downloading method and device - Google Patents

Picture downloading method and device Download PDF

Info

Publication number
CN112202865A
CN112202865A CN202011024678.5A CN202011024678A CN112202865A CN 112202865 A CN112202865 A CN 112202865A CN 202011024678 A CN202011024678 A CN 202011024678A CN 112202865 A CN112202865 A CN 112202865A
Authority
CN
China
Prior art keywords
picture
downloading
download
pictures
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011024678.5A
Other languages
Chinese (zh)
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 ThreatBook Technology Co Ltd
Original Assignee
Beijing ThreatBook 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 ThreatBook Technology Co Ltd filed Critical Beijing ThreatBook Technology Co Ltd
Priority to CN202011024678.5A priority Critical patent/CN112202865A/en
Publication of CN112202865A publication Critical patent/CN112202865A/en
Pending legal-status Critical Current

Links

Images

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/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a picture downloading method and a device, wherein the method comprises the following steps: obtaining download addresses of a plurality of pictures; sequencing the download addresses of the pictures according to a preset rule to obtain an address queue; and sequentially downloading each picture based on the sequence of the download addresses of the pictures in the address queue. The invention obtains the address queue by sequencing the obtained picture downloading addresses, and then downloads the pictures one by one according to the sequence of the downloading addresses in the address queue, thereby solving the problem that the pictures can not be downloaded according to the preset sequence in the prior art.

Description

Picture downloading method and device
Technical Field
The invention relates to the technical field of internet, in particular to a picture downloading method and device.
Background
With the development of internet technology, people often use browsers to browse some pictures, text information and the like. When people browse pictures of interest, the pictures are usually downloaded for storage.
The conventional picture downloading method may set the src (source) attribute of an image object of HTML (HyperText Markup Language), that is, set the address of a picture to download the picture. However, this downloading method cannot control when the picture is downloaded, and cannot determine whether the picture is downloaded in error and successfully. And when there are a plurality of pictures to be downloaded, the pictures are downloaded in a random order. And under the condition that the current picture is wrongly downloaded, the pictures are downloaded according to the random sequence, so that the picture which is the next picture to be downloaded cannot be determined, the downloading request of the next picture to be downloaded cannot be cancelled, the downloading request of the picture which is not downloaded is continuously sent, and the network bandwidth is wasted.
Disclosure of Invention
An object of the embodiments of the present invention is to provide a method and an apparatus for downloading pictures, which are used to solve the problem in the prior art that pictures cannot be downloaded according to a predetermined sequence when being downloaded.
In order to solve the technical problem, the embodiment of the application adopts the following technical scheme: a picture downloading method comprises the following steps:
obtaining download addresses of a plurality of pictures;
sequencing the download addresses of the pictures according to a preset rule to obtain an address queue;
and sequentially downloading each picture based on the sequence of the download addresses of the pictures in the address queue.
Optionally, the obtaining the download addresses of the plurality of pictures includes:
acquiring a plurality of input information based on input operation of a user;
and acquiring the download address of each picture corresponding to each input information based on each input information to acquire the download addresses of a plurality of pictures.
Optionally, the obtaining the download addresses of the plurality of pictures includes:
responding to each target operation of a user to generate a download address acquisition request of a picture corresponding to each target operation;
and acquiring the download address of each picture from a target picture library based on the download address acquisition request of each picture so as to acquire the download addresses of a plurality of pictures.
Optionally, the sequentially downloading each picture based on the sequence of the download address of each picture in the address queue specifically includes:
based on the downloading addresses of the pictures and the sequence of the downloading addresses in the address queue, sending picture downloading requests to a target picture library in sequence, and downloading the pictures one by one;
optionally, the method further includes:
monitoring the downloading state of the current downloaded picture;
and under the condition that the downloading state of the current downloaded picture is monitored to be an abnormal state, stopping downloading the current picture.
Optionally, when the downloading of the current picture is stopped, the method further includes:
determining that the downloading address of the current downloading picture is located at the target sequencing position in the downloading address queue;
determining a downloading address of a picture to be downloaded corresponding to a sorting position behind the target sorting position based on the target sorting position;
and canceling to send each picture downloading request to a target picture library based on the address to be downloaded of the picture to be downloaded.
Optionally, in the case that the download state of the currently downloaded picture is monitored to be an abnormal state, the method further includes: and outputting preset prompting information for prompting.
Optionally, when the downloading of the current picture is completed, the method further includes: and displaying the current picture.
In order to solve the above technical problem, the present application provides a picture downloading device, including:
the obtaining module is used for obtaining download addresses of a plurality of pictures;
the sorting module is used for sorting the download addresses of the pictures according to a preset rule to obtain an address queue;
and the downloading module is used for sequentially downloading each picture based on the sequence of the downloading address of each picture in the address queue.
Optionally, the obtaining module is specifically configured to:
acquiring a plurality of input information based on input operation of a user;
and acquiring the download address of each picture corresponding to each input information based on each input information to acquire the download addresses of a plurality of pictures.
The embodiment of the invention has the beneficial effects that: the address queue is obtained by sequencing the obtained picture downloading addresses, and then the pictures are downloaded one by one according to the sequence of the downloading addresses in the address queue, so that the problem that the pictures cannot be downloaded according to the preset sequence in the prior art is solved.
Drawings
FIG. 1 is a flowchart illustrating a picture downloading process according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a picture downloading process according to another embodiment of the present invention;
fig. 3 is a block diagram of an apparatus for downloading pictures according to another embodiment of the present invention.
Detailed Description
Various aspects and features of the present application are described herein with reference to the drawings.
It will be understood that various modifications may be made to the embodiments of the present application. Accordingly, the foregoing description should not be construed as limiting, but merely as exemplifications of embodiments. Those skilled in the art will envision other modifications within the scope and spirit of the application.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with a general description of the application given above and the detailed description of the embodiments given below, serve to explain the principles of the application.
These and other characteristics of the present application will become apparent from the following description of preferred forms of embodiment, given as non-limiting examples, with reference to the attached drawings.
It should also be understood that, although the present application has been described with reference to some specific examples, a person of skill in the art shall certainly be able to achieve many other equivalent forms of application, having the characteristics as set forth in the claims and hence all coming within the field of protection defined thereby.
The above and other aspects, features and advantages of the present application will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.
Specific embodiments of the present application are described hereinafter with reference to the accompanying drawings; however, it is to be understood that the disclosed embodiments are merely exemplary of the application, which can be embodied in various forms. Well-known and/or repeated functions and constructions are not described in detail to avoid obscuring the application of unnecessary or unnecessary detail. Therefore, specific structural and functional details disclosed herein are not to be interpreted as limiting, but merely as a basis for the claims and as a representative basis for teaching one skilled in the art to variously employ the present application in virtually any appropriately detailed structure.
The specification may use the phrases "in one embodiment," "in another embodiment," "in yet another embodiment," or "in other embodiments," which may each refer to one or more of the same or different embodiments in accordance with the application.
An embodiment of the present invention provides a method for downloading a picture, which may be specifically applied to a terminal device, and as shown in fig. 1, the method in this embodiment includes the following steps:
step S101, obtaining download addresses of a plurality of pictures;
in this example, when obtaining the picture download address, the terminal device may send a request to the target picture library. The target picture library may exist in the form of an electronic device including, but not limited to, a server, a cloud device, a near field communication device, and the like. Taking the target server as an example, the present embodiment obtains the download address of the stored picture in the server from the server storing the picture. Or directly obtaining each picture download address according to a plurality of operation information input by the user at a preset position of the terminal equipment operation interface, for example, if the user can directly input the download address of the picture, the input information is the download address of the picture. The specific download address in this step may be a URL (Uniform Resource Locator) of the picture.
Step S102, sequencing the download addresses of the pictures according to a preset rule to obtain an address queue;
in the specific implementation process, the download addresses of the pictures can be sequenced in an array form.
And step S103, sequentially downloading each picture based on the sequence of the downloading addresses of each picture in the address queue.
In the specific implementation process of the step, the downloading requests can be sent to the server one by one according to the sequence of the downloading addresses; after the current picture is downloaded, sending a next downloading request based on a next downloading address in the address queue to download the next picture until the pictures corresponding to the downloading addresses in the address queue are downloaded.
In the implementation of the invention, the address queue is obtained by sequencing the obtained picture downloading addresses, and then the pictures are downloaded one by one according to the sequence in the address queue, thereby solving the problem that the pictures can not be downloaded according to the preset sequence in the prior art.
Another embodiment of the present invention provides a method for downloading a picture, as shown in fig. 2, including the following steps:
step S201, responding to each target operation of a user to generate a download address acquisition request of a picture corresponding to each target operation;
in this step, each picture may correspond to a target operation, and the generation of the download address acquisition request is triggered according to the target operation executed by the user. The specific target operation may include one or more of the following: clicking a download button, dragging a download icon to a preset position, dragging a picture to the preset position or dragging mark information of the picture to the preset position. Of course, when the mark information of the picture is dragged to a predetermined position as a target operation, unique mark information needs to be matched for each picture in advance for uniquely representing the picture.
Step S202, acquiring the download address of each picture from the target picture library based on the download address acquisition request of each picture so as to acquire the download addresses of a plurality of pictures.
In the specific implementation process of this step, after the terminal device generates the download address acquisition request, the request may be sent to the target photo gallery, and the target photo gallery may feed back the corresponding download address to the terminal device according to the request. The specific target picture library may obtain the download address corresponding to the flag information by searching the database according to the flag information of the picture in the download address obtaining request. Wherein the flag information is obtained by matching in advance for each picture.
Specifically, the download address may be obtained in the following manner in this step: acquiring a plurality of input information based on input operation of a user; and acquiring the download address of each picture corresponding to each input information based on each input information to acquire the download addresses of a plurality of pictures. Of course, the download addresses of several pictures can be obtained simultaneously by the above two methods. That is, when a user browses a web page, for example, browses a plurality of pictures to be downloaded, the user executes a target operation, which may be clicking each target download button, and then the terminal device responds to each target operation of the user to generate a download address acquisition request of a picture corresponding to each target operation; and then sending a downloading address acquisition request of each picture to a target picture library so as to acquire a downloading address of each picture. And the download address of another part of the picture may be a download address of the picture obtained by the user performing an input operation at a predetermined position of the browsing interface, for example, in the search box, and the terminal device may recognize input information of the input operation and directly obtain the download address of the picture from the input information. That is, the user has previously known the download address of the picture, and therefore the download address may be input as input information into the search box, so that the terminal device can acquire the download address.
Step S203, sequencing the download addresses of the pictures according to a preset rule to obtain an address queue;
in the specific implementation process, the download addresses of the pictures can be sequenced in an array form. The predetermined rules include: the obtained download addresses are sorted based on the sequence of the transmitted download address acquisition requests, that is, the download address corresponding to the download address acquisition request transmitted first by the terminal device can be used as the first download address in the address queue to download the first download address first. Or sequencing the download addresses according to the receiving time of the download addresses, namely according to the time of the download addresses fed back by the target picture library received by the terminal equipment; the download address received by the terminal device first can be used as the first download address in the address queue, and the download addresses are sorted in the above manner. The downloading addresses corresponding to the pictures can be sorted according to the memory size occupied by the pictures, namely, the downloading address of the picture occupying the smallest memory can be used as the first downloading address in the address queue to download the picture at first. According to the embodiment, the downloading addresses are sequenced in the above mode, so that the sequencing result is more reasonable, and a basis is provided for subsequently downloading the pictures in sequence.
Step S204, based on the download addresses of the pictures and the sequence of the download addresses in the address queue, sending the download requests of the pictures to a target picture library in sequence, and downloading the pictures one by one.
In the specific implementation process of the step, the currently downloaded picture can be displayed when the downloading is finished.
In the specific implementation process of the embodiment, the downloading state of the currently downloaded picture can be monitored; and under the condition that the downloading state of the current downloaded picture is monitored to be an abnormal state, stopping downloading the current picture. And meanwhile, predetermined prompt information can be output to prompt. In a specific implementation process, each download address in the address queue may be encapsulated into an asynchronous Promise object. In the downloading process, the array of the packaged asynchronous downloading addresses can be downloaded in the downloading process one by one according to the array sequence, then the notification that the current downloaded picture is successful can be obtained through the onload (loading event) object of the called image object, and the notification that the current loaded picture is failed can be obtained by monitoring the onerror (error) event, so that the downloading state of the current downloaded picture can be monitored.
In this embodiment, when the downloading state of the currently downloaded picture is monitored to be an abnormal state, the downloading of the currently downloaded picture is stopped, and meanwhile, the downloading address of the currently downloaded picture can be determined to be located at the target sorting position in the downloading address queue; determining a downloading address of a picture to be downloaded corresponding to a sorting position behind the target sorting position based on the target sorting position; and canceling to send each picture downloading request to a target picture library based on the address to be downloaded of the picture to be downloaded. Namely, under the condition that the current downloaded picture is determined to be abnormal, the current picture is stopped from being downloaded, and the downloading of the subsequent pictures is cancelled, so that the network bandwidth is saved.
Another embodiment of the present invention provides a picture downloading device, as shown in fig. 3, including:
the obtaining module is used for obtaining download addresses of a plurality of pictures;
the sorting module is used for sorting the download addresses of the pictures according to a preset rule to obtain an address queue;
and the downloading module is used for sequentially downloading each picture based on the sequence of the downloading address of each picture in the address queue.
In this embodiment, the obtaining module is specifically configured to: acquiring a plurality of input information based on input operation of a user; and acquiring the download address of each picture corresponding to each input information based on each input information to acquire the download addresses of a plurality of pictures.
In a specific implementation process of this embodiment, the obtaining module is further specifically configured to: responding to each target operation of a user to generate a download address acquisition request of a picture corresponding to each target operation; and acquiring the download address of each picture from a target picture library based on the download address acquisition request of each picture so as to acquire the download addresses of a plurality of pictures.
In this embodiment, the download module is specifically configured to: based on the downloading addresses of the pictures and the sequence of the downloading addresses in the address queue, sending picture downloading requests to a target picture library in sequence, and downloading the pictures one by one;
the picture downloading device in this embodiment further includes a monitoring module, and the monitoring module is configured to: monitoring the downloading state of the current downloaded picture; and under the condition that the downloading state of the current downloaded picture is monitored to be an abnormal state, stopping downloading the current picture.
The picture downloading device in this embodiment further includes a cancellation module, and when the downloading of the current picture is stopped, the cancellation module is configured to: determining that the downloading address of the current downloading picture is located at the target sequencing position in the downloading address queue; determining a downloading address of a picture to be downloaded corresponding to a sorting position behind the target sorting position based on the target sorting position; and canceling to send each picture downloading request to a target picture library based on the address to be downloaded of the picture to be downloaded.
The picture downloading device in the embodiment further comprises a prompting module and a display module, wherein the prompting module is used for outputting preset prompting information to prompt when the monitoring module monitors that the downloading state of the currently downloaded picture is an abnormal state.
The display module is used for: and when the downloading of the current picture is finished, displaying the current picture.
In the embodiment, the address queue is obtained by sequencing the obtained picture downloading addresses, and then the pictures are downloaded one by one according to the sequence of the downloading addresses in the address queue, so that the problem that the pictures cannot be downloaded according to the preset sequence in the prior art is solved. And the downloading state component of the current downloaded picture can be monitored, so that the downloading of the current picture can be stopped in time when the downloading state of the current downloaded picture is abnormal, and the downloading of the subsequent picture is cancelled, thereby saving broadband resources.
The above embodiments are only exemplary embodiments of the present invention, and are not intended to limit the present invention, and the scope of the present invention is defined by the claims. Various modifications and equivalents may be made by those skilled in the art within the spirit and scope of the present invention, and such modifications and equivalents should also be considered as falling within the scope of the present invention.

Claims (10)

1. A picture downloading method is characterized by comprising the following steps:
obtaining download addresses of a plurality of pictures;
sequencing the download addresses of the pictures according to a preset rule to obtain an address queue;
and sequentially downloading each picture based on the sequence of the download addresses of the pictures in the address queue.
2. The method of claim 1, wherein obtaining the download addresses of the plurality of pictures comprises:
acquiring a plurality of input information based on input operation of a user;
and acquiring the download address of each picture corresponding to each input information based on each input information to acquire the download addresses of a plurality of pictures.
3. The method of claim 1, wherein obtaining the download addresses of the plurality of pictures comprises:
responding to each target operation of a user to generate a download address acquisition request of a picture corresponding to each target operation;
and acquiring the download address of each picture from a target picture library based on the download address acquisition request of each picture so as to acquire the download addresses of a plurality of pictures.
4. The method of claim 1, wherein the downloading each picture in sequence based on the order of the download addresses of each picture in the address queue comprises:
and sequentially sending picture downloading requests to a target picture library based on the downloading addresses of the pictures and the sequence of the downloading addresses in the address queue, and downloading the pictures one by one.
5. The method of claim 1, wherein the method further comprises:
monitoring the downloading state of the current downloaded picture;
and under the condition that the downloading state of the current downloaded picture is monitored to be an abnormal state, stopping downloading the current picture.
6. The method of claim 5, wherein upon stopping downloading the current picture, the method further comprises:
determining that the downloading address of the current downloading picture is located at the target sequencing position in the downloading address queue;
determining a downloading address of a picture to be downloaded corresponding to a sorting position behind the target sorting position based on the target sorting position;
and canceling to send each picture downloading request to a target picture library based on the address to be downloaded of the picture to be downloaded.
7. The method of claim 4, wherein in case that the download status of the currently downloaded picture is monitored to be an abnormal status, the method further comprises: and outputting preset prompting information for prompting.
8. The method of claim 1, wherein upon completion of the current picture download, the method further comprises: and displaying the current picture.
9. A picture downloading apparatus, comprising:
the obtaining module is used for obtaining download addresses of a plurality of pictures;
the sorting module is used for sorting the download addresses of the pictures according to a preset rule to obtain an address queue;
and the downloading module is used for sequentially downloading each picture based on the sequence of the downloading address of each picture in the address queue.
10. The apparatus of claim 9, wherein the obtaining module is specifically configured to:
acquiring a plurality of input information based on input operation of a user;
and acquiring the download address of each picture corresponding to each input information based on each input information to acquire the download addresses of a plurality of pictures.
CN202011024678.5A 2020-09-25 2020-09-25 Picture downloading method and device Pending CN112202865A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011024678.5A CN112202865A (en) 2020-09-25 2020-09-25 Picture downloading method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011024678.5A CN112202865A (en) 2020-09-25 2020-09-25 Picture downloading method and device

Publications (1)

Publication Number Publication Date
CN112202865A true CN112202865A (en) 2021-01-08

Family

ID=74008308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011024678.5A Pending CN112202865A (en) 2020-09-25 2020-09-25 Picture downloading method and device

Country Status (1)

Country Link
CN (1) CN112202865A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905496A (en) * 2012-12-27 2014-07-02 腾讯科技(深圳)有限公司 Picture downloading method and device
CN107515947A (en) * 2017-09-05 2017-12-26 北京京东尚科信息技术有限公司 picture loading method and its system
CN107679546A (en) * 2017-08-17 2018-02-09 平安科技(深圳)有限公司 Face image data acquisition method, device, terminal device and storage medium
CN108073698A (en) * 2017-12-11 2018-05-25 武汉斗鱼网络科技有限公司 Real-time animation display methods, device, electric terminal and readable storage medium storing program for executing
CN109842673A (en) * 2018-12-20 2019-06-04 北京奇艺世纪科技有限公司 Picture downloads device and method, picture downloading accelerator and medium
CN110413911A (en) * 2018-04-26 2019-11-05 腾讯科技(深圳)有限公司 Network picture loading method, device, terminal device and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905496A (en) * 2012-12-27 2014-07-02 腾讯科技(深圳)有限公司 Picture downloading method and device
CN107679546A (en) * 2017-08-17 2018-02-09 平安科技(深圳)有限公司 Face image data acquisition method, device, terminal device and storage medium
CN107515947A (en) * 2017-09-05 2017-12-26 北京京东尚科信息技术有限公司 picture loading method and its system
CN108073698A (en) * 2017-12-11 2018-05-25 武汉斗鱼网络科技有限公司 Real-time animation display methods, device, electric terminal and readable storage medium storing program for executing
CN110413911A (en) * 2018-04-26 2019-11-05 腾讯科技(深圳)有限公司 Network picture loading method, device, terminal device and computer readable storage medium
CN109842673A (en) * 2018-12-20 2019-06-04 北京奇艺世纪科技有限公司 Picture downloads device and method, picture downloading accelerator and medium

Similar Documents

Publication Publication Date Title
CN110096660B (en) Method and device for loading page pictures and electronic equipment
CN108156252B (en) Data access method and device, server and client
CN107357890B (en) Webpage file processing method, device and system and storage equipment
US20170300793A1 (en) Method and device for page synchronization
CN104021218A (en) Information display method and device
CN107798064B (en) Page processing method, electronic device and computer readable storage medium
US11064052B2 (en) Page insertion method and device
WO2016045606A1 (en) Method and apparatus for recommending media content
US20180027355A1 (en) Data download method and apparatus
CN111694550B (en) Page display control method, device and system
CN109768980B (en) Server access method, device, mobile terminal and computer readable storage medium
CN110958462A (en) Live broadcast activity page display method and device, storage medium and live broadcast system
CN110515631B (en) Method for generating application installation data packet, server and computer storage medium
CN108600377A (en) A kind of pause method of file download, device, terminal and storage medium
CN106649581B (en) Webpage repairing method and client
CN108600780A (en) Method for pushed information
CN112689170B (en) Content playing method of display terminal, display terminal and readable storage medium
CN112202865A (en) Picture downloading method and device
CN116776030A (en) Gray release method, device, computer equipment and storage medium
CN116301866A (en) Cloud rendering method, device, equipment and storage medium based on custom software
CN109756393B (en) Information processing method, system, medium, and computing device
CN109951613B (en) Image transmitting method, image receiving method, image transmitting device, image receiving device, electronic device, and storage medium
CN108958740A (en) A kind of data processing method and device
CN110224973B (en) Multi-server parallel implementation method based on programming game, electronic equipment and medium
CN113819989B (en) Article packaging method, apparatus, electronic device and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210108

RJ01 Rejection of invention patent application after publication