CN105808447B - A kind of method for recovering internal storage and device of terminal device - Google Patents
A kind of method for recovering internal storage and device of terminal device Download PDFInfo
- Publication number
- CN105808447B CN105808447B CN201610188335.XA CN201610188335A CN105808447B CN 105808447 B CN105808447 B CN 105808447B CN 201610188335 A CN201610188335 A CN 201610188335A CN 105808447 B CN105808447 B CN 105808447B
- Authority
- CN
- China
- Prior art keywords
- interface
- stack
- interface stack
- pool
- applications
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0253—Garbage collection, i.e. reclamation of unreferenced memory
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention provides a kind of method for recovering internal storage of terminal device and devices, the terminal device is provided with one or more application collection of programs, application program in the pool of applications has a corresponding interface stack, and the interface stack is configured with corresponding memory when in operating status;The method include: when pool of applications by foreground changing interface to background interface when, record interface stack in operating status in the pool of applications;Interface stack to be recycled is determined in the interface stack;Recycle the memory that the interface stack to be recycled is configured.The embodiment of the present invention can discharge extra memory according to the switching of pool of applications, and free memory in increase system reduces Caton phenomenon caused by system recycling memory.
Description
Technical field
The present invention relates to field of terminal technology, method for recovering internal storage and a kind of terminal more particularly to a kind of terminal device
The Memory recycle device of equipment.
Background technique
Currently, embedded intelligence operating system is widely used in consumption electronic product, such as mobile phone, computer, TV etc.
Deng user can download in the product and install many application programs, to meet diversified use demand.
There is a Launcher (application launcher interface) in embedded intelligence operating system, application program is in Launcher
Application icon of the upper display for starting needs if user will open another application program after starting an application program
It returns to Launcher and finds another application icon and click and start, alternatively, the operation program listing by system interface is found separately
One application program run switches to click.
Aforesaid way is the product usage mode as unit of application program, and what user was perceived is individual one by one
Application program, using switching between each independent application program when product.However, such usage mode is relatively specific for electricity
The product of the closely operation such as smart phone of brain or similar computer, and the remote behaviour such as be poorly suitable for TV, set-top box
The product of work.
Presently, there are one kind, and the product in same application set can be aggregated to according to function, and this product can be more
Add user-friendly, and no longer needs to switch between each independent application program, and can pass through one key switching will
Application program moment in application program combination saves state and state of resuming operation.But this pool of applications makes
With process the problem is that: there are multiple pool of applications in pool of applications, if keeping this using journey simultaneously
The operating status of whole application programs in ordered sets, needs to expend a large amount of memory so that the Caton of Application Program Interface and
Slowly, a kind of take-back strategy in response to this is at present, when pool of applications is switched to background interface, immediately for response
The full memory in the pool of applications is recycled, if but the shortcomings that this way is that user wants to reopen the application program
Application program in set then needs to reload, and not only speed is slow but also state when running before and data can lose.Separately
Outside, when closing the application program in pool of applications, since application program has same priority, therefore when recycling memory
Fail to distinguish which application program is more important to user's meaning, and user experience effect is poor.
Summary of the invention
In view of the above problems, it proposes the embodiment of the present invention and overcomes the above problem or at least partly in order to provide one kind
A kind of method for recovering internal storage of the terminal device to solve the above problems and a kind of corresponding Memory recycle device of terminal device.
To solve the above-mentioned problems, the embodiment of the invention discloses a kind of method for recovering internal storage of terminal device, the ends
End equipment is provided with one or more application collection of programs, and the application program in the pool of applications has corresponding interface
Corresponding memory is configured with when stack, the interface stack are in operating status;
The method includes:
When pool of applications by foreground changing interface to background interface when, record in the pool of applications in fortune
The interface stack of row state;
Interface stack to be recycled is determined in the interface stack;
Recycle the memory that the interface stack to be recycled is configured.
The embodiment of the invention also discloses a kind of Memory recycle device of terminal device, the terminal device is provided with one
Or multiple pool of applications, the application program in the pool of applications have a corresponding interface stack, at the interface stack
Corresponding memory is configured with when operating status;
The device includes:
Interface record stack module, in pool of applications by foreground changing interface to background interface when, described in record
Interface stack in operating status in pool of applications;
Stack determining module in interface to be recycled, for determining interface stack to be recycled in the interface stack;
Interface stack Memory recycle module, the memory configured for recycling the interface stack to be recycled.
The embodiment of the present invention includes following advantages:
In the embodiment of the present invention, application program is grouped by terminal device according to functional requirement, then available each
Corresponding pool of applications under function scene, when application program operation in pool of applications, system is that it distributes interface
Stack and memory, when arbitrary pool of applications by foreground changing interface to background interface when, record the pool of applications
Interface stack in operating status, and therefrom further determine that interface stack to be recycled, finally successfully cut in pool of applications
After changing to background interface, the recycling of the interface stack memory to be recycled is carried out.It, can be according to using journey using the embodiment of the present invention
Ordered sets switches to discharge extra memory, and it is existing to reduce Caton caused by system recycling memory for free memory in increase system
As.For low configuring product lesser for memory of the embodiment of the present invention, there is very high practicability.
In addition, recycling priority is provided with for the application program in pool of applications in the embodiment of the present invention, when true
After fixed interface stack to be recycled, reclaimer operation can be sequentially carried out according to its priority, wherein if including in interface stack to be recycled
There is the critical services interface stack of important application program, then without reclaimer operation, to guarantee that application program is cut needed for system
When changing to background interface, not because Memory recycle is killed.
Detailed description of the invention
Fig. 1 is a kind of step flow chart of the method for recovering internal storage embodiment of terminal device of the invention;
Fig. 2 is the interface stack architecture schematic diagram generated when a kind of terminal device Silo operation of the invention;
Fig. 3 is a kind of structural block diagram of the Memory recycle Installation practice of terminal device of the invention.
Specific embodiment
In order to make the foregoing objectives, features and advantages of the present invention clearer and more comprehensible, with reference to the accompanying drawing and specific real
Applying mode, the present invention is described in further detail.
By taking remote operated tv product as an example, TV is generally using remote controller operation at a distance, on the one hand, user
Wish that enjoying contents more as far as possible by operation few as far as possible shows, on the other hand, TV has several specific independent mutually
Function, such as viewing live telecast video, watch Online Video, play game, check the media resource in peripheral equipment, Yi Jiyi
Dynamic equipment pushes media etc. to TV.
Currently, having function scene UI (User Interface, user interface) system in a kind of smart television, it is directly
Providing a user various function scenes, (hereinafter by function scene abbreviation Silo), user passes through remote controler one according to functional requirement
Key goes directly some function scene, the same type of resource of each function scene interior polymeric, services and applications.Wherein, should
Same type of resource, services and applications can be collectively referred to as pool of applications herein under function scene.Typical function
Can scene for example live telecast, video on demand, game center, using center, local media etc., be sane level shape between function scene
State removes homepage and Launcher, changes the starlike UI relationship frame of traditional center type.
Silo UI system simplifies the textual details of application program, so that product be made to be more suitable for user's operation, function scene
Between can pass through one key switching moment and save state and resume operation state.For example, user can be in viewing live streaming electricity
Apparent time one key switching continues the Online Video before viewing is left or one key switching to video on demand and continues to swim to game center
Play.
The Application Program Interface and state of each function scene in Silo UI system, all always background interface save and
Maintenance, and the maintenance of Application Program Interface and state needs to occupy running memory (RAM, random access in operating system
Memory), EMS memory occupation can be bigger when the Silo entered after booting is more.On low configuring product, running memory by
Not too large in the reasons such as market orientation and cost, when the application program that background interface saves state increases, running memory can not
Foot, therefore, Silo UI system has encountered following problem in low memory article:
Problem one: the operation for recycling memory causes the Caton of Application Program Interface and response slow.In order to allow user again
Open the application program run quick-recovery interface, operating system still can after Application Program Interface exits fastly
Continue the memory for retaining its occupancy, and user can be reduced using system spare memory after multiple application programs, when free memory is few
System carries out Memory recycle operation when a preset threshold value, when by the type of application process, user's level of interaction, use
Long, memory consumption size etc. calculates release sequence, to kill the process of application program one by one and recycle memory.When system is surplus
When remaining memory is in Near Threshold, if user continues to operate, Application Program Interface is possible to because frequently recycling memory is sent out
Raw Caton.It can also find in an experiment, the process and individual application programs of some critical services application programs still can after being killed
Voluntarily restart, then triggers Memory recycle operation again in system running memory deficiency and be killed, which repeatedly occurs, and causes
The multiple Memory recycle operation of system, will seriously affect the Application Program Interface response speed of complete machine.
Problem two: system recycling memory algorithm is not properly suited for Silo UI system, and the corresponding application program of Silo is rear
It is possible to be killed when platform interface, this, which will lead to when user switches back into function scene, needs to restart application program, not only
It is lost operating status and speed is slow.In presently used operating system, for background interface class application program, phase is used
Same Memory recycle numerical priority value, and the application program of the priority packet is often killed first to recycle memory.
The reason of above problem two is that operating system is designed towards the universal product, assumes all interface type applications all
There is same priority, therefore fails to distinguish which interface type using more important to user's meaning, to all background interfaces
Application Program Interface all remains memory, and recycling algorithm does not account for this demand when calculating yet.
Currently, for the intellectual product of general type, more companies, all can be when releasing low memory configurations product in the industry
System level carries out the optimization in terms of some memories.The quantity for reducing starting up's application program, prevents extra background service
Process voluntarily starts, and reduces the Application Program Interface the upper limit of the number that backstage saves, and limits the upper limit of the number etc. of background service process
Deng.
For example, existing optimisation strategy has in the industry: as soon as, after each Application Program Interface falls back on background interface, it is vertical
Carry out Memory recycle operation to it, two, the scheduling of snoop-operations system task stack, when task stack is moved to background interface, and
Its application program carries out Memory recycle to it when not including foreground interface.Both strategies are all by the memory of android system
Reclaimer operation is shifted to an earlier date, and just recycles memory immediately when Application Program Interface falls back on background interface, and advantage is the reduction of interior
Occupancy is deposited, system is also avoided until free memory reaches threshold value and just carries out Memory recycle, the Caton caused and frequently recycling
The problems such as, the disadvantage is that having violated operating system accelerates the original intention that background interface restores display, when user was again introduced into one once
When the Application Program Interface of opening, which needs to reload, and not only speed is slow but also state and data when running before
It can lose, user experience is poor.
For above-mentioned problem, the embodiment of the invention provides a kind of Memory recycle strategies of terminal device, for terminal
Memory recycle strategy is targetedly arranged in interface stack corresponding to pool of applications under functions of the equipments scene, specific next
It says, recycling is switched to the memory of the low recovery probability interface application of background interface in advance, reduces the interface stack of function scene
By the probability of Memory recycle, the Application Program Interface of assurance function scene can fast quick-recovery display under the premise of, reduce
Memory consumption.In the following, being described in detail by following embodiment.It should be noted that the terminal in the embodiment of the present invention is set
Standby can be TV, set-top box, naturally it is also possible to be smart phone, PC etc. other can be realized equipment of the invention.
Referring to Fig.1, a kind of step flow chart of the method for recovering internal storage embodiment of terminal device of the invention, institute are shown
Stating terminal device can be set one or more application collection of programs, and the application program in the pool of applications can have
There is a corresponding interface stack, the interface stack is configured with corresponding memory when in operating status;
The method can specifically include following steps:
Step 101, when pool of applications by foreground changing interface to background interface when, record the pool of applications
In interface stack in operating status;
In the embodiment of the present application, terminal device is pre-configured with multiple Silo according to functional requirement.Silo, that is, function scene,
There is corresponding pool of applications, pool of applications includes multiple application programs under function scene.
The application program of each Silo is equipped with corresponding Application Program Interface, when starting the Application Program Interface, makes
When its is in operating status, corresponding interface stack can be distributed for it, which is assigned corresponding memory, the start-up loading circle
Face finally completes application interface drafting.
In one preferred embodiment of the invention, application program includes special case application program, root application program, top application
Program and intermediate application program, then corresponding interface stack is properly termed as root interface stack, pushes up interface stack, special case interface stack and middle boundary
Face stack.Specifically, root interface stack pushes up interface stack, and the differentiation of special case interface stack and intermediate interface stack is as follows:
One, root interface stack: each Silo configures a root application program, which there is corresponding to be applied boundary
Face.It requests to show the root application interface, operating system meeting from Silo manager to operating system when starting some Silo for the first time
Start the process of the root application program of the Silo, then interface stack for its distribution is known as root interface stack, the start-up loading interface,
Finally complete the drafting of root application interface.
Two, it pushes up interface stack: multiple interface stacks can be run at the same Silo, the interface stack of Silo is used according to user
Sequence, which divides, corresponding runlevel, wherein being in the interface interface the Zhan Weiding stack of top in the interface of foreground.
Three, special case interface stack: some application programs are that can be used under whole Silo, for example, setting application, system interface
Application certain interfaces, and with other complete machine interaction control interfaces, these interfaces are referred to as special case interface, corresponding interface
Stack is special case interface stack.
Four, intermediate interface stack: the root application interface of Silo is located in the stack of root interface, and multiple interfaces, which jump, generates multiple interfaces
Stack, the interface interacted at foreground interface with user are located in the interface stack of top, ran from the stack of the root interface interface Zhan Daoding
Other interface stacks be referred to herein as intermediate interface stack.
From the foregoing, the interface stack that root interface stack and special case interface stack are usually fixed, and intermediate interface stack and top circle
It can then be replaced mutually between the stack of face, when the interface stack at the top of foreground is then top interface stack.Certainly, according to different terminals
The configuration conversion regime of equipment, interface stack may be different, and the embodiment of the present invention need not be limit to this.
In a kind of preferable example of the invention, in some Silo by foreground changing interface to background interface when, will start to receive
Collect and distinguish interface stack in operating status, specifically refers to that special case interface stack, root interface stack push up interface stack and middle boundary
Face stack, then the step 101 may include following sub-step:
Sub-step S11 determines the root interface of the pool of applications using preset pool of applications configuration file
Stack;
Also, the step 101 can also include following sub-step:
Sub-step S12 determines top interface stack and special case circle in the pool of applications using the runlevel
Face stack;
Sub-step S13, records special case interface stack, the root interface interface Zhan Heding stack, and, record the application program
Set removes special case interface stack, and the interface record stack except the stack of the root interface interface Zhan Heding is intermediate interface stack.
It should be noted that the step of above-mentioned determining root interface stack, top interface stack and special case interface stack, that is to say sub-step
S11 and sub-step S12 has no successive point, and without dependence, sequentially number is used for the purpose of text composition, and people is facilitated to read
It reads.
It since there is no time sequencings for these steps, so cannot successively write, can independently carry out, and mutual not shadow
It rings, they can select asynchronous execution or be performed simultaneously, the embodiment of the present invention is not subject to this according to terminal actual conditions
Limitation.
Certainly, certain steps in embodiments of the present invention using asynchronous execution or can be equally performed simultaneously, the present invention
Embodiment is equally not necessarily to this to limit.
In one preferred embodiment of the invention, the sub-step S12 may include following sub-step:
Sub-step a11 obtains the highest interface stack of runlevel in the pool of applications;
The highest interface stack of the runlevel is determined as top interface to be determined stack by sub-step a12;
Whether sub-step a13 uses preset special case configuration file to judge the top interface to be determined stack for special case interface
Stack;If so, executing sub-step a14;If it is not, then executing sub-step a18;
Sub-step a14, recording the top interface stack to be determined is special case interface stack;
Sub-step a15 searches the interface stack in the top interface stack next stage to be determined according to the runlevel;
Sub-step a16, using the interface stack of the next stage as top interface to be determined stack;
Sub-step a17, return it is described use preset special case configuration file judge the top interface to be determined stack whether as
The step of special case interface stack;
The top interface to be determined stack is determined as pushing up interface stack by sub-step a18.
Step 102, interface stack to be recycled is determined in the interface stack;
In one preferred embodiment of the invention, the step of step 102 can be following sub-step:
Special case interface stack and intermediate interface stack in the interface stack is determined as interface to be recycled by sub-step S21
Stack.
In a particular application, due to special case interface stack and intermediate interface stack be all user without the need for be further continued for using boundary
Face stack so will not influence the operating experience of user even if recycling memory to it, therefore can be considered as interface stack to be recycled,
It is operated to subsequent Memory recycle.
Step 103, the memory that the interface stack to be recycled is configured is recycled.
After determining interface stack to be recycled, when complete Silo by foreground changing interface to background interface after, so that it may needle
Operating for recycling memory is carried out to interface stack to be recycled.
In a kind of preferable example of the invention, Silo can be understood as grouping when application program operation, each Silo
In include multiple application programs, every group of application program generally can all have relevant business relations, such as live telecast, video point
Broadcast, game center, using center, local media etc..Each Silo can define a root application interface, for the first time starting one
Silo is actually to start this root application interface, and the root application interface is assigned corresponding interface stack, the root interface
Stack is assigned corresponding memory.
Wherein, it may include sub-interface or Application Program Interface on root application interface, can further be wrapped in sub-interface
Application program is included, therefore user can operate the interface for opening sub-interface or other applications on root application interface,
Then, root application interface can add flag bit, and the new interface for informing that operating system is opened needs to operate in current interface stack
Or a new interface stack, the application program for being activated interface can also voluntarily specify the interface to operate on startup currently
In interface stack or new interface stack.Therefore, multiple interface stacks are generated when Silo is run, these interfaces may come from multiple answer
Use program.
Each Silo has corresponding pool of applications.Silo management system is that each Silo configures Silo circle
Face stack set records and manages the Application Program Interface stack wherein run.Specifically as shown in Fig. 2, the root application interface position of Silo
In the stack of root interface, multiple interfaces, which jump, generates multiple interface stacks, and the interface interacted at foreground interface with user is located at top
In the stack of interface, other interface stacks run from the stack of the root interface interface Zhan Daoding are referred to herein as intermediate interface stack.Each Silo
Necessarily there is the root interface interface Zhan Heding stack.If Silo has only run root application interface, the root interface interface Zhan Heding stack is same
A stack does not have intermediate interface stack at this time.
When user's handoff functionality scene, Silo manager starts transition animation in the interface of foreground, background interface into
The starting of the new Silo of row and the preservation of old Silo state.Multiple interface stacks in the stack set of the new interface Silo are restored to foreground interface
Or directly initiated when first time, the interface Zhan Ji credit union of old Silo is moved to background interface, it should be noted that this time shift
Move the interface stack set still committed memory of the old Silo of background interface.
It is appreciated that the interface stack retained in memory after multiple Silo operation can be very more, it is surplus to be likely to result in system
Remaining memory is nervous.A large amount of tests are found, in system spare there are Near Threshold or after being lower than threshold value, if user continues into operation
The Memory recycle operation of system can be frequently triggered, Caton occurs for the response speed for reducing interface.Operating system is only in free memory
Memory recycle operation is just carried out when lower than threshold value, a small amount of memory released is consumed and is recycled quickly, frequently recycling behaviour
Make initiation Caton.Use demand of this Memory recycle mode not in full conformity with Silo UI system.
By collecting and surveying user behavior and statistics interface stack log, it is found that multiple interfaces of a Silo
In stack, general user can only use in root application interface stack and the top enterprising enforcement of application interface stack, the intermediate interface stack that centre generates
It is hardly again introduced into, this is determined by the functional characteristic of Silo UI system, other interface stacks on the stack of root interface are all
Started by root application interface, terminates generally return to root application interface stack after use is retracted.Therefore, user switches a Silo
Afterwards, it can only retain the root interface interface Zhan Heding stack, the memory that intermediate interface stack occupies is recycled in advance, in release residue
It deposits.
Specifically, the process of active releasing memory is as follows when Silo switches:
1) when Silo switching starts, the information of all interface stacks of foreground interface operating status is recorded, text is configured according to Silo
Current Silo root application interface information determines root interface stack in part, is determined and is pushed up according to operating system current top active interface information
Portion interface stack, other interface stacks are denoted as intermediate interface stack.
2) top interface stack is reaffirmed.This is the special operation determined by Silo UI system performance.Some application programs are
It can be used under whole Silo, for example, certain interfaces of setting application, system interface application, and controlled with the interaction of other complete machines
Interface processed, these interfaces are referred to as special case interface, and corresponding interface stack is special case interface stack.They are not belonging to any Silo,
To no longer restore to show after Silo is switched back, but restore the Silo operation when its under next stage interface stack.Therefore, this
A little special case interfaces stack can be recycled safely.It should be noted that when the application program in Silo is run, it can be according to user
Using journal, its sequencing run can know fortune according to Silo runlevel to obtain Silo runlevel
Application program of the row in top interface stack.
Special case interface stack information factory before it is preset in the application, Silo manager initialize when loaded.
The identification information of Silo manager comparison top interface stack median surface is just gradually searched downwards next if it is above-mentioned special case interface
Non- special case interface stack is recorded as top interface stack until finding non-special case interface stack by grade interface stack again.
3) stack list in interface to be recycled is determined.Intermediate interface stack and special case interface record stack are to stack list in interface to be recycled
In, do not carry out reclaimer operation directly at this time, but after the new interface Silo stack completes foreground Interface Moving and display is drawn again
It carries out, the reason is as follows that: when the top interface stack run in operating system is exited or disappeared, operating system can restore the interface under it
Stack is to guarantee that user can continue to see and operation interface, the interface stack for being restored to foreground interface can execute a series of Life Cycles
Phase function finishing service logic, some service logics can trigger audio and video playing or some settings operation, Silo caused to switch
The exception of journey.On the other hand, triggering shot operation can be also synchronized when Silo switching starts, screenshot is used as transition animation, cuts at this time
The confusion of screenshot may be caused by changing interface.
4) Silo switches, and the new interface Silo stack is waited to complete foreground Interface Moving and display drafting.
5) after the completion of Silo switching, the memory of interface stack is recycled.To the median surface stack of stack list in interface to be recycled one by one into
Row removes operation, and distributing operation system interface kills the corresponding program process in the interface, and process is killed its rear occupancy
Memory can be released immediately as free memory.Noticing has other critical services cannot inside some program process
It is killed, the information of such application program is preset in Silo manager software, and interface stack is only carried out to it and removes operation.
In embodiments of the present invention, each Silo of background interface can only cache the root interface interface Zhan Heding in memory
Stack currently can then possess multiple intermediate interface stacks in the Silo of foreground interface operation, and the presence of intermediate interface stack ensure that use
Other interfaces of family recent visit can be rapidly restored.
From test result, one program process of every kill can recycle more than ten MB of memory to more than 100 MB
It differs, then the memory of average each application program is about in twenties MB or so.The same of this embodiment of the present invention is not used in comparison
Product can obviously observe that the free memory of product after improving is more sufficient, and system is grasped by the complicated user of higher-strength
Free memory can be just triggered after work lower than system thresholds, after Caton phenomenon occurs in comparison machine low memory, improved products is still
Smoothness operation.
In one preferred embodiment of the invention, the interface stack may include critical services interface stack, the step
103 may include following sub-step:
Sub-step S31, when the pool of applications by foreground changing interface to background interface after, judge described to be recycled
Interface stack in whether be important service interface stack;If so, sub-step S32 is executed, if it is not, then executing sub-step S33;
Sub-step S32 does not recycle the memory that critical services interface stack is configured;
Sub-step S33 recycles the memory that the interface stack to be recycled is configured.
In one preferred embodiment of the invention, the interface stack has corresponding recycling priority, the sub-step
S31 may include following sub-step:
Sub-step a21 judges the corresponding recycling priority of the interface stack to be recycled, if it is preferential to be higher than preset recycling
Grade;If so, executing sub-step a22;
The interface stack to be recycled higher than preset recycling priority is determined as critical services interface by sub-step a22
Stack.
In low memory configurations product, after user starts excessive Silo and depth use, in this case it is still possible to will cause and be
The phenomenon for free memory deficiency of uniting causes operating system recycling memory and kills background application.In order to guarantee user between Silo
When switching, the interface Silo can fast quick-recovery and the state before keeping, even if Installed System Memory deficiency is also required to retain as far as possible
The Silo interface application process on backstage.The process of each top Silo interface application should be than the process of common applications
(namely being non-Silo application program) possesses slightly higher priority.
In a kind of example of the invention, when operating system carries out the Memory recycle operation of application program, one is first calculated
Recycle priority, according to the application component type of application program, user's level of interaction, whether system core process etc. factor
Comprehensive descision obtains corresponding recycling priority.
Wherein, recycling priority can be divided into from high to low according to significance level: system (System) is resided
(Persistent), foreground (Foreground), visual (Visible), (Perceptible), service can be perceived
(Service), it caches (Cached) etc..General interface type application program can be assigned to " slow when falling back on background interface
Deposit " rank, it can be recycled in advance when memory anxiety.System is general when the application program at each interface Silo falls back on background interface
Also " caching " rank can be distributed for it.
In order to guarantee the fast quick-recovery in interface after Silo switching, need to improve the process of the corresponding application program in the top Silo interface
Priority in algorithm is recycled in background interface, concrete mode is as follows:
1) to Silo manager open interface in the process management services of operating system application program, which can be repaired
Change the numerical priority value in the proceeding internal memory recycling algorithm of single application program.
2) after converting Silo, Silo management system inquiry operation system is the process for the application program that previous Silo pushes up interface
The numerical priority value of distribution.If the numerical value is less than or equal to " service " rank, above-mentioned interface is called to be revised as slightly higher rank.
In actual use, it is provided with " can perceive " rank for it, system has recycled the process of " caching " and " service " level applications program
The rank can be just recycled afterwards, and the probability for recycling of being killed is very low.If the application program itself at the previous top Silo interface is high excellent
First level application, numerical priority value can be " system " or " resident ", not need to intervene in such cases.As some Silo circle
When face is shown to top interface stack, operating system can set " foreground " for its preferred value numerical value automatically, can not do intervention i.e. at this time
It can.
In summary, the improvement in the embodiment of the present invention for the Memory recycle strategy of terminal device mainly enters in terms of two
Hand:
First, actively recycling the memory that non-Silo application program occupies after Silo switching;
Second, priority of the top the Silo interface application on backstage in Memory recycle algorithm is improved when Silo switches,
Important application program is avoided to be recovered.
In the embodiment of the present invention, application program is grouped by terminal device according to functional requirement, then available each
Corresponding pool of applications under function scene, when application program operation in pool of applications, system is that it distributes interface
Stack and memory, when arbitrary pool of applications by foreground changing interface to background interface when, record the pool of applications
Interface stack in operating status, and therefrom further determine that interface stack to be recycled, finally successfully cut in pool of applications
After changing to background interface, the recycling of the interface stack memory to be recycled is carried out.It, can be according to using journey using the embodiment of the present invention
Ordered sets switches to discharge extra memory, and it is existing to reduce Caton caused by system recycling memory for free memory in increase system
As.For low configuring product lesser for memory of the embodiment of the present invention, there is very high practicability.In addition, the present invention is implemented
The application program in pool of applications is provided with recycling priority in example, it, can root after determining interface stack to be recycled
Reclaimer operation is sequentially carried out according to its priority, wherein if in interface stack to be recycled including the important clothes of important application program
Business interface stack, then without reclaimer operation, thus when guaranteeing that application program needed for system is switched to background interface, not because of memory
Recycling is killed.
In one preferred embodiment of the invention, in described the step of recycling the memory that interface stack to be recycled is configured
Later, after that is to say step 103, can also include the following steps:
When the pool of applications again switches to foreground interface by background interface, restore the pool of applications
The corresponding Application Program Interface of the root interface interface Zhan Heding stack to foreground interface.
In embodiments of the present invention, when the pool of applications under function scene switches back into foreground circle by background interface again
When face, as remaining memory corresponding to the root interface interface Zhan Heding stack under the pool of applications, and, important application journey
Memory corresponding to the critical services interface stack of sequence, therefore application when again switching to foreground interface, under these function scenes
Program interface immediately can restore first operating status, to accelerate the speed that background interface restores display.
It is appreciated that the interface stack of these application programs does not all need to reload, not only resume speed is fast, but also before
State and data when operation will not all lose, and user experience is relatively good.
It should be noted that for simple description, therefore, it is stated as a series of action groups for embodiment of the method
It closes, but those skilled in the art should understand that, embodiment of that present invention are not limited by the describe sequence of actions, because according to
According to the embodiment of the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art also should
Know, the embodiments described in the specification are all preferred embodiments, and the related movement not necessarily present invention is implemented
Necessary to example.
Referring to Fig. 3, a kind of structural block diagram of the Memory recycle Installation practice of terminal device of the invention is shown, it is described
One or more application collection of programs has can be set in terminal device, and the application program in the pool of applications can have
Corresponding memory is configured with when corresponding interface stack, the interface stack are in operating status;
The device can specifically include following module:
Interface record stack module 201, for pool of applications by foreground changing interface arrive background interface when, record institute
State interface stack in operating status in pool of applications;
In one preferred embodiment of the invention, the interface stack may include special case interface stack, and root interface stack pushes up boundary
The interface stack of face stack and intermediate interface stack, the pool of applications can divide corresponding runtime class in running order
Not, the interface record stack module 201 may include following submodule:
First interface stack determines submodule, described using journey for being determined using preset pool of applications configuration file
The root interface stack of ordered sets;
Also, the interface record stack module 201 may include following submodule:
Second contact surface stack determines submodule, for determining the top in the pool of applications using the runlevel
Interface stack and special case interface stack;
Interface stack book of final entry submodule, for recording special case interface stack, the root interface interface Zhan Heding stack, and,
It records the pool of applications and removes special case interface stack, the interface record stack except the stack of the root interface interface Zhan Heding is centre
Interface stack.
In one preferred embodiment of the invention, the second contact surface stack determines that submodule may include such as lower unit:
Highest level interface stack acquiring unit, for obtaining the highest interface of runlevel in the pool of applications
Stack;
Top interface to be determined stack determination unit, for the highest interface stack of the runlevel to be determined as top circle to be determined
Face stack;
Special case interface stack judging unit, for judging that the top interface to be determined stack is using preset special case configuration file
No is special case interface stack;If so, special case interface record stack unit is called, if it is not, then calling top interface stack determination unit;
Special case interface record stack unit is special case interface stack for recording the top interface stack to be determined;
Next stage interface stack searching unit, for being searched one under the top interface to be determined stack according to the runlevel
The interface stack of grade;
Top interface to be determined stack determination unit again, for using the interface stack of the next stage as top interface to be determined stack,
And call special case interface stack judging unit;
Interface stack determination unit is pushed up, pushes up interface stack for the top interface to be determined stack to be determined as.
Interface stack determining module 202 to be recycled, for determining interface stack to be recycled in the interface stack;
In one preferred embodiment of the invention, the interface stack determining module 202 to be recycled may include following son
Module:
Interface stack sort out submodule, for by the special case interface stack and intermediate interface stack in the interface stack, be determined as to
The interface stack of recycling.
Interface stack Memory recycle module 203, the memory configured for recycling the interface stack to be recycled.
In one preferred embodiment of the invention, the interface stack may include critical services interface stack, the interface
Stack Memory recycle module 203 may include following submodule:
Critical services interface stack judging submodule, for when the pool of applications is by foreground changing interface to backstage circle
Behind face, judge in the interface stack to be recycled whether to be important service interface stack;If so, Memory recycle submodule is called,
If it is not, then memory is called not recycle submodule;
Memory recycle submodule, the memory configured for not recycling critical services interface stack;
Memory does not recycle submodule, the memory configured for recycling the interface stack to be recycled.
In one preferred embodiment of the invention, the interface stack has corresponding recycling priority, and the recycling is excellent
The interface stack that first grade is higher than preset recycling priority is important service interface stack, and the critical services interface stack judging submodule can
To include such as lower unit:
Priority judging unit is recycled, for judging the corresponding recycling priority of the interface stack to be recycled, if high
In preset recycling priority;
In one preferred embodiment of the invention, described can also include following module:
Application recovery runs module, for again switching to foreground circle by background interface in the pool of applications
When face, restore the corresponding Application Program Interface of the root interface interface Zhan Heding stack of the pool of applications to foreground interface.
For device embodiment, since it is basically similar to the method embodiment, related so being described relatively simple
Place illustrates referring to the part of embodiment of the method.
All the embodiments in this specification are described in a progressive manner, the highlights of each of the examples are with
The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.
It should be understood by those skilled in the art that, the embodiment of the embodiment of the present invention can provide as method, apparatus or calculate
Machine program product.Therefore, the embodiment of the present invention can be used complete hardware embodiment, complete software embodiment or combine software and
The form of the embodiment of hardware aspect.Moreover, the embodiment of the present invention can be used one or more wherein include computer can
With in the computer-usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code
The form of the computer program product of implementation.
The embodiment of the present invention be referring to according to the method for the embodiment of the present invention, terminal device (system) and computer program
The flowchart and/or the block diagram of product describes.It should be understood that flowchart and/or the block diagram can be realized by computer program instructions
In each flow and/or block and flowchart and/or the block diagram in process and/or box combination.It can provide these
Computer program instructions are set to general purpose computer, special purpose computer, Embedded Processor or other programmable data processing terminals
Standby processor is to generate a machine, so that being held by the processor of computer or other programmable data processing terminal devices
Capable instruction generates for realizing in one or more flows of the flowchart and/or one or more blocks of the block diagram
The device of specified function.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing terminal devices
In computer-readable memory operate in a specific manner, so that instruction stored in the computer readable memory generates packet
The manufacture of command device is included, which realizes in one side of one or more flows of the flowchart and/or block diagram
The function of being specified in frame or multiple boxes.
These computer program instructions can also be loaded into computer or other programmable data processing terminal devices, so that
Series of operation steps are executed on computer or other programmable terminal equipments to generate computer implemented processing, thus
The instruction executed on computer or other programmable terminal equipments is provided for realizing in one or more flows of the flowchart
And/or in one or more blocks of the block diagram specify function the step of.
Although the preferred embodiment of the embodiment of the present invention has been described, once a person skilled in the art knows bases
This creative concept, then additional changes and modifications can be made to these embodiments.So the following claims are intended to be interpreted as
Including preferred embodiment and fall into all change and modification of range of embodiment of the invention.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that process, method, article or terminal device including a series of elements not only wrap
Those elements are included, but also including other elements that are not explicitly listed, or further includes for this process, method, article
Or the element that terminal device is intrinsic.In the absence of more restrictions, being wanted by what sentence "including a ..." limited
Element, it is not excluded that there is also other identical elements in process, method, article or the terminal device for including the element.
Above to being stored back in a kind of method for recovering internal storage and a kind of terminal device of terminal device provided by the present invention
Receiving apparatus is described in detail, and used herein a specific example illustrates the principle and implementation of the invention,
The above description of the embodiment is only used to help understand the method for the present invention and its core ideas;Meanwhile for the one of this field
As technical staff, according to the thought of the present invention, there will be changes in the specific implementation manner and application range, to sum up institute
It states, the contents of this specification are not to be construed as limiting the invention.
Claims (8)
1. a kind of method for recovering internal storage of terminal device, which is characterized in that the terminal device is provided with one or more application
Collection of programs, the application program in the pool of applications have corresponding interface stack, and the interface stack is in operating status
When be configured with corresponding memory;The interface stack includes special case interface stack, and root interface stack pushes up interface stack and intermediate interface stack, institute
The interface stack for stating pool of applications divides in running order corresponding runlevel;
The method includes:
When pool of applications by foreground changing interface to background interface when, it is true using preset pool of applications configuration file
The root interface stack of the fixed pool of applications;
Also, top interface stack and special case interface stack in the pool of applications are determined using the runlevel;
Record special case interface stack, the root interface interface Zhan Heding stack, and, the pool of applications is recorded except the special case
Interface stack, the interface stack except the stack of the root interface interface Zhan Heding are intermediate interface stack;
Interface stack to be recycled is determined in the interface stack;
Recycle the memory that the interface stack to be recycled is configured.
2. the method according to claim 1, wherein described determined using the runlevel applies journey described
The step of top interface stack and special case interface stack in ordered sets includes:
Obtain the highest interface stack of runlevel in the pool of applications;
The highest interface stack of the runlevel is determined as top interface to be determined stack;
Preset special case configuration file is used to judge the top interface to be determined stack whether for special case interface stack;
If so, recording the top interface stack to be determined is special case interface stack;
The interface stack in the top interface stack next stage to be determined is searched according to the runlevel;
Using the interface stack of the next stage as top interface to be determined stack;
It returns and described preset special case configuration file is used to judge the top interface stack to be determined whether for the step of special case interface stack
Suddenly;
If it is not, then the top interface to be determined stack is determined as to push up interface stack.
3. the method according to claim 1, wherein described determine interface stack to be recycled in the interface stack
The step of are as follows:
By the special case interface stack and intermediate interface stack in the interface stack, it is determined as interface stack to be recycled.
4. method according to claim 1 or 2 or 3, which is characterized in that the interface stack includes critical services interface stack,
The step of memory that the recycling interface stack to be recycled is configured includes:
When the pool of applications by foreground changing interface to background interface after, judge in the interface stack to be recycled whether
For important service interface stack;
If so, not recycling the memory that critical services interface stack is configured;
If it is not, then recycling the memory that the interface stack to be recycled is configured.
5. according to the method described in claim 4, it is characterized in that, the interface stack have corresponding recycling priority, it is described
Judge in the interface stack to be recycled that the step of whether being important service interface stack includes:
Judge the corresponding recycling priority of the interface stack to be recycled, if be higher than preset recycling priority;
If so, the interface stack to be recycled that will be above preset recycling priority is determined as critical services interface stack.
6. the method according to claim 1, wherein recycling what the interface stack to be recycled was configured described
After the step of memory, further includes:
When the pool of applications again switches to foreground interface by background interface, restore the root of the pool of applications
Stack corresponding Application Program Interface in the interface interface Zhan Heding is to foreground interface.
7. a kind of Memory recycle device of terminal device, which is characterized in that the terminal device is provided with one or more application
Collection of programs, the application program in the pool of applications have corresponding interface stack, and the interface stack is in operating status
When be configured with corresponding memory;The interface stack includes special case interface stack, and root interface stack pushes up interface stack and intermediate interface stack, institute
The interface stack for stating pool of applications divides in running order corresponding runlevel;
The device includes:
Interface record stack module, in pool of applications by foreground changing interface to background interface when, record the application
Interface stack in operating status in collection of programs;
Stack determining module in interface to be recycled, for determining interface stack to be recycled in the interface stack;
Interface stack Memory recycle module, the memory configured for recycling the interface stack to be recycled;
Wherein, the interface record stack module includes:
First interface stack determines submodule, for determining the application program collection using preset pool of applications configuration file
The root interface stack of conjunction;
Also, the interface record stack module further include:
Second contact surface stack determines submodule, for determining the top interface in the pool of applications using the runlevel
Stack and special case interface stack;
Interface stack book of final entry submodule, for recording special case interface stack, the root interface interface Zhan Heding stack, and, record
The pool of applications removes special case interface stack, and the interface record stack except the stack of the root interface interface Zhan Heding is intermediate interface
Stack.
8. device according to claim 7, which is characterized in that the second contact surface stack determines that submodule includes:
Highest level interface stack acquiring unit, for obtaining the highest interface stack of runlevel in the pool of applications;
Top interface to be determined stack determination unit, for the highest interface stack of the runlevel to be determined as top interface to be determined
Stack;
Special case interface stack judging unit, for use preset special case configuration file judge the top interface to be determined stack whether as
Special case interface stack;If so, special case interface record stack unit is called, if it is not, then calling top interface stack determination unit;
Special case interface record stack unit is special case interface stack for recording the top interface stack to be determined;
Next stage interface stack searching unit, for searching according to the runlevel in the top interface stack next stage to be determined
Interface stack;
Stack determination unit again in top interface to be determined for using the interface stack of the next stage as top interface to be determined stack, and is adjusted
With special case interface stack judging unit;
Interface stack determination unit is pushed up, pushes up interface stack for the top interface to be determined stack to be determined as.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610188335.XA CN105808447B (en) | 2016-03-29 | 2016-03-29 | A kind of method for recovering internal storage and device of terminal device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610188335.XA CN105808447B (en) | 2016-03-29 | 2016-03-29 | A kind of method for recovering internal storage and device of terminal device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105808447A CN105808447A (en) | 2016-07-27 |
CN105808447B true CN105808447B (en) | 2019-01-29 |
Family
ID=56454126
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610188335.XA Active CN105808447B (en) | 2016-03-29 | 2016-03-29 | A kind of method for recovering internal storage and device of terminal device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105808447B (en) |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106375813B (en) * | 2016-09-21 | 2022-11-15 | 北京邦天信息技术有限公司 | Method, playing terminal and system for realizing application processing |
CN106598572B (en) * | 2016-11-17 | 2018-08-03 | 武汉斗鱼网络科技有限公司 | Method and device is exited in a kind of application |
CN108228342B (en) * | 2017-08-10 | 2021-02-09 | 珠海市魅族科技有限公司 | Terminal device control method and device, terminal device and computer readable storage medium |
CN109891390B (en) * | 2017-08-11 | 2021-12-14 | 华为技术有限公司 | Application switching method and device |
CN109714640B (en) * | 2017-10-26 | 2022-01-21 | 创盛视联数码科技(北京)有限公司 | Method for playing live video |
CN107656793B (en) * | 2017-10-31 | 2021-01-29 | 维沃移动通信有限公司 | Application program interface switching method and mobile terminal |
CN109274991B (en) * | 2018-09-07 | 2020-11-10 | 苏宁智能终端有限公司 | Memory management method and system of smart television |
CN110134652A (en) * | 2019-05-10 | 2019-08-16 | Oppo广东移动通信有限公司 | Recovery method, device, electronic equipment and the storage medium of cache file |
CN111177024B (en) * | 2019-12-30 | 2022-09-06 | 青岛海尔科技有限公司 | Memory optimization processing method and device |
CN111310170A (en) * | 2020-01-16 | 2020-06-19 | 深信服科技股份有限公司 | Anti-leakage method and device for application program and computer readable storage medium |
CN113590500A (en) * | 2020-04-30 | 2021-11-02 | 华为技术有限公司 | Memory management method and terminal equipment |
CN112181515B (en) * | 2020-09-18 | 2024-05-24 | Oppo(重庆)智能科技有限公司 | Application program control method, device, terminal and storage medium |
CN117519959A (en) * | 2022-07-30 | 2024-02-06 | 华为技术有限公司 | Memory management method and electronic equipment |
CN116501162B (en) * | 2023-04-23 | 2023-11-24 | 深圳中柏科技有限公司 | Method and device for automatically adjusting power consumption of intelligent notebook computer and electronic equipment |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102984580A (en) * | 2012-11-12 | 2013-03-20 | 北京奇虎科技有限公司 | Internal storage cleaning method and system |
CN103902359A (en) * | 2014-03-31 | 2014-07-02 | 深圳创维-Rgb电子有限公司 | Android based system memory optimizing and application scheduling method and system |
CN104965708A (en) * | 2015-06-30 | 2015-10-07 | 北京奇艺世纪科技有限公司 | Method and apparatus for managing memory in application program running process |
CN105138402A (en) * | 2015-08-25 | 2015-12-09 | 海信集团有限公司 | Method and device for adjusting priority of application process memory release |
CN105279098A (en) * | 2014-07-22 | 2016-01-27 | 中兴通讯股份有限公司 | Memory cleaning method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10437720B2 (en) * | 2014-03-12 | 2019-10-08 | Optumsoft, Inc. | Deferred destruction for efficient resource reclamation |
-
2016
- 2016-03-29 CN CN201610188335.XA patent/CN105808447B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102984580A (en) * | 2012-11-12 | 2013-03-20 | 北京奇虎科技有限公司 | Internal storage cleaning method and system |
CN103902359A (en) * | 2014-03-31 | 2014-07-02 | 深圳创维-Rgb电子有限公司 | Android based system memory optimizing and application scheduling method and system |
CN105279098A (en) * | 2014-07-22 | 2016-01-27 | 中兴通讯股份有限公司 | Memory cleaning method and device |
CN104965708A (en) * | 2015-06-30 | 2015-10-07 | 北京奇艺世纪科技有限公司 | Method and apparatus for managing memory in application program running process |
CN105138402A (en) * | 2015-08-25 | 2015-12-09 | 海信集团有限公司 | Method and device for adjusting priority of application process memory release |
Also Published As
Publication number | Publication date |
---|---|
CN105808447A (en) | 2016-07-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105808447B (en) | A kind of method for recovering internal storage and device of terminal device | |
CN103218307B (en) | Internal storage management system and EMS memory management process | |
CN102905188A (en) | Video code stream switching method and device | |
US9674063B2 (en) | Managing data usage of a computing device | |
CN112153470B (en) | Video playing method and device, computer equipment and storage medium | |
CN107423127B (en) | Application program control method and device, storage medium and electronic equipment | |
CN103702197A (en) | Image resource re-directing method and device | |
CN104657380A (en) | Picture loading method and device | |
WO2022052624A1 (en) | Video data processing method and apparatus, computer device and storage medium | |
CN105677477A (en) | Method and device for optimizing application program resources and electronic equipment | |
US20200206621A1 (en) | Method and apparatus for controlling game applications | |
CN105335224A (en) | Application switching method and apparatus | |
US20210136454A1 (en) | Systems and methods for reducing download requirements | |
CN105786519B (en) | Android device program management method and android device | |
CN103902359A (en) | Android based system memory optimizing and application scheduling method and system | |
CN111045824A (en) | Application control method and device, electronic equipment and computer readable medium | |
CN113282390A (en) | Task scheduling method and device, electronic equipment and readable storage medium | |
CN105786539A (en) | File downloading method and device | |
CN111465016A (en) | Control method and device | |
CN106055406A (en) | Program operation method and terminal | |
CN106507195A (en) | Method based on the intelligent television application handover management of linux system | |
CN102238423B (en) | A kind of equipment scheduling method, Apparatus and system | |
US20140010519A1 (en) | Pre-Fetching Video Content | |
CN115587049A (en) | Memory recovery method and device, electronic equipment and storage medium | |
CN107272869A (en) | Using management-control method, mobile terminal 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 |