CN107040584A - The method and device of client downloads picture - Google Patents

The method and device of client downloads picture Download PDF

Info

Publication number
CN107040584A
CN107040584A CN201710095901.7A CN201710095901A CN107040584A CN 107040584 A CN107040584 A CN 107040584A CN 201710095901 A CN201710095901 A CN 201710095901A CN 107040584 A CN107040584 A CN 107040584A
Authority
CN
China
Prior art keywords
picture
primary code
image data
server
browser
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.)
Granted
Application number
CN201710095901.7A
Other languages
Chinese (zh)
Other versions
CN107040584B (en
Inventor
张运
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201710095901.7A priority Critical patent/CN107040584B/en
Publication of CN107040584A publication Critical patent/CN107040584A/en
Application granted granted Critical
Publication of CN107040584B publication Critical patent/CN107040584B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • 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 
    • 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]

Landscapes

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

Abstract

The present invention discloses a kind of method and device of client downloads picture, is related to Internet technical field, can solve the problem that the problem of client downloads picture efficiency is low in the prior art.The method of the present invention includes:When the browser that client is embedded sends picture download request to server, the picture download request is intercepted and captured using the primary code of the affiliated operating system of the client;The primary code opens at least one new thread and the picture download request is sent into the server;The primary code receives the image data that the server is returned;The image data is sent to the browser and shown by the primary code.The present invention is mainly suitable in the scene based on mixing application download pictures.

Description

The method and device of client downloads picture
Technical field
The present invention relates to Internet technical field, more particularly to a kind of method and device of client downloads picture.
Background technology
With the development of Internet technology, the application software of all kinds for being convenient for people to work with living engenders, example The software for software, video software and the financial sector of such as doing shopping.Existing client (i.e. application software) mainly has primary visitor The mixed-client that family end, web client and primary code are combined with web.Wherein, mixed-client is accessing webpage When, the browser mainly embedded by client is downloaded from server side and shows web data.Specifically, embedded clear of client Device is look at after web page source code is got from server side, when needing to show the picture in webpage, first from web page source code The network address of picture is obtained, the picture download request for carrying the network address is then sent to server, after picture is downloaded and finished, then Picture is carried out to show.
However, the embedded browser of client typically only has two threads at present, one of them is UI (User Interface, user interface) main thread, another is asynchronous task thread.Therefore, when client needs the picture number of download , it is necessary to rank when measuring more, so that the efficiency that picture is downloaded is substantially reduced, and then the effect that Web page picture is shown Rate is reduced.
The content of the invention
In view of this, the present invention provides a kind of method and device of client downloads picture, can solve the problem that in the prior art The problem of client downloads picture efficiency is low.
On the one hand, the invention provides a kind of method of client downloads picture, methods described includes:
When the browser that client is embedded sends picture download request to server, operated using belonging to the client The primary code of system intercepts and captures the picture download request;
The primary code opens at least one new thread and the picture download request is sent into the server;
The primary code receives the image data that the server is returned;
The image data is sent to the browser and shown by the primary code.
On the other hand, the invention provides a kind of device of client downloads picture, described device includes:
Unit is intercepted and captured, for when the browser that client is embedded sends picture download request to server, using described The primary code of the affiliated operating system of client intercepts and captures the picture download request;
Transmitting element, for opening the institute that at least one new thread intercepts and captures the intercepting and capturing unit by the primary code State picture download request and be sent to the server;
Receiving unit, for receiving the image data that the server is returned by the primary code;
The transmitting element is additionally operable to that the image data is sent into the browser progress by the primary code Display.
The method and device of the client downloads picture provided by above-mentioned technical proposal, the present invention, can be in client Embedded browser to server send picture download request when, first using can open belonging to the client of more multithreading simultaneously The primary code of operating system intercepts and captures the picture download request, then by primary code according to default download mechanism, opens The picture download request is sent to server by least one new thread, (for example, when the picture download request of intercepting and capturing is more, Multiple new threads can be opened these picture download requests are concomitantly sent to server), last primary code receives clothes It is engaged in after the image data of device return, the image data can be sent to the embedded browser by primary code and be shown. It follows that with the prior art directly compared with can open the less embedded browser download pictures of Thread Count, the present invention By intercepting and capturing the picture download request that browser is sent, switch to that the more primary code progress picture download of Thread Count can be opened, So as to improve the efficiency of picture download, and then client is improved to the efficiency of user's exhibiting pictures.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, And can be practiced according to the content of specification, and in order to allow above and other objects of the present invention, feature and advantage can Become apparent, below especially exemplified by the embodiment of the present invention.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, various other advantages and benefit is common for this area Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And in whole accompanying drawing, identical part is denoted by the same reference numerals.In the accompanying drawings:
Fig. 1 shows a kind of flow chart of the method for client downloads picture provided in an embodiment of the present invention;
Fig. 2 shows the flow chart of the method for another client downloads picture provided in an embodiment of the present invention;
Fig. 3 shows the flow chart of the method for another client downloads picture provided in an embodiment of the present invention;
Fig. 4 shows a kind of composition frame chart of the device of client downloads picture provided in an embodiment of the present invention;
Fig. 5 shows the composition frame chart of the device of another client downloads picture provided in an embodiment of the present invention.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Complete conveys to those skilled in the art.
The embodiments of the invention provide a kind of method of client downloads picture, methods described is applied to client-side, such as Shown in Fig. 1, methods described mainly includes:
101st, when the browser that client is embedded sends picture download request to server, using belonging to the client The primary code of operating system intercepts and captures the picture download request.
Wherein, different operating system may use different primary codes.For example, when operating system is iOS system, Primary code is ObjC (Objective-C expands C Object-Oriented Programming Language);It is former when operating system is Android system Raw code is Java.
When user, which is based on client, accesses webpage, the embedded browser of client or the affiliated operating system of client Primary code can HTML (HyperText Markup local from client or server side acquisition webpage to be visited Language, HTML) data, then the html data is parsed and rendered by browser.When to be visited Webpage in when containing picture, due to recorded in html data be only picture network address, and the not substantive content of picture, So when browser determines in html data the network address containing picture, can be first according to each picture recorded in html data Network address generates corresponding picture download request respectively, is then turned on most two threads and sends different pictures to server successively Download request.Now, the Thread Count that can be opened due to browser is less, so that picture download efficiency is relatively low, so this Inventive embodiments use the primary code of the affiliated operating system of client when browser sends picture download request to server These picture download requests are intercepted and captured, come and be sent to server to send under multiple pictures so that primary code reopens more multithreading Request is carried, to improve picture download efficiency.
It should be noted that " the embedded browser of client sends picture download request to server " that this step is related to Concrete scene do not limit.For example, browser can be based under the scene downloaded on demand to server send picture download Request or based under the non-scene downloaded on demand to server send picture download request.Wherein, download pictures on demand Refer to:It is not that all pictures in webpage are first locally downloading further according to display need before being rendered to web data Ask and shown, but demand is directly shown come download pictures according to picture, i.e., when picture tag enters screen just to service Device sends picture download request.It follows that due to each picture in not webpage have into screen chance (for example, User is based on client and opened after webpage, may not scroll down through the page, the link just shown by clicking in screen is redirected Another page has been arrived, or has directly closed current page), so the method for download pictures can save picture download on demand Flow.In addition, on realizing that the specific implementation of the present invention can refer to Fig. 3 scene implementation in the case where downloading scene on demand Example.
102nd, the primary code opens at least one new thread and the picture download request is sent into the server.
After primary code intercepts and captures the picture download request that browser is sent to server, browser and service can be interrupted Data interaction between device, then by opening the data interaction between primary code and server, realizes picture down operation. Specifically, because the primary code of the affiliated operating system of client is Multi-core mechanism, so when primary code intercepts and captures clear , can be according to the number of the picture download request of intercepting and capturing, to be opened into after the picture download request that device of looking at is sent to server Picture download request is sent to server by a few new thread again.For example, picture download request number can be caused and new Number of threads is into positive correlation, i.e. the number of picture download request is more, then make it that the new thread number opened is more.
103rd, the primary code receives the image data that the server is returned.
, can be with after multiple picture download requests are concurrently sent to server by primary code based at least one new thread Pass through URL (Uniform Resource of at least one the new thread the reception server in picture download request Locator, URL) image data that finds.
It should be noted that the image data that primary code is received from server side is probably the original that can be directly displayed The image data of beginning, it is also possible to original image data is compressed, encapsulated etc. after processing be easy to transmission but can not be straight Connect the image data of display.For example, original image data is the data of bitmap forms, for speeding up data transmission speed, Image data to be sent is first converted to the data of jpeg forms by server by bitmap forms, then by the jpeg forms Image data be sent to primary code.
104th, the image data is sent to the browser and shown by the primary code.
Referred in above-mentioned steps 103, the image data that primary code is received from server side be able to may directly show Show, it is also possible to can not directly display, it is therefore desirable to which client will first receive the figure that image data is converted into directly displaying After sheet data, then browser is allowed to show it.
The specific implementation for allowing browser progress picture to show can be largely classified into following two:(1) primary code is straight Connect the image data that will be received and be sent to browser, it is directly first by browser so as to when image data can not be directly displayed The image data that image data is converted into directly displaying, then the image data that can be directly displayed is shown;(2) Primary code can first judge that the image data that server is returned whether can when receiving the image data of server return Directly display, if can directly display, the image data for directly returning to server is sent to browser and shown, if not It can directly display, then the image data that server is returned first is converted into the image data that can be directly displayed by primary code, so The image data for being possible to directly display again afterwards is sent to browser and shown.
For the second way, because when the picture download request of intercepting and capturing is more, primary code is probably one by one Ground receives all image datas, and and it is non-disposable receive all image datas, so now primary code is opened At least one new thread may still carry out picture down operation.Therefore, in order to improve the effect of image data format conversion Rate, primary code can separately open the image data for returning to server independently of other threads of at least one new thread and turn Change the image data that can be directly displayed into.
The method of client downloads picture provided in an embodiment of the present invention, the browser that can be embedded in client is to service When device sends picture download request, first using the primary code for the affiliated operating system of client that can open more multithreading simultaneously The picture download request is intercepted and captured, then by primary code according to default download mechanism, opening at least one new thread should Picture download request is sent to server, (for example, when the picture download request of intercepting and capturing is more, can open multiple new threads These picture download requests are concomitantly sent to server), last primary code receives the image data of server return Afterwards, the image data can be sent into the embedded browser by primary code to be shown.It follows that and prior art In directly compared by the less embedded browser download pictures of Thread Count can be opened, the present invention by intercept and capture browser send Picture download request, switchs to that the more primary code progress picture download of Thread Count can be opened, so as to improve picture download Efficiency, and then client is improved to the efficiency of user's exhibiting pictures.
Further, according to the method shown in Fig. 1, an alternative embodiment of the invention additionally provides a kind of client downloads The method of picture, as shown in Fig. 2 methods described mainly includes:
201st, when the browser that client is embedded sends picture download request to server, using belonging to the client The primary code of operating system intercepts and captures the picture download request.
The specific implementation of this step is consistent with the specific implementation of step 101 in Fig. 1, will not be repeated here.
202nd, the primary code judges locally whether be cached with the corresponding image data of the picture download request;If institute Stating the local cache of primary code has the corresponding image data of the picture download request, then performs step 203;If described primary The local of code does not cache the corresponding image data of the picture download request, then performs step 204-206.
When user accesses same webpage again every time, client is required for from server side re-downloads webpage Picture, still, in actual applications, user often frequently accesses same webpage, and (such as user browses 1 webpage half a day 1), therefore in order to improve the efficiency that user accesses Web page picture, certain image data is obtained from server side first in primary code Afterwards, first the network address of the image data and picture can be cached to locally, then when user accesses the picture again, without Picture down operation is carried out from server side again, directly image data is obtained from local.
Therefore, after primary code receives the picture download request that browser is sent to server, it can first judge local Whether the picture download request corresponding image data is cached with;If local cache has the corresponding picture number of the picture download request According to then the image data of local cache being sent into browser and be shown;If local be not cached with picture download Corresponding image data is asked, then picture download request is sent to server again, from server side download pictures data.Its In, primary code judges that the local specific implementation for whether being cached with the corresponding image data of picture download request can be with For:Primary code first obtains the network address of picture from picture download request, then from the network address for locally searching the picture;If searching To the network address of the picture, then the corresponding image data of the network address of the picture of local cache is defined as the picture download request pair The image data answered;If not finding the network address of the picture, it is determined that the local not corresponding picture number of the picture download request According to.
203rd, the image data of local cache is sent to the browser and shown by the primary code.
Because primary code is when image data is cached, the picture number that can be directly displayed can be directly cached According to the image data that can not be directly displayed after the processing such as compression, encapsulation can also be cached, so primary code is by local cache Image data be sent to the specific implementation that browser shown and can also be divided into two kinds:(1) primary code directly will The image data of local cache is sent to browser, and browser is received after image data, however, it is determined that image data can not be direct It has been shown that, then be first converted into the image data that can directly display, then shown by the image data;(2) if local cache Image data can be directly displayed, then the image data is directly sent to browser and shown by primary code;If local slow The image data deposited can not be directly displayed, then primary code first open that the image data of the caching is converted into by a thread can The image data directly displayed, then the image data for being possible to directly display are sent to server and shown.
204th, the primary code opens at least one new thread and the picture download request is sent into the server.
The specific implementation of this step is consistent with the specific implementation of step 102 in Fig. 1, will not be repeated here.
205th, the primary code receives the image data that the server is returned.
During for the ease of subsequently accessing the image data again, picture display efficiency is improved, primary code reception can be worked as After the image data returned to server, primary code can be cached image data, so as to follow-up directly from local Obtain.
Specifically, primary code can be based on preset buffer memory mechanism, the image data that server is returned and corresponding Network address is directly cached to locally;The picture number that can directly display can also be being got based on the image data that server is returned According to rear, then the image data that directly displays is possible to based on the preset buffer memory mechanism and network address is cached to locally.
Wherein, preset buffer memory mechanism can include:Periodically delete the image data infrequently accessed and corresponding network address; When client low memory, the longer image data of cache-time and corresponding network address are deleted;Only cache user is frequently visited The image data asked and corresponding network address etc..
206th, the image data is sent to the browser and shown by the primary code.
The specific implementation of this step is consistent with the specific implementation of step 104 in Fig. 1, will not be repeated here.
The method of client downloads picture provided in an embodiment of the present invention, can not only be intercepted and captured under picture by primary code Request is carried, is switched to by the less embedded browser download pictures of Thread Count can be opened by more primary of Thread Count can be opened Code download pictures, so as to improve picture download efficiency, and then improve efficiency of the client to user's exhibiting pictures, can also be The image data of download is cached to locally by primary code after server side download pictures based on caching mechanism, so that subsequently , can be directly from corresponding image data be locally obtained, without spending time, wave when needing the client to show the picture again Take flow from server side download pictures data, so as to further increase client to the efficiency of user's exhibiting pictures.
Referred in above-described embodiment, can be using the method download pictures downloaded on demand in order to save picture downloading flow. As shown in figure 3, the solution of the present invention is introduced by taking the scene of download pictures on demand as an example below:
301st, after web data is obtained, the primary code of the affiliated operating system of client is by picture in the web data Network address remove to default memory space.
Img labels in web data (such as html data) are used for an embedded width picture into webpage.And technically, Img labels can't in webpage insert pictures substantive content, but the network address of insert pictures.Specifically, img labels contain Two indispensable attributes, respectively src attributes and alt attributes.Wherein, src attributes are used for the network address of recordable picture, and alt attributes are used In when picture can not be rendered, by only showing that pure words are used as a kind of remedial measure.If it follows that primary code is by net The src attributes of img labels are removed to default memory space in network data, then browser can be caused can not to render corresponding picture, So as to play prevention browser simultaneously by the locally downloading effect of all pictures in webpage.
Wherein, when src attributes are removed to default memory space, primary code can be only by " src=URL " URL is removed, and URL can also be changed into other words, can also remove whole " src=URL ".In addition, default memory space Can be the memory space where Custom Attributes data-src, you can so that the URL in src attributes is removed to Custom Attributes In data-src.
302nd, the web data removed after network address is sent to the browser and shown by the primary code.
Wherein, the web data removed after network address is sent to after browser by primary code, and browser first can will remove picture Other data in addition are rendered, during to other data renders, if finding to have the picture not loaded in screen, The loaded and displayed of the picture can be realized by performing step 303-310.
303rd, when it is determined that there is the picture not loaded in screen, the primary code will be deposited in the default memory space The network address of the picture not loaded of storage is added to the correspondence position of the web data.
Wherein, primary code judges whether the specific implementation containing the picture not loaded can be in screen:Pass through JavaScript method judges whether img labels enter the screen;If into the screen, judging the img labels pair Whether the picture answered is downloaded, if not being downloaded, it is determined that there is the picture that does not load in the screen, if into screen The corresponding picture of img labels is all downloaded, it is determined that the picture not loaded is not present in the screen;If no img labels enter Enter the screen, it is determined that the picture not loaded is not present in the screen.Wherein, JavaScript method is to be based on primary language Say one section program of the execution write in embedded browser.
When it is determined that there is the picture not loaded in screen, primary code can determine that browser has the need for rendering picture Ask, therefore the src attributes of the corresponding img labels of the picture not loaded stored in default memory space can be added to this Img labels, picture download request is sent to trigger browser by the URL in src attributes to server.
304th, the browser sends the picture download request for carrying the network address to the server.
305th, the picture download request is intercepted and captured using the primary code of the affiliated operating system of the client.
306th, the primary code judges locally whether be cached with the corresponding image data of the picture download request;If institute Stating the local cache of primary code has the corresponding image data of the picture download request, then performs step 307;If described primary The local of code does not cache the corresponding image data of the picture download request, then performs step 308-310.
307th, the image data of local cache is sent to the browser and shown by the primary code.
308th, the primary code opens at least one new thread and the picture download request is sent into the server.
309th, the primary code receives the image data that the server is returned.
310th, the image data is sent to the browser and shown by the primary code.
Further, according to above method embodiment, an alternative embodiment of the invention is additionally provided under a kind of client The device of picture is carried, as shown in figure 4, described device mainly includes:Intercept and capture unit 41, transmitting element 42, receiving unit 43.Its In,
Unit 41 is intercepted and captured, for when the browser that client is embedded sends picture download request to server, using institute The primary code for stating the affiliated operating system of client intercepts and captures the picture download request;
Transmitting element 42, intercepts and captures the intercepting and capturing unit 41 for opening at least one new thread by the primary code The picture download request be sent to the server;
Receiving unit 43, for receiving the image data that the server is returned by the primary code;
The transmitting element 42, which is additionally operable to the image data is sent into the browser by the primary code, to be entered Row display.
Optionally, as shown in figure 5, described device also includes:
Judging unit 44, for opening at least one new thread by institute by the primary code in the transmitting element 42 State picture download request to be sent to before the server, judge locally whether be cached with the picture by the primary code The corresponding image data of download request;
The transmitting element 42 is used for when the judged result of the judging unit 44 does not have for the local of the primary code When caching the corresponding image data of the picture download request, pass through the primary code open at least one described new thread will The picture download request is sent to the server.
Optionally, the transmitting element 42 is additionally operable to when the judged result of the judging unit 44 is the primary code When local cache has the picture download request corresponding image data, by the primary code by the picture number of local cache Shown according to the browser is sent to.
Optionally, as shown in figure 5, described device also includes:
Buffer unit 45, for being based on preset buffer memory mechanism, the figure that the server is returned by the primary code Sheet data and corresponding network address are cached to locally;Or, by the primary code in the figure returned based on the server Sheet data is got after the image data that can be directly displayed, and can be directly displayed described based on the preset buffer memory mechanism Image data and the network address are cached to locally.
Optionally, as shown in figure 5, described device also includes:
Converting unit 46, for the image data to be sent into institute by the primary code in the transmitting element 42 State before browser shown, if the image data can not be directly displayed, by the primary code open independently of The figure that the image data that the server is returned is converted into directly displaying by other threads of at least one new thread Sheet data;
The transmitting element 42 is additionally operable to send the image data that can be directly displayed by the primary code Shown to the browser.
Optionally, the browser that the transmitting element 42 is additionally operable to embed by client sends picture download to server Request;
As shown in figure 5, described device also includes:
Unit 47 is removed, for sending picture to server by the embedded browser of client in the transmitting element 42 Before download request, after web data is obtained, the network address of picture in the web data is removed by the primary code To default memory space;
The transmitting element 42 is additionally operable to be sent to the web data removed after network address by the primary code described Browser is shown;
Adding device 48, for when it is determined that there is the picture not loaded in screen, by the primary code by described in The network address of the picture not loaded stored in default memory space is added to the correspondence position of the web data;
The transmitting element 42 is used to send to the server under the picture for carrying the network address by the browser Carry request.
The device of client downloads picture provided in an embodiment of the present invention, the browser that can be embedded in client is to service When device sends picture download request, first using the primary code for the affiliated operating system of client that can open more multithreading simultaneously The picture download request is intercepted and captured, then by primary code according to default download mechanism, opening at least one new thread should Picture download request is sent to server, (for example, when the picture download request of intercepting and capturing is more, can open multiple new threads These picture download requests are concomitantly sent to server), last primary code receives the image data of server return Afterwards, the image data can be sent into the embedded browser by primary code to be shown.It follows that and prior art In directly compared by the less embedded browser download pictures of Thread Count can be opened, the present invention by intercept and capture browser send Picture download request, switchs to that the more primary code progress picture download of Thread Count can be opened, so as to improve picture download Efficiency, and then client is improved to the efficiency of user's exhibiting pictures.In addition, in primary code from server side download pictures Afterwards, the image data of download is cached to locally based on caching mechanism, so that when subsequently needing the client to show the picture again, Can be directly from corresponding image data be locally obtained, without spending the time, wasting flow from server side download pictures number According to so as to further increase client to the efficiency of user's exhibiting pictures.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and does not have the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiment.
It is understood that the correlated characteristic in the above method and device can be referred to mutually.In addition, in above-described embodiment " first ", " second " etc. be to be used to distinguish each embodiment, and do not represent the quality of each embodiment.
It is apparent to those skilled in the art that, for convenience and simplicity of description, the system of foregoing description, The specific work process of device and unit, may be referred to the corresponding process in preceding method embodiment, will not be repeated here.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with based on teaching in this.As described above, construct required by this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It is understood that, it is possible to use it is various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the specification that this place is provided, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, exist Above in the description of the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:It is i.e. required to protect The application claims of shield features more more than the feature being expressly recited in each claim.More precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself All as the separate embodiments of the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit is required, summary and accompanying drawing) disclosed in each feature can or similar purpose identical, equivalent by offer alternative features come generation Replace.
Although in addition, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments In included some features rather than further feature, but the combination of the feature of be the same as Example does not mean in of the invention Within the scope of and form different embodiments.For example, in the following claims, times of embodiment claimed One of meaning mode can be used in any combination.
The present invention all parts embodiment can be realized with hardware, or with one or more processor run Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that can use in practice Microprocessor or digital signal processor (DSP) come realize client downloads picture according to embodiments of the present invention method and The some or all functions of some or all parts in device.The present invention is also implemented as being used to perform being retouched here The some or all equipment or program of device (for example, computer program and computer program product) for the method stated. Such program for realizing the present invention can be stored on a computer-readable medium, or can have one or more signal Form.Such signal can be downloaded from internet website and obtained, either on carrier signal provide or with it is any its He provides form.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of some different elements and coming real by means of properly programmed computer It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and run after fame Claim.

Claims (12)

1. a kind of method of client downloads picture, it is characterised in that methods described includes:
When the browser that client is embedded sends picture download request to server, the affiliated operating system of the client is used Primary code intercept and capture the picture download request;
The primary code opens at least one new thread and the picture download request is sent into the server;
The primary code receives the image data that the server is returned;
The image data is sent to the browser and shown by the primary code.
2. according to the method described in claim 1, it is characterised in that open at least one new thread by institute in the primary code State picture download request to be sent to before the server, methods described also includes:
The primary code judges locally whether be cached with the corresponding image data of the picture download request;
The primary code, which opens at least one new thread the picture download request is sent into the server, to be included:
If the local of the primary code does not cache the corresponding image data of the picture download request, the primary code Open at least one described new thread and the picture download request is sent to the server.
3. method according to claim 2, it is characterised in that if the local cache of the primary code has under the picture The corresponding image data of request is carried, then methods described also includes:
The image data of local cache is sent to the browser and shown by the primary code.
4. method according to claim 2, it is characterised in that receive the figure that the server is returned in the primary code After sheet data, methods described also includes:
The primary code is based on preset buffer memory mechanism, the image data that the server is returned and corresponding network address caching To local;
Or, the primary code gets the picture number that can be directly displayed in the image data returned based on the server According to rear, the image data that can be directly displayed and the network address are cached to locally based on the preset buffer memory mechanism.
5. according to the method described in claim 1, it is characterised in that the image data is sent to institute in the primary code State before browser shown, methods described also includes:
If the image data can not be directly displayed, the primary code open independently of at least one new thread its The image data that the image data that the server is returned is converted into directly displaying by his thread;
The image data is sent to the browser progress display by the primary code to be included:
The image data that can be directly displayed is sent to the browser and shown by the primary code.
6. method according to any one of claim 1 to 5, it is characterised in that the browser embedded in client is to clothes It is engaged in before device transmission picture download request, methods described also includes:
After web data is obtained, the primary code removes the network address of picture in the web data empty to default storage Between;
The web data removed after network address is sent to the browser and shown by the primary code;
When it is determined that there is the picture not loaded in screen, described in the primary code will be stored in the default memory space The network address for the picture not loaded is added to the correspondence position of the web data;
The embedded browser of the client sends picture download request to server to be included:
The browser sends the picture download request for carrying the network address to the server.
7. a kind of device of client downloads picture, it is characterised in that described device includes:
Unit is intercepted and captured, for when the browser that client is embedded sends picture download request to server, using the client The primary code of operating system intercepts and captures the picture download request belonging to end;
Transmitting element, for opening the figure that at least one new thread intercepts and captures the intercepting and capturing unit by the primary code Piece download request is sent to the server;
Receiving unit, for receiving the image data that the server is returned by the primary code;
The transmitting element, which is additionally operable to the image data is sent into the browser by the primary code, to be shown.
8. device according to claim 7, it is characterised in that described device also includes:
Judging unit, for opening at least one new thread by under the picture by the primary code in the transmitting element Carry request to be sent to before the server, judge locally whether be cached with the picture download request by the primary code Corresponding image data;
The transmitting element is used for when the judged result of the judging unit is described for not caching locally for the primary code During the corresponding image data of picture download request, at least one described new thread is opened by the picture by the primary code Download request is sent to the server.
9. device according to claim 8, it is characterised in that the transmitting element is additionally operable to sentencing when the judging unit When disconnected result has the picture download request corresponding image data for the local cache of the primary code, by described primary The image data of local cache is sent to the browser and shown by code.
10. device according to claim 8, it is characterised in that described device also includes:
Buffer unit, for being based on preset buffer memory mechanism, the image data that the server is returned by the primary code And corresponding network address is cached to locally;Or, by the primary code in the image data returned based on the server Get after the image data that can be directly displayed, based on the preset buffer memory mechanism by the picture number that can be directly displayed According to this and the network address is cached to locally.
11. device according to claim 7, it is characterised in that described device also includes:
Converting unit, for the image data to be sent into the browser by the primary code in the transmitting element Before being shown, if the image data can not be directly displayed, by the primary code open independently of it is described at least The image data that the image data that the server is returned is converted into directly displaying by other threads of one new thread;
The transmitting element is additionally operable to be sent to the image data that can be directly displayed by the primary code described Browser is shown.
12. the device according to any one of claim 7 to 11, it is characterised in that the transmitting element is additionally operable to pass through The embedded browser of client sends picture download request to server;
Described device also includes:
Unit is removed, for sending picture download request to server by the embedded browser of client in the transmitting element Before, after web data is obtained, the network address of picture in the web data is removed to default by the primary code and deposited Store up space;
The transmitting element is additionally operable to that the web data removed after network address is sent into the browser by the primary code Shown;
Adding device, for when it is determined that there is the picture not loaded in screen, being deposited described preset by the primary code The network address of the picture not loaded stored in storage space is added to the correspondence position of the web data;
The transmitting element is used to send the picture download request for carrying the network address to the server by the browser.
CN201710095901.7A 2017-02-22 2017-02-22 Method and device for downloading picture by client Active CN107040584B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710095901.7A CN107040584B (en) 2017-02-22 2017-02-22 Method and device for downloading picture by client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710095901.7A CN107040584B (en) 2017-02-22 2017-02-22 Method and device for downloading picture by client

Publications (2)

Publication Number Publication Date
CN107040584A true CN107040584A (en) 2017-08-11
CN107040584B CN107040584B (en) 2020-04-17

Family

ID=59533970

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710095901.7A Active CN107040584B (en) 2017-02-22 2017-02-22 Method and device for downloading picture by client

Country Status (1)

Country Link
CN (1) CN107040584B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595457A (en) * 2017-12-29 2018-09-28 北京奇虎科技有限公司 A kind of rendering intent and device of the waterfall stream page
CN110471720A (en) * 2018-05-09 2019-11-19 福建天泉教育科技有限公司 A kind of method and terminal that picture is cut
CN110581886A (en) * 2019-08-29 2019-12-17 大唐网络有限公司 File saving system and method
CN110727891A (en) * 2019-09-09 2020-01-24 中国平安财产保险股份有限公司 Browser cache management method and device and computer readable storage medium
CN110929191A (en) * 2019-10-25 2020-03-27 北京城市网邻信息技术有限公司 Picture loading method and device, terminal and storage medium
CN110995787A (en) * 2019-11-12 2020-04-10 苏州智加科技有限公司 Image labeling method, device, equipment and storage medium
CN111475748A (en) * 2019-01-24 2020-07-31 阿里巴巴集团控股有限公司 Picture display method and device
CN112947905A (en) * 2019-11-26 2021-06-11 腾讯科技(深圳)有限公司 Picture loading method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090002745A1 (en) * 2007-06-28 2009-01-01 Trishuleshwar Jyothiprakash Bi-directional communication between printer and client
CN103617165A (en) * 2013-10-22 2014-03-05 小米科技有限责任公司 Picture loading method, device and terminal
CN103823690A (en) * 2013-12-05 2014-05-28 Tcl集团股份有限公司 Online image loading method and system
CN104424333A (en) * 2013-09-11 2015-03-18 北大方正集团有限公司 Method and system for loading table data
CN105677741A (en) * 2015-12-29 2016-06-15 深圳市瑞铭无限科技有限公司 Method and device for loading page resources as required

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090002745A1 (en) * 2007-06-28 2009-01-01 Trishuleshwar Jyothiprakash Bi-directional communication between printer and client
CN104424333A (en) * 2013-09-11 2015-03-18 北大方正集团有限公司 Method and system for loading table data
CN103617165A (en) * 2013-10-22 2014-03-05 小米科技有限责任公司 Picture loading method, device and terminal
CN103823690A (en) * 2013-12-05 2014-05-28 Tcl集团股份有限公司 Online image loading method and system
CN105677741A (en) * 2015-12-29 2016-06-15 深圳市瑞铭无限科技有限公司 Method and device for loading page resources as required

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108595457A (en) * 2017-12-29 2018-09-28 北京奇虎科技有限公司 A kind of rendering intent and device of the waterfall stream page
CN110471720A (en) * 2018-05-09 2019-11-19 福建天泉教育科技有限公司 A kind of method and terminal that picture is cut
CN111475748A (en) * 2019-01-24 2020-07-31 阿里巴巴集团控股有限公司 Picture display method and device
CN111475748B (en) * 2019-01-24 2024-04-12 阿里巴巴集团控股有限公司 Picture display method and device
CN110581886A (en) * 2019-08-29 2019-12-17 大唐网络有限公司 File saving system and method
CN110727891A (en) * 2019-09-09 2020-01-24 中国平安财产保险股份有限公司 Browser cache management method and device and computer readable storage medium
CN110929191A (en) * 2019-10-25 2020-03-27 北京城市网邻信息技术有限公司 Picture loading method and device, terminal and storage medium
CN110995787A (en) * 2019-11-12 2020-04-10 苏州智加科技有限公司 Image labeling method, device, equipment and storage medium
CN112947905A (en) * 2019-11-26 2021-06-11 腾讯科技(深圳)有限公司 Picture loading method and device
CN112947905B (en) * 2019-11-26 2023-10-20 腾讯科技(深圳)有限公司 Picture loading method and device

Also Published As

Publication number Publication date
CN107040584B (en) 2020-04-17

Similar Documents

Publication Publication Date Title
CN107040584A (en) The method and device of client downloads picture
CN104360882B (en) Display methods and device are carried out to picture in webpage in a kind of browser
CN102917074B (en) A kind of method realizing server-side browser and server
CN102981705B (en) Server-side browser implementation method and server
US9690764B1 (en) Delivery and display of page previews using shadow DOM
CN110096660B (en) Method and device for loading page pictures and electronic equipment
US10542123B2 (en) System and method for generating and monitoring feedback of a published webpage as implemented on a remote client
CN107977371A (en) Requesting method, display methods and the client of page elements
CN102930058B (en) A kind of method and apparatus realizing searching in the address field of browser
CN103761241B (en) A kind of method for uploading and browser of image data
US10158740B2 (en) Method and apparatus for webpage resource acquisition
CN104426985B (en) Show the method, apparatus and system of webpage
CN105072461B (en) A kind of data processing method and device
CN102932469B (en) Method for achieving client browser and client browser
CN104463642A (en) Advertisement filtering processing method and device and browser client side
CN109165357A (en) Picture Generation Method, server, electronic equipment and readable storage medium storing program for executing
CN102929484B (en) Browser skin loading display method and device
CN103475744A (en) Resource downloading method, device and system on basis of Web application
CN104462283A (en) Method, device and client for requesting webpage elements in mobile terminal
CN102521257A (en) Method and device for providing corresponding on-line picture according to thumbnail
CN104468774A (en) Data presentation method applied to could disk client side and could disk client side
CN105141678B (en) The method and apparatus that a kind of pair of file is managed
CN104346463A (en) Loading method and device of page label and browser client
CN104462571A (en) Webpage loading method and device and browser client-side
CN105635613B (en) A kind of record screen method and apparatus of mobile device

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 1241593

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200918

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200918

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right