CN104252367B - The method and system of Asynchronous loading picture in a kind of intelligent terminal - Google Patents

The method and system of Asynchronous loading picture in a kind of intelligent terminal Download PDF

Info

Publication number
CN104252367B
CN104252367B CN201310263700.5A CN201310263700A CN104252367B CN 104252367 B CN104252367 B CN 104252367B CN 201310263700 A CN201310263700 A CN 201310263700A CN 104252367 B CN104252367 B CN 104252367B
Authority
CN
China
Prior art keywords
view
downloaded
picture
asynchronous task
url
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201310263700.5A
Other languages
Chinese (zh)
Other versions
CN104252367A (en
Inventor
刘宝剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Feinno Communication Technology Co Ltd
Original Assignee
Beijing Feinno Communication 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 Feinno Communication Technology Co Ltd filed Critical Beijing Feinno Communication Technology Co Ltd
Priority to CN201310263700.5A priority Critical patent/CN104252367B/en
Publication of CN104252367A publication Critical patent/CN104252367A/en
Application granted granted Critical
Publication of CN104252367B publication Critical patent/CN104252367B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of method and system of Asynchronous loading picture in intelligent terminal, according to picture to be downloaded, judges obtaining view corresponding with picture to be downloaded from the view list of the screen of intelligent terminal;If sky, asynchronous task is created, picture to be downloaded is downloaded by the asynchronous task of establishment, asynchronous task is preserved in the buffer in a manner of key-value pair, records the URL of picture to be downloaded in the view;If it is not sky, obtain the URL in view, asynchronous task corresponding to being searched according to URL from caching, the resource that the asynchronous task that release obtains takes, key-value pair corresponding to removing asynchronous task in the buffer, re-creates asynchronous task, and picture to be downloaded is downloaded by the asynchronous task newly created, the asynchronous task newly created is preserved in the buffer in a manner of key-value pair, records the URL of picture to be downloaded in the view.Technical scheme provided by the invention can solve the problem that existing method has the problem of easily error, occupying system resources are excessive.

Description

The method and system of Asynchronous loading picture in a kind of intelligent terminal
Technical field
The present invention relates to computer intelligence field of terminal technology, more particularly to Asynchronous loading picture in a kind of intelligent terminal Method and system.
Background technology
All it is greatly to need present in application software under present Android system between client and server Interact, i.e., network is accessed by client.When network is accessed, there will be client downloads network picture to originally Ground and situation about being shown on the window of intelligent terminal screen.
In existing technology, for client during network picture is downloaded, the technical scheme of generally use is divided into two kinds: It is a kind of to pass through oneself construction thread and thread pool;Another kind is to utilize ready-made asynchronous task AsyncTask.
Wherein, in the first scheme, downloading will go to reconfigure a thread every time, then one independence of do-it-yourself Thread pool, go control thread number.In this scenario, it is necessary to which it can a lot, and be oneself control to write size of code in advance The number of thread, easily there are various problems when application is run.
In second scheme, ready-made AsyncTask is used;Due to an AsyncTask inherently thread pool machine System, acquiescence allow the thread of operation to be 5, and it is 128 that can be lined up thread inside thread queue, more than this number, program Can throw exception.Because intelligent terminal internal memory is unusual precious resources, if constructing one to each downloading task It AsyncTask, can so cause the internal memory of the excessive occupancy intelligent terminal of downloading task, be unfavorable for the other application of intelligent terminal Use.And if be not controlled to AsyncTask quantity, once number is more than 128, then and application program will Occur abnormal.
In summary, there is easily error, take system in the technical scheme of the Asynchronous loading picture in existing intelligent terminal The problem of resource of uniting is excessive.
The content of the invention
The invention provides a kind of method and system of Asynchronous loading picture in intelligent terminal, technical side provided by the invention Case can solve the problem that existing method has the problem of easily error, occupying system resources are excessive.
To reach the purpose, the technical proposal of the invention is realized in this way:
The invention discloses a kind of method of Asynchronous loading picture in intelligent terminal, this method includes:
According to picture to be downloaded, obtained and the picture pair to be downloaded from the view list of the screen of intelligent terminal The view answered, judge whether the view is empty;
If the view is sky, asynchronous task is created, the figure to be downloaded is downloaded by the asynchronous task of establishment Piece, using the URL of the picture to be downloaded as key, the asynchronous task is value, and the asynchronous task is stored in into caching In, the URL of the picture to be downloaded is recorded in the view;
If the view is not sky, the URL in the view is obtained, is searched and corresponded to from caching according to the URL Asynchronous task, discharge acquisition asynchronous task take resource, remove in the buffer key corresponding to the asynchronous task and Value, asynchronous task is re-created, the picture to be downloaded is downloaded by the asynchronous task newly created, with described to be downloaded The URL of picture be key, the asynchronous task of the new establishment is value, and the asynchronous task of the new establishment is stored in into caching In, the URL of the picture to be downloaded is recorded in the view.
In the above-mentioned methods, it is complete in the view list after the screen of intelligent terminal receives slip view list operation It is described to be obtained and the picture to be downloaded from the view list of the screen of intelligent terminal when portion or partial view skid off screen Corresponding view specifically includes:
Obtained from the screen view list of intelligent terminal and skid off the view of screen, using the view as with it is described to be downloaded Picture corresponding to view.
In the above-mentioned methods, it is described to judge in the view whether be that sky specifically includes:
View corresponding with the picture to be downloaded is obtained by obtaining view interface, is sentenced in described obtain in view interface Whether the accessed view that breaks is empty.
In the above-mentioned methods, the URL that the picture to be downloaded is recorded in the view includes:
The URL of the picture to be downloaded is recorded in the view of the label of the view holds the URL attribute of adapter.
In the above-mentioned methods, not for sky, then the URL obtained in the view is specifically included the view:
The view for obtaining the label of the view holds adapter, finds the view and holds URL attribute in adapter, Take out the URL recorded in URL attribute.
In the above-mentioned methods, M view is included in the view list of the screen of the intelligent terminal;Preserved in then caching The number of asynchronous task is less than or equal to M, wherein, M is positive integer.
In the above-mentioned methods, also include before the resource that the asynchronous task that the release obtains takes:
Judge whether the download of the asynchronous task is completed, if it is not complete, then stopping the download of the asynchronous task Operation.
The invention discloses a kind of system of Asynchronous loading picture in intelligent terminal, the system includes:
View acquiring unit, judging unit, processing unit and asynchronous task creating unit;
The view acquiring unit, for according to picture to be downloaded, being obtained from the view list of the screen of intelligent terminal View corresponding with the picture to be downloaded is taken, instruction judging unit is judged the view;
The judging unit, for judging whether the view indicated by view acquiring unit is empty;
The processing unit, in the case of judging view to be empty in judging unit, created by the asynchronous task Unit creates asynchronous task, and the picture to be downloaded is downloaded by the asynchronous task of establishment;Judge view not in judging unit In the case of for sky, obtain the URL in the view, searched according to the URL from caching corresponding to asynchronous task, release obtains The resource that the asynchronous task taken takes, removes key and value corresponding to the asynchronous task, by described asynchronous in the buffer Task creation unit re-creates asynchronous task, and the picture to be downloaded is downloaded by the asynchronous task newly created;
The asynchronous task creating unit, for creating asynchronous task, using the URL of the picture to be downloaded as key, institute It is value to state asynchronous task, and the asynchronous task is preserved in the buffer, the picture to be downloaded is recorded in the view URL.
In said system, the view acquiring unit, view list behaviour is slided for being received in the screen of intelligent terminal After work, when all or part of view in the view list skids off screen, obtained from the screen view list of intelligent terminal The view of screen is skidded off, view corresponding with picture to be downloaded is used as using the view;
The judging unit, for obtaining view corresponding with the picture to be downloaded by obtaining view interface, in institute State to obtain and judge whether accessed view is empty in view interface.
In said system, the asynchronous task creating unit, the view for the label in view holds adapter The URL of picture to be downloaded is recorded in URL attribute;The processing unit, hold adapter for obtaining the view of label of view, Find the view and hold URL attribute in adapter, take out the URL recorded in URL attribute.
In summary, in the inventive solutions, the view according to picture to be downloaded from the screen of intelligent terminal View corresponding with the picture to be downloaded is obtained in list, whether the view for first judging to get is empty, if sky, is then created Build asynchronous task, the picture to be downloaded downloaded by the asynchronous task of establishment, if being not sky, according to URL in view from Asynchronous task corresponding to being searched in caching, the resource that the asynchronous task of acquisition takes is discharged, removes described asynchronous in the buffer Key corresponding to business and value, just creates asynchronous task afterwards, and the picture to be downloaded is downloaded by the asynchronous task of establishment.
So ensure the number for the view that the asynchronous task in intelligent terminal caching will not be more than in the view list of screen, So that when view is when invisible on screen, it can timely cancel asynchronous task corresponding with the view, discharge this asynchronous The system resource for occupancy of being engaged in, the system resource of release to be used for the down operation of other pictures to be downloaded.
Thereby, it is possible to solve in the prior art because asynchronous task is excessive and caused by operation easily error, occupancy system The excessive technical problem of resource, the beneficial effect achieve and reduce operation error probability, saved system resource in intelligent terminal.
Brief description of the drawings
Fig. 1 is the flow chart of Asynchronous loading picture in a kind of intelligent terminal in the present invention in embodiment;
Fig. 2 is the detail flowchart of Asynchronous loading picture in a kind of intelligent terminal in the present invention in embodiment;
Fig. 3 is the system structure diagram of Asynchronous loading picture in a kind of intelligent terminal in the present invention in embodiment.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention Formula is described in further detail.
Fig. 1 is the flow chart of Asynchronous loading picture in a kind of intelligent terminal in the present invention in embodiment;As described in Figure 1, This method comprises the following steps.
Step 101, according to picture to be downloaded, obtained from the view list of the screen of intelligent terminal and figure to be downloaded View corresponding to piece.
In the specific implementation of the present invention, need what is shown on the screen of intelligent terminal according to picture to be downloaded Position, view corresponding with the picture to be downloaded is obtained from the view list of the screen of intelligent terminal, it is to be downloaded to download this Picture, then by download complete picture show in this view.
In addition, regarded to realize repetition to system resource effectively to utilize, it is necessary to reuse and skid off the screen of intelligent terminal Figure, for example, intelligent terminal screen receive slide view list operation after, all or part of view in view list skids off screen During curtain, then view corresponding with picture to be downloaded is obtained from the view list of the screen of intelligent terminal, is specifically included:From intelligence The view for skidding off screen can be obtained in the screen view list of terminal, be regarded using the view as corresponding with picture to be downloaded Figure.
Step 102, judge whether view is empty.Step 103 is carried out if view is sky, is entered if view is for sky Row step 104.
In a step 102, due to during view is obtained, it may appear that a variety of situations, such as:In download pictures first When, the view got is empty;Either, in non-download pictures first, there is lower good figure in the view got Piece or the picture downloaded.Wherein, in an embodiment of the present invention, the view got is that sky refers in the view no pair The picture to be downloaded or corresponding picture to be downloaded answered do not start to download, i.e., also corresponding without being distributed for the picture to be downloaded Asynchronous task;The view got does not refer to that corresponding picture to be downloaded is downloaded or downloaded in the view for sky Complete.
For the view that gets in the case of empty, and the view for getting not in the case of empty, it is necessary to Carry out different processing;Therefore in a step 102, the view got is judged.In an embodiment of the present invention, sentence Whether the disconnected view got is empty specifically, by obtaining view interface acquisition view corresponding with picture to be downloaded, is being obtained Take and judge whether accessed view is empty in view interface.
Step 103, asynchronous task is created, picture to be downloaded is downloaded by the asynchronous task of establishment, with figure to be downloaded The URL of piece is key, asynchronous task value, and asynchronous task is preserved in the buffer, records picture to be downloaded in the view URL.
In step 103, because the view got is empty, i.e., picture was not shown also in the view;Then regarded at this Picture to be downloaded is shown in figure, it is necessary to create asynchronous task, passes through picture to be downloaded corresponding to the asynchronous task download of establishment;And And using the URL of picture to be downloaded as key, asynchronous task value, asynchronous task is stored in by way of key-value pair slow In depositing, and the URL of picture to be downloaded is recorded in this view.
In an embodiment of the present invention, record the URL of picture to be downloaded in this view specifically, view mark The view of label holds the URL that picture to be downloaded is recorded in the URL attribute of adapter.
Step 104, obtain the URL in view, searched according to URL from caching corresponding to asynchronous task, discharge acquisition The resource that asynchronous task takes, key and value corresponding to asynchronous task is removed in the buffer(Namely remove this asynchronous Business), asynchronous task is re-created, picture to be downloaded is downloaded by the asynchronous task newly created, with the URL of picture to be downloaded For key, the asynchronous task newly created is value, the asynchronous task newly created is preserved in the buffer, record is treated down in the view The URL of the picture of load.
At step 104, in the case where the view got is not for sky, i.e., had existed in the view got The URL of corresponding picture, by obtaining the URL in view, searched according to the URL from caching corresponding to asynchronous task, release The resource that the asynchronous task of acquisition takes, removes key and value corresponding to the asynchronous task in the buffer.
Wherein, during the resource that the asynchronous task that release obtains takes, it is also necessary to first judge the asynchronous task Whether download is completed, if it is not complete, then stopping the down operation of asynchronous task, then discharges the money of asynchronous task occupancy Source, key and value corresponding to the asynchronous task is removed in the buffer.If the download of asynchronous task has been completed, this asynchronous Business can remove from caching automatically, i.e., remove key and value corresponding to the asynchronous task in the buffer automatically.
After asynchronous task corresponding to removing in the buffer, asynchronous task is re-created, passes through the asynchronous task newly created Picture to be downloaded is downloaded, using the URL of picture to be downloaded as key, the asynchronous task newly created is value, by what is newly created Asynchronous task preserves in the buffer, records the URL of picture to be downloaded in the view.
In an embodiment of the present invention, the view for skidding off screen is obtained from the screen view list of intelligent terminal, with this When view is as view corresponding with picture to be downloaded, that is, the view for skidding off screen is reused, wherein, the process of reuse is specific For:
Obtain the URL in the view of the reuse, searched according to the URL from caching corresponding to asynchronous task, in the buffer Key and value corresponding to the asynchronous task is removed, asynchronous task is created according to picture to be downloaded, with the URL of picture to be downloaded For key, corresponding asynchronous task is value, and the asynchronous task newly created is preserved in the buffer;Add in the view of the reuse Add the URL of picture to be downloaded.
At step 104, i.e., in the case where the view got is not for sky, the URL obtained in the view is specifically included: The view for obtaining the label of the view holds adapter, finds view and holds URL attribute in adapter, takes out in URL attribute The URL of record.
M view is included in a kind of embodiment of the present invention, the view list of the screen of intelligent terminal(For example, according to The screen size of intelligent terminal is different, and some intelligent terminal view lists include 9 views, have plenty of 10 or 15);Then delay The number for depositing the asynchronous task of middle preservation is less than or equal to M(It can show that debugging is different and automatic according to concrete intelligence terminal screen Adjustment), wherein, M is positive integer.Because the cache resources of intelligent terminal are most valuable, in order to effectively utilize the slow of intelligent terminal Deposit resource, the view that will skid off intelligent terminal screen reuses, will skid off intelligent terminal view be used for showing it is new to be downloaded Picture so that the number of asynchronous task is less than or equal to the number for the view that intelligent terminal is shown.The application is without using such as Thread queue the same AsyncTask.
Fig. 2 is the detail flowchart of Asynchronous loading picture in a kind of intelligent terminal in the present invention in embodiment, and step is such as Under.
Step 201, according to picture to be downloaded, obtained from the view list of the screen of intelligent terminal and figure to be downloaded View corresponding to piece.
In above-mentioned steps, due to only setting in the present invention corresponding to the view number that can show of screen of intelligent terminal Asynchronous task, set intelligent terminal screen view list in view can reuse, be exemplified as, the screen of intelligent terminal is received To after sliding view list operation, when all or part of view in the view list of the screen of intelligent terminal skids off screen, from The view for skidding off screen is obtained in view list, view corresponding with picture to be downloaded is used as using the view.Wherein, reuse View must be the view of the screen skidded off at first in the screen view list of intelligent terminal.
Step 202, judge whether view is empty;Step 203 is carried out if sky, if not carrying out step 204 to be empty.
In step 202, judge whether view is that empty operation can be with specifically, inheriting adapter Adapter Obtain and view corresponding with picture to be downloaded is obtained in view interface getview, in view interface is obtained accessed by judgement View whether be empty.Wherein, view is the empty URL for representing not adding picture to be downloaded in the view;View is not empty table Show the URL that picture to be downloaded is added with the view.
Step 203, asynchronous task is created, picture to be downloaded is downloaded by the asynchronous task of establishment, with figure to be downloaded The URL of piece is key, asynchronous task value, and asynchronous task is preserved in the buffer, records picture to be downloaded in the view URL.
In step 203, the URL of picture to be downloaded is recorded in view specifically, the view in the label Tag of view is held Have the URL that picture to be downloaded is recorded in adapter viewHolder URL attribute, i.e., in the view create a view hold it is suitable Orchestration, the URL of picture to be downloaded is then added to view and held in the attribute of adapter.
Step 204, obtain the URL in view, searched according to the URL from caching corresponding to asynchronous task.
In step 204, adapter is held by the view for the label for obtaining view, then find the view hold it is suitable URL attribute in orchestration, take out the URL recorded in URL attribute.
Step 205, judge whether asynchronous task downloads completion;If carrying out step 207, step 206 is carried out if not.
Step 206, stop the down operation of asynchronous task, perform step 207.
Step 207, discharge acquisition asynchronous task take resource, in the buffer remove asynchronous task corresponding to key and value。
In above-mentioned steps 206 and step 207, after the completion of the download of current asynchronous task, it is asynchronous directly to discharge this The resource that task takes, and removes key and value corresponding to the asynchronous task in the buffer automatically, that is, to remove this different Step task.When the download of current asynchronous task does not complete, first stop the down operation of the asynchronous task, it is different then to discharge this The resource that step task takes, then key and value corresponding to asynchronous task is removed in the buffer.Reduced with this to system resource Take.
Sliding the view list of mobile phone screen so that when all or part of view in the view list skids off screen, The view of screen will be skidded off as view corresponding with picture to be downloaded, if the view is not sky, the view is reuses View;Down operation in the view is cancelled, i.e., key and value corresponding to deletion in the buffer, release asynchronous task takes Resource.This ensures that when being disappeared in view list of some view in screen, timely cancel corresponding with the view Asynchronous task, save consumption of the program to system resource.And the number of asynchronous task is kept to be less than or equal to the view of screen View number in list.
Step 208, asynchronous task is re-created, picture to be downloaded is downloaded by the asynchronous task newly created, to treat down The URL of the picture of load is key, and the asynchronous task newly created is value, by the asynchronous task newly created preservation in the buffer, The URL of picture to be downloaded is recorded in view.
In a particular embodiment of the present invention, the number of asynchronous task is depended in the view list of the screen of intelligent terminal Comprising view number.M view is included in the view list of the screen of intelligent terminal;The asynchronous task preserved in then caching Number is less than or equal to M, wherein, M is positive integer.
In other embodiments of the invention, it can be adjusted, reached by the view list of the screen to intelligent terminal To the purpose of adjustment asynchronous task number.
Fig. 3 is the system structure diagram of Asynchronous loading picture in a kind of intelligent terminal in the present invention in embodiment.Such as Shown in Fig. 3, the system includes:View acquiring unit 301, judging unit 302, processing unit 303 and asynchronous task creating unit 304。
View acquiring unit 301, for according to picture to be downloaded, being obtained from the view list of the screen of intelligent terminal View corresponding with picture to be downloaded, instruction judging unit 302 are judged view;
Judging unit 302, for judging whether the view indicated by view acquiring unit 301 is empty;
Processing unit 303, in the case of judging view to be empty in judging unit 302, created by asynchronous task single Member 304 creates asynchronous task, downloads picture to be downloaded by the asynchronous task of establishment, judges view not in judging unit 302 In the case of sky, obtain the URL in view, searched according to URL from caching corresponding to asynchronous task, discharge the asynchronous of acquisition The resource that task takes, key and value corresponding to removal asynchronous task, passes through the weight of asynchronous task creating unit 304 in the buffer It is new to create asynchronous task, picture to be downloaded is downloaded by the asynchronous task newly created.
Asynchronous task creating unit 304, for creating asynchronous task, using the URL of picture to be downloaded as key, asynchronous It is engaged in as value, asynchronous task is preserved in the buffer, records the URL of picture to be downloaded in the view.
In an embodiment of the present invention, view acquiring unit 301, regarded for receiving slip in the screen of intelligent terminal After Figure List operation, when all or part of view in the view list skids off screen, from the screen view list of intelligent terminal It is middle to obtain the view for skidding off screen, view corresponding with picture to be downloaded is used as using the view.
In an embodiment of the present invention, judging unit 302, for being obtained and figure to be downloaded by obtaining view interface View corresponding to piece, judge whether accessed view is empty in view interface is obtained.
In an embodiment of the present invention, asynchronous task creating unit 304, the view for the label in view are held The URL of picture to be downloaded is recorded in the URL attribute of adapter.
In an embodiment of the present invention, processing unit 303, adaptation is held for obtaining the view of label of view Device, find view and hold URL attribute in adapter, take out the URL recorded in URL attribute.
In an embodiment of the present invention, asynchronous task creating unit 304, the view for the screen in intelligent terminal In the case of including M view in list, the number of the asynchronous task preserved in the buffer is less than or equal to M, wherein, M is just whole Number.
In an embodiment of the present invention, processing unit 303, the resource that the asynchronous task for being obtained in release takes Before, judge whether the download of asynchronous task is completed, if it is not complete, then stopping the down operation of asynchronous task.
In summary, in the inventive solutions, the view according to picture to be downloaded from the screen of intelligent terminal View corresponding with the picture to be downloaded is obtained in list, whether the view for first judging to get is empty, if sky, is then created Asynchronous task is built, picture to be downloaded is downloaded by the asynchronous task of establishment, if being not sky, according to URL in view from caching Asynchronous task corresponding to middle lookup, the resource that the asynchronous task of acquisition takes is discharged, is removed in the buffer corresponding to asynchronous task Key and value, just creates asynchronous task afterwards, and picture to be downloaded is downloaded by the asynchronous task of establishment.
So ensure the number for the view that the asynchronous task in intelligent terminal caching will not be more than in the view list of screen, So that when view is when invisible on screen, it can timely cancel asynchronous task corresponding with the view, discharge this asynchronous The system resource for occupancy of being engaged in, the system resource of release to be used for the down operation of other pictures to be downloaded.
Thereby, it is possible to solve in the prior art because asynchronous task is excessive and caused by operation easily error, occupancy system The excessive technical problem of resource, the beneficial effect achieve and reduce operation error probability, saved system resource in intelligent terminal.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent substitution and improvements made within the spirit and principles in the present invention etc., are all contained in protection scope of the present invention It is interior.

Claims (9)

1. a kind of method of Asynchronous loading picture in intelligent terminal, it is characterised in that this method includes:
The position for needing to show on the screen of intelligent terminal according to picture to be downloaded, from the view row of the screen of intelligent terminal View corresponding with the picture to be downloaded is obtained in table, judges whether the view is empty;
If the view is sky, asynchronous task is created, the picture to be downloaded is downloaded by the asynchronous task of establishment, with The URL of the picture to be downloaded is key, and the asynchronous task is value, by asynchronous task preservation in the buffer, The URL of the picture to be downloaded is recorded in the view;The view is that sky refers in the view without corresponding to be downloaded Picture or corresponding picture to be downloaded do not start to download;
If the view is not sky, obtain the URL in the view, searched according to the URL from caching corresponding to it is different Step task, the resource that the asynchronous task of acquisition takes is discharged, removes key and value corresponding to the asynchronous task in the buffer, Asynchronous task is re-created, the picture to be downloaded is downloaded by the asynchronous task newly created, with the picture to be downloaded URL be key, the asynchronous task of the new establishment is value, by the asynchronous task of the new establishment preserve in the buffer, The URL of the picture to be downloaded is recorded in the view;
Wherein, after the screen of intelligent terminal receives slip view list operation, all or part of view in the view list It is described that view tool corresponding with the picture to be downloaded is obtained from the view list of the screen of intelligent terminal when skidding off screen Body includes:
Obtained from the screen view list of intelligent terminal and skid off the view of screen, using the view as with the figure to be downloaded View corresponding to piece.
2. according to the method for claim 1, it is characterised in that described to judge in the view whether be that sky specifically includes:
View corresponding with the picture to be downloaded is obtained by obtaining view interface, judges institute in view interface in described obtain Whether the view got is empty.
3. according to the method any one of claim 1-2, it is characterised in that described to be treated in the view described in record The URL of the picture of download includes:
The URL of the picture to be downloaded is recorded in the view of the label of the view holds the URL attribute of adapter.
4. according to the method for claim 3, it is characterised in that the view is not sky, then obtains the URL in the view Specifically include:
The view for obtaining the label of the view holds adapter, finds the view and holds URL attribute in adapter, takes out The URL recorded in URL attribute.
5. according to the method for claim 1, it is characterised in that M is included in the view list of the screen of the intelligent terminal Individual view;The number of the asynchronous task preserved in then caching is less than or equal to M, wherein, M is positive integer.
6. according to the method for claim 1, it is characterised in that
Also include before the resource that the asynchronous task that the release obtains takes:
Judge whether the download of the asynchronous task is completed, if it is not complete, then stopping the down operation of the asynchronous task.
7. the system of Asynchronous loading picture in a kind of intelligent terminal, it is characterised in that the system includes:View acquiring unit, sentence Disconnected unit, processing unit and asynchronous task creating unit;
The view acquiring unit, for the position for needing to show on the screen of intelligent terminal according to picture to be downloaded, from View corresponding with the picture to be downloaded is obtained in the view list of the screen of intelligent terminal, instruction judging unit is to described View is judged;
The judging unit, for judging whether the view indicated by view acquiring unit is empty;
The processing unit, in the case of judging view to be empty in judging unit, pass through the asynchronous task creating unit Asynchronous task is created, the picture to be downloaded is downloaded by the asynchronous task of establishment;The view is that sky refers in the view Do not start to download without corresponding picture to be downloaded or corresponding picture to be downloaded;View is judged not to be empty in judging unit In the case of, obtain the URL in the view, searched according to the URL from caching corresponding to asynchronous task, discharge the different of acquisition The resource that step task takes, removes key and value corresponding to the asynchronous task, is created by the asynchronous task in the buffer Build unit and re-create asynchronous task, the picture to be downloaded is downloaded by the asynchronous task newly created;
The asynchronous task creating unit, it is described different using the URL of the picture to be downloaded as key for creating asynchronous task Step task is value, and the asynchronous task is preserved in the buffer, the picture to be downloaded is recorded in the view URL;
Wherein, the view acquiring unit, for the screen of intelligent terminal receive slide view list operation after, the view When all or part of view in list skids off screen, obtained from the screen view list of intelligent terminal and skid off regarding for screen Figure, view corresponding with picture to be downloaded is used as using the view.
8. system according to claim 7, it is characterised in that
The judging unit, for obtaining view corresponding with the picture to be downloaded by obtaining view interface, obtained described Take and judge whether accessed view is empty in view interface.
9. system according to claim 8, it is characterised in that
The asynchronous task creating unit, the view for the label in view are held under record is treated in the URL attribute of adapter Carry the URL of picture;
The processing unit, hold adapter for obtaining the view of label of view, find the view and hold adapter Middle URL attribute, take out the URL recorded in URL attribute.
CN201310263700.5A 2013-06-27 2013-06-27 The method and system of Asynchronous loading picture in a kind of intelligent terminal Active CN104252367B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310263700.5A CN104252367B (en) 2013-06-27 2013-06-27 The method and system of Asynchronous loading picture in a kind of intelligent terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310263700.5A CN104252367B (en) 2013-06-27 2013-06-27 The method and system of Asynchronous loading picture in a kind of intelligent terminal

Publications (2)

Publication Number Publication Date
CN104252367A CN104252367A (en) 2014-12-31
CN104252367B true CN104252367B (en) 2017-12-19

Family

ID=52187308

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310263700.5A Active CN104252367B (en) 2013-06-27 2013-06-27 The method and system of Asynchronous loading picture in a kind of intelligent terminal

Country Status (1)

Country Link
CN (1) CN104252367B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357650B (en) * 2017-06-06 2020-12-15 武汉斗鱼网络科技有限公司 Automatic memory release method and system based on picture resources

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101794567A (en) * 2010-02-10 2010-08-04 中兴通讯股份有限公司 Method and terminal for loading pictures
CN102520918A (en) * 2011-09-27 2012-06-27 深圳市五巨科技有限公司 Method and device for increasing list refreshing frequency
CN102541538A (en) * 2011-12-06 2012-07-04 Tcl集团股份有限公司 Picture displaying method and device based on mobile terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100640491B1 (en) * 2003-12-08 2006-10-30 삼성전자주식회사 Apparatus and method for downloading picture

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101794567A (en) * 2010-02-10 2010-08-04 中兴通讯股份有限公司 Method and terminal for loading pictures
CN102520918A (en) * 2011-09-27 2012-06-27 深圳市五巨科技有限公司 Method and device for increasing list refreshing frequency
CN102541538A (en) * 2011-12-06 2012-07-04 Tcl集团股份有限公司 Picture displaying method and device based on mobile terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
iOS开发UITableView加载图片的内存管理;黄天柱 等;《计算机系统应用》;20120930;第21卷(第9期);第115页第1列第1行-第2列第21行,第116页第1列第20行-第117页第1列倒数第8行 *

Also Published As

Publication number Publication date
CN104252367A (en) 2014-12-31

Similar Documents

Publication Publication Date Title
US9696981B2 (en) Incremental deployment of computer software program logic
CN109857548B (en) Storage space optimization method, storage space optimization device, computer equipment and storage medium
CN108108181A (en) The function renewal method, apparatus and computer readable storage medium of application program
US20070074201A1 (en) Method and system for updating software and computer readable recording medium storing the method
WO2018076755A1 (en) Method and apparatus for issuing upgrade package
CN103942067B (en) Smart machine clears up the method and device of software installation APMB package automatically
CN105871587A (en) Log uploading method and device
CN103997544A (en) Resource downloading method and device
CN106155745A (en) The upgrade method of basic input output system, device and system
CN104424333A (en) Method and system for loading table data
CN106886422A (en) Method for upgrading software and device, electronic equipment
CN104408201A (en) Junk file cleaning method and device
CN108897559A (en) System and method are realized in a kind of software upgrading under Network Isolation
CN104793981B (en) A kind of online snapshot management method and device of cluster virtual machine
US20120317039A1 (en) On-demand purchase of virtual image licenses in a cloud computing environment
CN109558145A (en) Installation package volume optimization method and device for android application
CN113741923A (en) Application updating method, device, equipment and medium
CN104252367B (en) The method and system of Asynchronous loading picture in a kind of intelligent terminal
CN113360282B (en) Task management method and device, electronic equipment and storage medium
CN106201490A (en) The method and device that a kind of optimization application is run
CN112925622A (en) System timing task processing method and device, electronic equipment and storage medium
US10235153B2 (en) Downloading data into distant equipment
CN109388770B (en) Web page generation method and device
US20040148597A1 (en) System for optimizing distribution of information employing a universal dictionary
CN109901849A (en) Application program installation method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder

Address after: Room 810, 8 / F, 34 Haidian Street, Haidian District, Beijing 100080

Patentee after: BEIJING D-MEDIA COMMUNICATION TECHNOLOGY Co.,Ltd.

Address before: 100089 Beijing city Haidian District wanquanzhuang Road No. 28 Wanliu new building 6 storey block A room 602

Patentee before: BEIJING D-MEDIA COMMUNICATION TECHNOLOGY Co.,Ltd.

CP02 Change in the address of a patent holder