CN104423996B - View method for refreshing and device - Google Patents
View method for refreshing and device Download PDFInfo
- Publication number
- CN104423996B CN104423996B CN201310398862.XA CN201310398862A CN104423996B CN 104423996 B CN104423996 B CN 104423996B CN 201310398862 A CN201310398862 A CN 201310398862A CN 104423996 B CN104423996 B CN 104423996B
- Authority
- CN
- China
- Prior art keywords
- refresh
- data
- tasks
- refresh tasks
- view
- 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
Links
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present invention relates to a kind of view method for refreshing and devices.The method comprising the steps of: obtaining the refresh requests to list in view;The refresh tasks of the list are added in the queue pre-established according to the refresh requests;The refresh tasks are successively extracted from the queue using the thread of predetermined quantity to be loaded, the data for loading the refresh tasks are obtained, wherein the data of the refresh tasks of load are stored using weak reference;According to view described in the Refresh Data of the refresh tasks of load.Above-mentioned view method for refreshing and device, because the thread using predetermined quantity reduces the expense of each refresh tasks creation new thread, weak reference storing data can recycle the memory of occupancy at any time, reduce the occupancy of the system resources such as memory and CPU, so that page furbishing is smooth, and it ensure that the integrality of data using queue.
Description
Technical field
The present invention relates to net application technologies, more particularly to a kind of view method for refreshing and device.
Background technique
Because of the inadequate resource that mobile terminal has, degraded performance is mounted with application program on mobile terminals, it is necessary to consider
The occupied memory of application program and CPU(Central Processing Unit, central processing unit) utilization rate.It will apply
The icon of program by tabular form performance be it is a kind of it is common in a manner of.The every rolling a line of list need to carry out batch refresh to icon.
There are mainly three types of traditional refreshing modes: the first is that icon is directly loaded in main thread, and the reference of icon is not processed, and is write from memory
Recognize and uses strongly reference;Second is that one thread independent loads icon of unlatching, the reference of icon are not processed immediately, and default uses
Strongly reference;The third is using thread pool, and in the task independent loads icon that thread pool is added, the reference of icon is not processed,
Default uses strongly reference.Wherein, strongly reference refers to that object only just can in the case where no other application in Java language
It is recovered in the system.
However, inventor has found that above-mentioned three kinds of refreshing modes can make application program occupy CPU and memory
Etc. system resources rates it is high, cause refresh page Caton, and only can just recycle occupied resource in Installed System Memory deficiency.
Summary of the invention
Based on this, it is necessary to refresh occupying system resources height for traditional list, refresh page Caton problem provides one
Kind can reduce system resource occupancy and make the view method for refreshing of page furbishing smoothness.
In addition, there is a need to provide a kind of view refreshing that can be reduced system resource occupancy and make page furbishing smoothness
Device.
A kind of view method for refreshing, comprising steps of
Obtain the refresh requests to list in view;
The refresh tasks of the list are added in the queue pre-established according to the refresh requests;
The refresh tasks are successively extracted from the queue using the thread of predetermined quantity to be loaded, and load institute is obtained
State the data of refresh tasks, wherein the data of the refresh tasks of load are stored using weak reference;
According to view described in the Refresh Data of the refresh tasks of load.
A kind of view refreshing apparatus, comprising:
Request module, for obtaining the refresh requests to list in view;
Adding module, for the queue pre-established to be added in the refresh tasks of the list according to the refresh requests
In;
Loading module successively extracts the refresh tasks for the thread using predetermined quantity from the queue and is added
It carries, obtains the data for loading the refresh tasks, wherein the data of the refresh tasks of load are stored using weak reference;
Refresh module, for the view according to the Refresh Data of the refresh tasks of load.
Above-mentioned view method for refreshing and device extract the refresh tasks in queue using the thread of predetermined quantity and are added
It carries, obtains load data, then according to the Refresh Data view of load, and data are stored using weak reference, because using predetermined number
The thread of amount reduces the expense of each refresh tasks creation new thread, and weak reference storing data can recycle the interior of occupancy at any time
It deposits, reduces the occupancy of the system resources such as memory and CPU, so that page furbishing is smooth, and data ensure that using queue
Integrality.
Detailed description of the invention
Fig. 1 is the flow chart of view method for refreshing in one embodiment;
Fig. 2 is the flow chart of view method for refreshing in another embodiment;
Fig. 3 is the flow chart of view method for refreshing in another embodiment;
Fig. 4 is the structural block diagram of view refreshing apparatus in one embodiment;
Fig. 5 is the structural block diagram of view refreshing apparatus in another embodiment;
Fig. 6 is the internal structure block diagram of loading module;
Fig. 7 is the structural schematic diagram of view updating system in one embodiment.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
As shown in Figure 1, for the flow chart of view method for refreshing in one embodiment.The view method for refreshing is applied to movement
In terminal, the system resources such as memory and CPU can be occupied less.The mobile terminal can be mobile phone, personal digital assistant or palm
Computer etc..The view method for refreshing, comprising steps of
Step S102 obtains the refresh requests to list in view.
Specifically, can be generated by list in sliding view to the refresh requests of list in view, or roll in view
Scroll bar generate, or the list generation into assigned direction (such as to the left or to the right) mobile view.
The refresh tasks of the list are added in the queue pre-established according to the refresh requests by step S104.
Refresh tasks can be the icon for refreshing application program in view, perhaps refresh picture in view or refresh entire
View page etc..Refresh tasks are added in the queue pre-established to the integrality that can guarantee data, prevent loss of data.
Step S106 successively extracts the refresh tasks using the thread of predetermined quantity from the queue and is loaded, obtained
Load the data of the refresh tasks, wherein the data of the refresh tasks of load are stored using weak reference.
Thread is a kind of smaller unit of the process than in computer, and a process can possess multiple threads.The predetermined number
Amount may include 1,2 or 3 etc..In the present embodiment, refresh tasks are extracted simultaneously using 3 threads, it can by experimental data
Know using 3 threads while loading, highest efficiency can be reached, and can effectively control CPU and occupy high situation.Thread exists
It creates, terminates when the page of refresh tasks is destroyed, in the page when page initialization of each need refresh tasks to be loaded
During not destroying, thread is constantly in wait state.
Weak reference refers to that object is likely to be recovered in the system under any circumstance in Java.In the present embodiment, refreshes and appoint
Business is the icon for refreshing application program, and icon is stored in Map, can be recovered with guaranteeing icon at any time.
Step S108, according to the Refresh Data of the refresh tasks of the load view.
In the present embodiment, which is the icon for refreshing application program.Step S108 includes: being somebody's turn to do according to the load
The data of refresh tasks use the FindViewByTag Local hydrodynamic unit view.Specifically, pass through tag(icon) find it is corresponding
View(view), then refresh the view again.
Above-mentioned view method for refreshing extracts the refresh tasks in queue using the thread of predetermined quantity and is loaded, obtained
Data are loaded, then according to the Refresh Data view of load, and data are stored using weak reference, because of the thread using predetermined quantity
The expense of each refresh tasks creation new thread is reduced, weak reference storing data can recycle the memory of occupancy at any time, reduce
The occupancy of the system resources such as memory and CPU so that page furbishing is smooth, and ensure that the integrality of data using queue.
As shown in Fig. 2, for the flow chart of view method for refreshing in another embodiment.View method for refreshing in Fig. 2 with
The difference of Fig. 1 is: increasing the priority of the loading position of refresh tasks in Fig. 2, is added from high to low according to priority
It carries.The view method for refreshing includes:
Step S202 obtains the refresh requests to list in view.
The refresh tasks of the list are added in the queue pre-established according to the refresh requests by step S204.
Step S206, presets the priority of the loading position of refresh tasks, and memory, local peripheral hardware storage, cloud are deposited
The priority of storage gradually decreases.
Local peripheral hardware storage can be SD(Secure Digital Memory, safe digital card) card, cloud storage refers to remote
The storage of journey server.
Step S208 successively extracts the refresh tasks using the thread of predetermined quantity, according to loading position from the queue
Priority the refresh tasks are loaded from high to low, obtain the data for loading the refresh tasks, wherein the brush of load
The data of new task are stored using weak reference.
Specifically, identical data are found from memory first in the data of thread load refresh tasks, if not having,
Identical data then are searched from the storage of local peripheral hardware, if not having, continues the storage from cloud and downloads identical data.
Step S210, according to the Refresh Data of the refresh tasks of the load view.
Above-mentioned view method for refreshing obtains data when loading data out of memory first, if in the absence of memory, then from
Local peripheral hardware storage obtains, if local peripheral hardware storage is not present, finally obtains from the storage of cloud, deposits from memory and local peripheral hardware
Obtained in storage it is high-efficient, improve data load efficiency.
In addition, step S206 can be before step S202.
As shown in figure 3, for the flow chart of view method for refreshing in another embodiment.View method for refreshing in Fig. 3 with
The difference of Fig. 2 is: the initial position and rearmost position that data are loaded in refresh tasks are increased in Fig. 3.The view refreshing side
Method includes:
Step S302 obtains the refresh requests to list in view.
The refresh tasks of the list are added in the queue pre-established according to the refresh requests by step S304.
Step S306, presets the priority of the loading position of refresh tasks, and memory, local peripheral hardware storage, cloud are deposited
The priority of storage gradually decreases.
Step S308 successively extracts the refresh tasks using the thread of predetermined quantity from the queue, obtains refresh tasks
The initial position and rearmost position of middle load data, from high to low add the refresh tasks according to the priority of loading position
It carries, using the data between the initial position and rearmost position as the data for loading the refresh tasks, wherein the refreshing of load
The data of task are stored using weak reference.
Specifically, existing in detection view in the operating system (such as Android system) of mobile terminal data position
Interface can monitor sliding time by the interface, the starting of load needed for calculating the data of refresh tasks further according to sliding time
Position and rearmost position.
Step S310, according to the Refresh Data of the refresh tasks of the load view.
Above-mentioned view method for refreshing only loads the data of initial position and rearmost position, to the number for being not required to show in screen
According to being not required to be loaded, reduce load data volume, saves the expense of system resource.
In other embodiments, the difference with the view method for refreshing in Fig. 3 is:
The acquisition to include: the step of the refresh requests of list in view obtain in view list carry out slide production
Raw refresh requests.
The step of initial position of data is loaded in the acquisition refresh tasks includes: to detect slide stopping
When, using the initial position of place page when stopping as the initial position for loading data in the refresh tasks.
Specifically, for quick sliding in view data without load, sliding stop after just being loaded, such energy
Load hash is avoided, unnecessary data load consumption is reduced.The data can be the icon of application program or, view
In picture or text etc..
In other embodiments, the difference with the view method for refreshing in Fig. 1 is, step S106 includes: using predetermined
The thread of quantity successively extracts the refresh tasks from the queue, obtain in the refresh tasks load data initial position and
Rearmost position;Using the data between the initial position and rearmost position as the data for loading the refresh tasks.
As shown in figure 4, for the structural block diagram of view refreshing apparatus in one embodiment.The view refreshing apparatus is applied to move
In dynamic terminal, the system resources such as less memory and CPU can be occupied.The mobile terminal can be mobile phone, personal digital assistant or the palm
Upper computer etc..The view refreshing apparatus, including request module 420, adding module 440, loading module 460 and refresh module
480。
Wherein, request module 420 is used to obtain the refresh requests to list in view.
Specifically, can be generated by list in sliding view to the refresh requests of list in view, or roll in view
Scroll bar generate, or the list generation into assigned direction (such as to the left or to the right) mobile view.
Adding module 440 is used to that the refresh tasks of the list to be added in the queue pre-established according to the refresh requests.
Refresh tasks can be the icon for refreshing application program in view, perhaps refresh picture in view or refresh entire
View page etc..Refresh tasks are added in the queue pre-established to the integrality that can guarantee data, prevent loss of data.
Loading module 460, which is used to successively extract the refresh tasks from the queue using the thread of predetermined quantity, to be added
It carries, obtains the data for loading the refresh tasks, wherein the data of the refresh tasks are stored using weak reference.
Thread is a kind of smaller unit of the process than in computer, and a process can possess multiple threads.The predetermined number
Amount may include 1,2 or 3 etc..In the present embodiment, refresh tasks are extracted simultaneously using 3 threads, it can by experimental data
Know using 3 threads while loading, highest efficiency can be reached, and can effectively control CPU and occupy high situation.Thread exists
It creates, terminates when the page of refresh tasks is destroyed, in the page when page initialization of each need refresh tasks to be loaded
During not destroying, thread is constantly in wait state.
Weak reference refers to that object is likely to be recovered in the system under any circumstance in Java.In the present embodiment, refreshes and appoint
Business is the icon for refreshing application program, and icon is stored in Map, can be recovered with guaranteeing icon at any time.
Refresh module 480 is used for according to the Refresh Data of the refresh tasks of the load view.
In the present embodiment, which is the icon for refreshing application program.Refresh module 480 is also used to according to the load
The refresh tasks data use the FindViewByTag Local hydrodynamic unit view.Specifically, passing through tag(icon) it finds pair
The view(view answered), then refresh the view again.
Above-mentioned view refreshing apparatus extracts the refresh tasks in queue using the thread of predetermined quantity and is loaded, obtained
Data are loaded, then according to the Refresh Data view of load, and data are stored using weak reference, because of the thread using predetermined quantity
The expense of each refresh tasks creation new thread is reduced, weak reference storing data can recycle the memory of occupancy at any time, reduce
The occupancy of the system resources such as memory and CPU so that page furbishing is smooth, and ensure that the integrality of data using queue.
As shown in figure 5, for the structural block diagram of view refreshing apparatus in another embodiment.The view refreshing apparatus, in addition to
It further include priority presetting module including request module 420, adding module 440, loading module 460 and refresh module 480
450。
Wherein, priority presetting module 450 is used to preset the priority of the loading position of refresh tasks, memory, sheet
The priority that the storage of ground peripheral hardware, cloud store gradually decreases.Local peripheral hardware storage can be SD card, and cloud storage refers to remote service
Device storage.
The loading module 460 is also used to successively extract the refresh tasks from the queue using the thread of predetermined quantity, presses
The refresh tasks are loaded from high to low according to the priority of loading position, obtain the data for loading the refresh tasks.Specifically
, in the data of thread load refresh tasks, identical data are found from memory first, if not having, from local peripheral hardware
Identical data are searched in storage, if not having, are continued the storage from cloud and are downloaded identical data.
As shown in fig. 6, the loading module 460 includes position determination unit 462 and data capture unit 464.
Wherein, position determination unit 462 is used to successively be extracted the refreshing from the queue using the thread of predetermined quantity and be appointed
Business obtains the initial position and rearmost position that data are loaded in the refresh tasks.
Specifically, existing in detection view in the operating system (such as Android system) of mobile terminal data position
Interface can monitor sliding time by the interface, the starting of load needed for calculating the data of refresh tasks further according to sliding time
Position and rearmost position.
Data capture unit 464 is used for using the data between the initial position and rearmost position as the load refresh tasks
Data.
Above-mentioned view method for refreshing only loads the data of initial position and rearmost position, to the number for being not required to show in screen
According to being not required to be loaded, reduce load data volume, saves the expense of system resource.
Further, which is also used to obtain the brush that slide generation is carried out to list in view
New request.
The position determination unit 462 is also used to when detecting that the slide stops, by of place page when stopping
Beginning, position was as the initial position for loading data in the refresh tasks.
Specifically, for quick sliding in view data without load, sliding stop after just being loaded, such energy
Load hash is avoided, unnecessary data load consumption is reduced.The data can be the icon of application program or, view
In picture or text etc..
In addition, data capture unit 464 be also used to according to loading position priority from high to low to the refresh tasks into
Row load, using the data between the initial position and rearmost position as the data for loading the refresh tasks, wherein load is somebody's turn to do
The data of refresh tasks are stored using weak reference.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium
In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
The embodiment of the invention also provides another view updating systems, as shown in fig. 7, for ease of description, only showing
Part related to the embodiment of the present invention, it is disclosed by specific technical details, please refer to present invention method part.It should
Terminal can be include mobile phone, tablet computer, PDA(Personal Digital Assistant, personal digital assistant), POS
Any terminal device such as (Point of Sales, point-of-sale terminal), vehicle-mounted computer, taking the terminal as an example:
Fig. 7 shows the block diagram of the part-structure of mobile phone relevant to terminal provided in an embodiment of the present invention.With reference to figure
7, mobile phone includes: radio frequency (Radio Frequency, RF) circuit 1110, memory 1120, input unit 1130, display unit
1140, sensor 1150, voicefrequency circuit 1160, Wireless Fidelity (wireless fidelity, WiFi) module 1170, processor
The components such as 1180 and power supply 1190.It will be understood by those skilled in the art that handset structure shown in Fig. 7 is not constituted pair
The restriction of mobile phone may include perhaps combining certain components or different component cloth than illustrating more or fewer components
It sets.
It is specifically introduced below with reference to each component parts of the Fig. 7 to mobile phone:
RF circuit 1110 can be used for receiving and sending messages or communication process in, signal sends and receivees, particularly, by base station
After downlink information receives, handled to processor 1180;In addition, the data for designing uplink are sent to base station.In general, RF circuit packet
Include but be not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier (Low Noise
Amplifier, LNA), duplexer etc..In addition, RF circuit 110 can also be communicated with network and other equipment by wireless communication.
Any communication standard or agreement, including but not limited to global system for mobile communications (Global can be used in above-mentioned wireless communication
System of Mobile communication, GSM), general packet radio service (General Packet Radio
Service, GPRS), CDMA (Code Division Multiple Access, CDMA), wideband code division multiple access
(Wideband Code Division Multiple Access, WCDMA), long term evolution (Long Term Evolution,
LTE)), Email, short message service (Short Messaging Service, SMS) etc..
Memory 1120 can be used for storing software program and module, and processor 1180 is stored in memory by operation
1120 software program and module, thereby executing the various function application and data processing of mobile phone.Memory 1120 can be led
It to include storing program area and storage data area, wherein storing program area can be needed for storage program area, at least one function
Application program (such as sound-playing function, image player function etc.) etc.;Storage data area, which can be stored, uses institute according to mobile phone
Data (such as audio data, phone directory etc.) of creation etc..In addition, memory 1120 may include high random access storage
Device, can also include nonvolatile memory, and a for example, at least disk memory, flush memory device or other volatibility are solid
State memory device.
Input unit 1130 can be used for receiving the number or character information of input, and generates and set with the user of mobile phone 1100
It sets and the related key signals of function control inputs.Specifically, input unit 1130 may include touch panel 1131 and other
Input equipment 1132.Touch panel 1131, also referred to as touch screen, collect user on it or nearby touch operation (such as
User is using any suitable objects or attachment such as finger, stylus on touch panel 1131 or near touch panel 1131
Operation), and corresponding attachment device is driven according to preset formula.Optionally, touch panel 1131 may include touching inspection
Survey two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation
Bring signal, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and will
It is converted into contact coordinate, then gives processor 1180, and can receive order that processor 1180 is sent and be executed.This
Outside, touch panel 1131 can be realized using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touching
Panel 1131 is controlled, input unit 1130 can also include other input equipments 1132.Specifically, other input equipments 1132 can be with
Including but not limited to physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating stick etc.
One of or it is a variety of.
Display unit 1140 can be used for showing information input by user or be supplied to user information and mobile phone it is each
Kind menu.Display unit 1140 may include display panel 1141, optionally, can use liquid crystal display (Liquid
Crystal Display, LCD), the forms such as Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED)
To configure display panel 1141.Further, touch panel 1131 can cover display panel 1141, when touch panel 1131 detects
After arriving touch operation on it or nearby, processor 1180 is sent to determine the type of touch event, is followed by subsequent processing device
1180 provide corresponding visual output according to the type of touch event on display panel 1141.Although in Fig. 7, touch panel
1131 and display panel 1141 are the input and input function for realizing mobile phone as two independent components, but in certain realities
Apply in example, can be integrated by touch panel 1131 and display panel 1141 and that realizes mobile phone output and input function.
Mobile phone 1100 may also include at least one sensor 1150, such as optical sensor, motion sensor and other biographies
Sensor.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to ring
The light and shade of border light adjusts the brightness of display panel 1141, and proximity sensor can close display when mobile phone is moved in one's ear
Panel 1141 and/or backlight.As a kind of motion sensor, accelerometer sensor can detect (generally three in all directions
Axis) acceleration size, can detect that size and the direction of gravity when static, can be used to identify mobile phone posture application (such as
Horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, tap) etc.;As for
The other sensors such as gyroscope, barometer, hygrometer, thermometer, infrared sensor that mobile phone can also configure, it is no longer superfluous herein
It states.
Voicefrequency circuit 1160, loudspeaker 1161, microphone 1162 can provide the audio interface between user and mobile phone.Audio
Electric signal after the audio data received conversion can be transferred to loudspeaker 1161, be converted by loudspeaker 1161 by circuit 1160
For voice signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 1162, by voicefrequency circuit 1160
Audio data is converted to after reception, then by after the processing of audio data output processor 1180, through RF circuit 1110 to be sent to ratio
Such as another mobile phone, or audio data is exported to memory 1120 to be further processed.
WiFi belongs to short range wireless transmission technology, and mobile phone can help user's transceiver electronics postal by WiFi module 1170
Part, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 7 is shown
WiFi module 1170, but it is understood that, and it is not belonging to must be configured into for mobile phone 1100, it can according to need completely
Do not change in the range of the essence of invention and omits.
Processor 1180 is the control centre of mobile phone, using the various pieces of various interfaces and connection whole mobile phone,
By running or execute the software program and/or module that are stored in memory 1120, and calls and be stored in memory 1120
Interior data execute the various functions and processing data of mobile phone, to carry out integral monitoring to mobile phone.Optionally, processor
1180 may include one or more processing units;Preferably, processor 1180 can integrate application processor and modulation /demodulation processing
Device, wherein the main processing operation system of application processor, user interface and application program etc., modem processor is mainly located
Reason wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 1180.
Mobile phone 1100 further includes the power supply 1190(such as battery powered to all parts), it is preferred that power supply can pass through
Power-supply management system and processor 1180 are logically contiguous, to realize management charging, electric discharge, Yi Jigong by power-supply management system
The functions such as consumption management.
Although being not shown, mobile phone 1100 can also include camera, bluetooth module etc., and details are not described herein.
In embodiments of the present invention, processor 1180 included by the terminal is also with the following functions:
The processor executes a kind of view method for refreshing, comprising steps of
Obtain the refresh requests to list in view;
The refresh tasks of the list are added in the queue pre-established according to the refresh requests;
The refresh tasks are successively extracted from the queue using the thread of predetermined quantity to be loaded, and load institute is obtained
State the data of refresh tasks, wherein the data of the refresh tasks of load are stored using weak reference;
According to view described in the Refresh Data of the refresh tasks of load.
The refresh tasks are the icon for refreshing application program in one of the embodiments,;
The step of view where the list according to the Refresh Data of the refresh tasks of load includes:
According to the data of the refresh tasks of the load using view described in FindViewByTag Local hydrodynamic unit.
The brush is successively extracted from the queue in the thread using predetermined quantity in one of the embodiments,
New task is loaded, before obtaining the step of loading the data of the refresh tasks, further includes:
Preset the priority of the loading position of refresh tasks, the priority that memory, local peripheral hardware storage, cloud store
It gradually decreases;
The thread using predetermined quantity successively extracts the refresh tasks from the queue and is loaded, and is added
The step of carrying the data of the refresh tasks include:
The refresh tasks are successively extracted from the queue using the thread of predetermined quantity, according to the preferential of loading position
Grade from high to low loads the refresh tasks, obtains the data for loading the refresh tasks.
The thread using predetermined quantity successively extracts the refreshing from the queue in one of the embodiments,
Task is loaded, and is obtained the step of loading the data of the refresh tasks and is included:
The refresh tasks are successively extracted from the queue using the thread of predetermined quantity, are obtained in the refresh tasks
Load the initial position and rearmost position of data;
Using the data between the initial position and rearmost position as the data for loading the refresh tasks.
It is described in one of the embodiments, to obtain to including: the step of the refresh requests of list in view
Obtain the refresh requests that slide generation is carried out to list in view;
The step of initial position of load data, includes: in the acquisition refresh tasks
When detecting that the slide stops, using the initial position of place page when stopping as the refresh tasks
The initial position of middle load data.
The thread of the predetermined quantity includes 1,2 or 3 in one of the embodiments,.
The embodiments described above only express several embodiments of the present invention, and the description thereof is more specific and detailed, but simultaneously
Limitations on the scope of the patent of the present invention therefore cannot be interpreted as.It should be pointed out that for those of ordinary skill in the art
For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to guarantor of the invention
Protect range.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.
Claims (10)
1. a kind of view method for refreshing, comprising steps of
Obtain the refresh requests to list in view;
The refresh tasks of the list are added in the queue pre-established according to the refresh requests;
The refresh tasks are successively extracted from the queue using the thread of predetermined quantity to be loaded, and obtain loading the brush
The data of new task, wherein the data of the refresh tasks of load are stored using weak reference, and the thread is appointed in described refresh
It creates when the page initialization of business, terminates when the page of refresh tasks is destroyed;
According to view described in the Refresh Data of the refresh tasks of load.
2. the method according to claim 1, wherein the refresh tasks are the icon for refreshing application program;
The step of view where the list according to the Refresh Data of the refresh tasks of load includes:
According to the data of the refresh tasks of the load using view described in FindViewByTag Local hydrodynamic unit.
3. the method according to claim 1, wherein in the thread using predetermined quantity from the queue
It successively extracts the refresh tasks to be loaded, before obtaining the step of loading the data of the refresh tasks, further includes:
The priority of the loading position of refresh tasks is preset, the priority that memory, local peripheral hardware storage, cloud store is gradually
It reduces;
The thread using predetermined quantity successively extracts the refresh tasks from the queue and is loaded, and obtains load institute
The step of stating the data of refresh tasks include:
The refresh tasks are successively extracted from the queue using the thread of predetermined quantity, according to loading position priority from
It is high to Low that the refresh tasks are loaded, obtain the data for loading the refresh tasks.
4. the method according to claim 1, wherein the thread using predetermined quantity from the queue according to
Secondary to extract the refresh tasks and loaded, obtaining the step of loading the data of the refresh tasks includes:
The refresh tasks are successively extracted from the queue using the thread of predetermined quantity, obtains and is loaded in the refresh tasks
The initial position and rearmost position of data;
Using the data between the initial position and rearmost position as the data for loading the refresh tasks.
5. according to the method described in claim 4, it is characterized in that, described obtain in view the step of the refresh requests of list
Include:
Obtain the refresh requests that slide generation is carried out to list in view;
The step of initial position of load data, includes: in the acquisition refresh tasks
When detecting that the slide stops, the initial position of place page when stopping is added as in the refresh tasks
Carry the initial position of data.
6. a kind of view refreshing apparatus characterized by comprising
Request module, for obtaining the refresh requests to list in view;
Adding module, for the refresh tasks of the list to be added in the queue pre-established according to the refresh requests;
Loading module successively extracts the refresh tasks for the thread using predetermined quantity from the queue and is loaded,
Obtain loading the data of the refresh tasks, wherein the data of the refresh tasks of load are stored using weak reference, the line
Journey is created in the page initialization of the refresh tasks, is terminated when the page of refresh tasks is destroyed;
Refresh module, for the view according to the Refresh Data of the refresh tasks of load.
7. device according to claim 6, which is characterized in that the refresh tasks are the icon for refreshing application program;
The refresh module is also used to locally be brushed according to the data of the refresh tasks of the load using FindViewByTag
The new view.
8. device according to claim 6, which is characterized in that described device further include:
Priority presetting module, the priority of the loading position for presetting refresh tasks, memory, the storage of local peripheral hardware,
The priority of cloud storage gradually decreases;
The loading module is also used to successively extract the refresh tasks from the queue using the thread of predetermined quantity, according to
The priority of loading position from high to low loads the refresh tasks, obtains the data for loading the refresh tasks.
9. device according to claim 6, which is characterized in that the loading module includes:
Position determination unit is obtained for successively extracting the refresh tasks from the queue using the thread of predetermined quantity
The initial position and rearmost position of data are loaded in the refresh tasks;
Data capture unit, for using the data between the initial position and rearmost position as the load refresh tasks
Data.
10. device according to claim 9, which is characterized in that the request module is also used to obtain in view
The refresh requests of list progress slide generation;
The position determination unit is also used to when detecting that the slide stops, by the start bit of place page when stopping
It sets as the initial position for loading data in the refresh tasks.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310398862.XA CN104423996B (en) | 2013-09-04 | 2013-09-04 | View method for refreshing and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310398862.XA CN104423996B (en) | 2013-09-04 | 2013-09-04 | View method for refreshing and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104423996A CN104423996A (en) | 2015-03-18 |
CN104423996B true CN104423996B (en) | 2019-02-01 |
Family
ID=52973076
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310398862.XA Active CN104423996B (en) | 2013-09-04 | 2013-09-04 | View method for refreshing and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104423996B (en) |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106933482A (en) * | 2015-12-30 | 2017-07-07 | 百度在线网络技术(北京)有限公司 | A kind of method and apparatus for switching object |
CN105760231B (en) * | 2016-02-19 | 2019-04-16 | 珠海迈科智能科技股份有限公司 | One kind being based on Embedded Internet resources preview management method |
CN105975355B (en) * | 2016-05-24 | 2019-06-25 | 四川苏格通讯技术有限公司 | A kind of drawing practice, device and mobile device |
CN106598725A (en) * | 2016-10-31 | 2017-04-26 | 武汉斗鱼网络科技有限公司 | Android-based Handler memory leakage prevention device and method |
CN107015866B (en) * | 2017-03-23 | 2022-05-06 | 腾讯科技(深圳)有限公司 | Data processing method and device |
WO2019071626A1 (en) * | 2017-10-09 | 2019-04-18 | 华为技术有限公司 | Method for processing refreshing display abnormality, and terminal |
CN110162385B (en) * | 2018-02-14 | 2023-07-04 | 微软技术许可有限责任公司 | Processing framework capable of dynamically refreshing memory objects |
CN110472168B (en) * | 2019-07-05 | 2024-07-05 | 中国平安财产保险股份有限公司 | Page data updating method and device, computer equipment and storage medium |
CN111782326A (en) * | 2020-06-30 | 2020-10-16 | 北京字节跳动网络技术有限公司 | Method and device for controlling page refreshing, computer equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102385510A (en) * | 2010-09-06 | 2012-03-21 | 上海可鲁系统软件有限公司 | Interface refreshing method of graphical user interface based on different development tools |
CN102541605A (en) * | 2011-12-30 | 2012-07-04 | Tcl集团股份有限公司 | Method and device for picture loading based on Android system |
CN102591721A (en) * | 2011-12-30 | 2012-07-18 | 北京新媒传信科技有限公司 | Method and system for distributing thread execution task |
CN102750180A (en) * | 2012-05-28 | 2012-10-24 | 中国科学院遥感应用研究所 | Multithreading display mechanism of two-dimensional map tiles |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8784906B2 (en) * | 2011-04-14 | 2014-07-22 | Darlene Gaynor-Krupnick | Organic lubricant |
-
2013
- 2013-09-04 CN CN201310398862.XA patent/CN104423996B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102385510A (en) * | 2010-09-06 | 2012-03-21 | 上海可鲁系统软件有限公司 | Interface refreshing method of graphical user interface based on different development tools |
CN102541605A (en) * | 2011-12-30 | 2012-07-04 | Tcl集团股份有限公司 | Method and device for picture loading based on Android system |
CN102591721A (en) * | 2011-12-30 | 2012-07-18 | 北京新媒传信科技有限公司 | Method and system for distributing thread execution task |
CN102750180A (en) * | 2012-05-28 | 2012-10-24 | 中国科学院遥感应用研究所 | Multithreading display mechanism of two-dimensional map tiles |
Also Published As
Publication number | Publication date |
---|---|
CN104423996A (en) | 2015-03-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104423996B (en) | View method for refreshing and device | |
CN107391259B (en) | Resource processing method and device, computer readable storage medium and mobile terminal | |
CN105786878B (en) | Display method and device of browsing object | |
CN104252379B (en) | Picture thumbnail display packing and device | |
CN108205398B (en) | Method and device for adapting webpage animation to screen | |
CN106055408B (en) | A kind of application control method and mobile terminal | |
CN106293308B (en) | Screen unlocking method and device | |
CN107391198B (en) | Method for scheduling task and device, computer readable storage medium, mobile terminal | |
CN105975190B (en) | Graphical interface processing method, device and system | |
US20170097725A1 (en) | Device and method for starting mobile terminal application and mobile terminal | |
CN108834132B (en) | Data transmission method and equipment and related medium product | |
CN103473092A (en) | Method and device for processing downloaded applications and terminal equipment | |
CN104571787A (en) | Message display method and communication terminal | |
CN104238893A (en) | Video preview image displaying method and device | |
CN104407804A (en) | Screen capturing method and screen capturing device as well as electronic device | |
CN104123276A (en) | Method, device and system for intercepting popup windows in browser | |
CN104954233A (en) | Information push method, device and system | |
CN104572046A (en) | Method for restoring stacks and computer system | |
CN104077184A (en) | Progress control method of application program and computer system | |
CN103197944B (en) | Method for determining performance of process of application program and computer system | |
CN104901992B (en) | A kind of method and apparatus of resource transfers | |
CN105095259B (en) | Waterfall flow object display method and device | |
CN107423050A (en) | A kind of method and apparatus for penetrating operation | |
CN105631059B (en) | Data processing method, data processing device and data processing system | |
CN105320858B (en) | Method and device for rapidly displaying application icons |
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 |