WO2019128542A1 - Procédé de traitement d'application, dispositif électronique et support d'informations lisible par ordinateur - Google Patents

Procédé de traitement d'application, dispositif électronique et support d'informations lisible par ordinateur Download PDF

Info

Publication number
WO2019128542A1
WO2019128542A1 PCT/CN2018/116507 CN2018116507W WO2019128542A1 WO 2019128542 A1 WO2019128542 A1 WO 2019128542A1 CN 2018116507 W CN2018116507 W CN 2018116507W WO 2019128542 A1 WO2019128542 A1 WO 2019128542A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
processed
memory
memory page
foreground
Prior art date
Application number
PCT/CN2018/116507
Other languages
English (en)
Chinese (zh)
Inventor
方攀
陈岩
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2019128542A1 publication Critical patent/WO2019128542A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • G06F2212/1024Latency reduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/70Details relating to dynamic memory management

Definitions

  • the present application relates to the field of data processing, and in particular, to an application processing method, an electronic device, and a computer readable storage medium.
  • An embodiment of the present application provides an application processing method, an electronic device, and a computer readable storage medium.
  • An application processing method includes: acquiring a memory page occupied by an application to be processed; migrating data stored in the memory page to a temporary storage space for temporarily recovering the data; running in a preset loading interface The to-be-processed application; the data used in the temporary storage space in the process of running the to-be-processed application is read back into the memory page, and the unused data is recovered.
  • An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following operations:
  • a computer readable storage medium having stored thereon a computer program, the computer program being executed by a processor, causing the processor to:
  • FIG. 1 is a schematic diagram showing the internal structure of an electronic device in an embodiment.
  • FIG. 2 is a partial block diagram of a system in an electronic device in an embodiment.
  • 3 is a flow chart of an application processing method in one embodiment.
  • FIG. 4 is a flow chart of an application processing method in another embodiment.
  • Figure 5 is a schematic illustration of an interface that does not receive focus and that is invisible to the screen in one embodiment.
  • Figure 6 is a block diagram showing the structure of an application processing device in an embodiment.
  • Figure 7 is a block diagram showing the structure of an application processing device in another embodiment.
  • Figure 8 is a block diagram showing the structure of an application processing device in still another embodiment.
  • Figure 9 is a block diagram showing a portion of the structure of a handset in an embodiment.
  • an internal structure diagram of an electronic device includes a processor, memory, and display screen connected by a system bus.
  • the processor is used to provide computing and control capabilities to support the operation of the entire electronic device.
  • the memory is used to store data, programs, and/or instruction codes, etc., and the memory stores at least one computer program, which can be executed by the processor to implement an application processing method suitable for an electronic device provided in the embodiments of the present application.
  • the memory may include a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random storage memory (Random-Access-Memory, RAM).
  • the memory includes a non-volatile storage medium and an internal memory.
  • Non-volatile storage media stores operating systems, databases, and computer programs.
  • the database stores data related to an application processing method provided by the above various embodiments, such as storing a name of each application and a memory page allocated for each application.
  • the computer program can be executed by a processor for implementing an application processing method provided by various embodiments of the present application.
  • the internal memory provides a cached operating environment for operating systems, databases, and computer programs in non-volatile storage media.
  • the display screen can be a touch screen, such as a capacitive screen or an electronic screen, for displaying interface display information of the foreground application, and can also be used for detecting a touch operation acting on the display screen, and generating corresponding instructions, such as performing front and back applications. Switch instructions, etc.
  • FIG. 1 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied.
  • the specific electronic device may be It includes more or fewer components than those shown in the figures, or some components are combined, or have different component arrangements.
  • the electronic device further includes a network interface connected through a system bus, and the network interface may be an Ethernet card or a wireless network card, etc., for communicating with an external electronic device, for example, for communicating with a server.
  • the architecture of the electronic device includes a JAVA spatial layer 210, a local framework layer 220, and a kernel space layer 230.
  • the JAVA spatial layer 210 may include a freeze management application 212 through which the electronic device can implement a freeze policy for each application, and freeze and thaw the related applications of the background power consumption.
  • the resource priority and restriction management module 222 and the platform freeze management module 224 are included in the local framework layer 220.
  • the electronic device can maintain different applications in different priorities and different resource organizations through the resource priority and limit management module 222, and adjust the resource group of the application according to the requirements of the upper layer to achieve optimized performance and save power. effect.
  • the electronic device can allocate the tasks that can be frozen in the background to the frozen layer corresponding to the preset different levels according to the length of the entering freeze time through the platform freeze management module 224.
  • the frozen layer can include three, respectively: the CPU Limit sleep mode, CPU freeze sleep mode, process deep freeze mode.
  • the CPU restricts the sleep mode to limit the CPU resources occupied by the related processes, so that the related processes occupy less CPU resources, and the free CPU resources are tilted to other unfrozen processes, thereby limiting the occupation of CPU resources.
  • the kernel space layer 230 includes a UID management module 231, a Cgroup module 232, a Binder management module 233, a process memory recovery module 234, and a freeze timeout exit module 235.
  • the UID management module 231 is configured to implement an application-based User Identifier (UID) to manage resources of a third-party application or freeze. Compared with the Process Identifier (PID) for process management and control, it is easier to uniformly manage the resources of a user's application through UID.
  • the Cgroup module 232 is used to provide a complete set of Central Processing Unit (CPU), CPUSET, memory, input/output (I/O), and Net related resource restriction mechanisms.
  • the Binder management module 233 is used to implement the priority control of the background binder communication.
  • the interface module of the local framework layer 220 includes a binder interface developed to the upper layer, and the upper layer framework or application sends a resource restriction or frozen instruction to the resource priority and restriction management module 222 and the platform freeze management module 224 through the provided binder interface.
  • the process memory recovery module 234 is configured to implement the process deep freeze mode, so that when a third-party application is in a frozen state for a long time, the file area of the process is mainly released, thereby saving the memory module and speeding up the application next time. The speed at startup.
  • the freeze timeout exit module 235 is configured to resolve an exception generated by the freeze timeout scenario.
  • an application processing method is provided.
  • the embodiment is applied to the electronic device shown in FIG. 1 as an example for description.
  • the method includes:
  • the pending application indicates that an application that needs to recycle memory is needed.
  • the memory also known as random access memory, RAM
  • the memory indicates the memory used when running the program (that is, running memory). It can only temporarily store data for exchanging cache data with the CPU, but the memory itself cannot be used. Long-term storage of data, which can be an internal memory as shown in FIG.
  • the pending application is a background application.
  • the background application is an application running in the background; correspondingly, the application running in the foreground is the foreground application.
  • the operation of an application (APP) is usually reflected by the operation of multiple related processes.
  • a process is a running activity of a program on a computer on a data set. It is the basic unit for resource allocation and scheduling, and is the basis of the operating system structure.
  • the process involved in the foreground application runtime is the foreground process
  • the process involved in the background application runtime is the background process.
  • the application needs to occupy memory space in the running state to store data during the running process.
  • the memory space occupied by different applications in different running states may not be the same.
  • the memory page is the unit that the operating system manages the memory.
  • the memory size of the memory page set by different electronic devices is not necessarily the same. For example, the memory space in the electronic device is divided into 100000 memory pages, and the memory page occupied by the to-be-processed application is the memory page 100 to the memory page 200, and the memory page 130 to the memory page 200 are recyclable memory pages.
  • the electronic device can record all the memory pages used by the pending application at runtime, such as recording the memory pages that are used by the runtime to be stored to the memory pages of the memory page.
  • Operation 304 the data stored in the memory page is migrated to a temporary storage space for temporarily reclaiming data.
  • the data stored in the memory page is the data used or generated by the corresponding application during the running process, and the data is temporarily cached in the memory.
  • the temporary storage space is a preset storage space for temporarily reclaiming and storing the memory data.
  • the temporary storage space may be a storage space in any one or several storage media such as a block cache, a page cache, a virtual memory, a flash flash or an external storage medium.
  • An electronic device can migrate data stored in some or all of the memory pages into temporary storage space.
  • the temporary storage space is used for temporarily reclaiming and storing the data stored in the memory page, and performing the operations of relocating or migrating the stored data to other storage spaces or deleting them under certain conditions, and setting the temporary storage space.
  • Operation 306 running the to-be-processed application in a preset loading interface.
  • the preset loading interface is a pre-set bearer interface for running the application to be processed.
  • the size and location of the loading interface can be any suitable size and location preset.
  • the loading interface can be a split screen interface preset on the electronic device such that the pending application can be run on the interface.
  • the loading interface can be an interface that does not receive focus and that is not visible to the screen.
  • the focus indicates the ability to receive the user's click or keyboard input, and the interface that does not receive the focus indicates that the click, input, and the like performed on the interface are not received or responded.
  • the screen is not visible to indicate the interface that the user cannot see, but for the system, there is an interface.
  • the interface display effect can be similar to the display effect of the completely transparent interface, so that the user cannot view the information displayed on the interface. By setting an interface that does not receive focus and the screen is invisible, the operation generated on the interface does not affect the user's operation.
  • the electronic device runs the pending application based on the data migrated to the temporary storage space at a preset interface that does not receive the focus and is invisible to the screen to detect the data required to run the application.
  • the data used includes at least one of data migrated into the temporary storage space and data not migrated in the remaining memory pages.
  • the manner of running the to-be-processed application may include a manner of starting the application to be processed, that is, by starting the to-be-processed application in the interface that does not receive the focus and being invisible to the screen, to detect the data that is needed during the startup process. .
  • Operation 308 the data used in the temporary storage space during the running of the application to be processed is read back into the memory page, and the unused data is recycled.
  • the electronic device can determine the data that is used when the application is run by detecting the used data in the process of running the application, and can read the part of the data from the temporary storage space back to the memory page. So that when the user needs to run the application, the data in the memory page can be quickly read back to prevent the running efficiency of the pending application from decreasing.
  • the electronic device can recycle the data, for example, the unused data can be recycled to the flash memory, thereby reducing the occupation of the memory space, so that in the process of running the application to be processed, When you need to use this data, read it back into the memory page.
  • the electronic device may re-allocate a new memory page to the to-be-processed application, and write the data used in the temporary storage space into the memory address corresponding to the reallocated memory page.
  • the electronic device migrates data in the memory page occupied by the application to be used in a temporary storage space for temporarily reclaiming data, and then re-runs the to-be-processed application to detect that the data in the memory page is migrated.
  • the migrated data used in the process of running the application to be processed on the preset loading interface, and the electronic device re-reads the detected used data after re-running the to-be-processed application.
  • To the memory page to prevent accidental recycling, and for the unused data, it will be recycled, thus achieving accurate recycling of the data that is not needed for the application to be processed, which not only improves the storage space of the available memory, but also prevents the data from being stored. Handling the decline in the speed at which the application resumes running.
  • operation 302 includes querying all memory pages of memory occupied by the application to be processed; and obtaining recyclable memory pages from all memory pages.
  • the electronic device can pre-record all memory pages occupied by the application to be processed, and obtain a retrievable memory page from all the memory pages.
  • Recyclable memory pages represent memory pages that can be recycled and that have no impact on the operation of the application and other applications after they are recycled.
  • the electronic device can record, among the memory pages, which memory pages are recyclable memory pages, which memory pages are non-recyclable memory pages, and according to the record information, obtain recyclable memory pages occupied by the to-be-processed application.
  • the electronic device can record memory pages of memory occupied by different applications in real time, and further record in real time whether it can be recycled for each occupied memory page. For example, when there is data in a certain memory page being used by another application or the application to be processed, it is determined that the memory page is a non-recyclable memory page, and when the data recorded in the occupied memory page is in no application. When the usage state, or the duration of the non-application use state exceeds the preset duration, the memory page is determined to be a reclaimable memory page.
  • the electronic device can query all the memory pages occupied by the pre-recorded information, and determine whether it is a recyclable memory page according to the used state of each memory page, and then obtain all the available Recycle the memory page.
  • querying all memory pages of the memory occupied by the application to be processed includes: traversing a memory mapped file of the to-be-processed application; and querying all memory pages occupied by the to-be-processed application through the memory mapped file.
  • Memory-Mapped Files are mappings from one file to one memory.
  • the electronic device establishes a corresponding memory mapping file for the to-be-processed application, where the memory mapping file is set with a memory page occupied by the corresponding application, and the electronic device traverses the memory mapping file corresponding to the to-be-processed application, and traverses from each
  • the memory page occupied by the to-be-processed application is read in the memory mapping file, so that all the memory pages occupied by the to-be-processed application are obtained, and the query efficiency of the memory page occupied by the application to be processed and the comprehensiveness of the query are improved.
  • the reclaimable memory page is obtained from all of the memory pages, including: removing the memory page carrying the occupied mark from all the memory pages; and obtaining the recyclable memory page from the rejected memory page.
  • the electronic device can detect whether each of the queried memory pages carries an occupation mark or is occupied by multiple applications, for all the memory pages occupied by the queried application.
  • the occupancy mark indicates that the data stored in the corresponding memory page is being used by the application to be processed, or the data therein is indispensable data in the process of the pending application being kept in normal operation, and when the data is deleted, The pending application may not be able to run normally, or it may need to repeatedly occupy a new memory page to store corresponding data.
  • the electronic device may set an occupancy flag on the memory page storing the data to indicate the corresponding Memory pages cannot be recycled.
  • the memory page occupied by the application to be processed, the data stored therein may also be used by other applications, that is, multiple applications are using the data in the memory page, and the memory page may also be set to occupy the mark. , so that the electronic device also culls it to indicate that it is not recycled from the memory page.
  • the reserved memory page is a recyclable memory page from which the electronic device can perform memory reclamation.
  • the electronic device may invoke the resource priority and restriction management module 222 as shown in FIG. 2 to traverse the memory mapped file of the to-be-processed application; query all memory pages occupied by the to-be-processed application through the memory-mapped file, and
  • the resource priority and limit management module 222 detects whether each memory page is a reclaimable memory page, and the electronic device can set a corresponding occupation mark for the non-recyclable memory page, and record whether each memory page is occupied by multiple applications.
  • the memory page carrying the occupancy flag and/or occupied by multiple applications is removed from all the memory pages that are queried; the reclaimable memory page is obtained from the culled memory page.
  • the electronic device can further reduce the impact on the application or other application to be processed, and can also reduce the ongoing operation. The amount of data migration during the temporary recovery process.
  • the method before operation 304, further includes: obtaining an idle duration of the to-be-processed application for each memory page; determining a duration threshold according to an idle duration of each memory page; operation 304 includes: setting the idle duration to a duration threshold The data stored in the memory page is migrated to the temporary storage space.
  • the idle duration of the memory page indicates that after the system allocates a memory page for the pending application, the data stored in the memory page is not used after being used most recently.
  • the electronic device updates the idle time of each memory page in real time according to the data usage of each memory page. When the memory page occupied by the application to be processed is ready for recycling, the idle time of each memory page of the latest record can be obtained.
  • the allocation, reclaim, release, etc. of the memory page is initiated recently, or the usage of the cache in the processor is queried, it is determined that the data of the corresponding memory page is used. And will generate the data usage time of the most recent time on the memory page of the system time in the corresponding situation. The difference between the current time and the latest time is the idle time of the corresponding memory page.
  • the electronic device can create a corresponding timestamp for each memory page that records the most recent usage time of the data in the corresponding memory page.
  • the electronic device can update the activity of the corresponding memory page whenever the initiative allocates the memory allocation, collection, release, etc., and records the update time in the timestamp.
  • the system periodically checks the usage of the processor cache, and the electronic device can determine that the data in the current cache is the currently used data, and update the timestamp of the memory page involved, and record the update time in the timestamp.
  • the electronic device may replace the latest updated update time with the last update time to reduce the resource consumption of the update time.
  • the duration threshold represents the critical value used to decide whether to recycle the memory page.
  • the duration threshold may be a fixed value, or may be a duration threshold determined according to the idle duration of each memory page, the idle duration is different, and the determined duration thresholds are not necessarily the same.
  • the duration threshold may be a weighted average of the idle durations of all memory pages, or may also be an idle duration selected by the electronic device from the idle duration of the all memory pages, and the selected idle duration is used as the duration threshold.
  • the electronic device may select the idle duration that is close to the median or is in a certain position in the idle duration of all the memory pages occupied by the to-be-processed application, and select the idle duration as the duration threshold.
  • the electronic device may temporarily collect the memory page whose idle time exceeds the duration threshold from the memory page occupied by the to-be-processed application according to the determined duration threshold, and write the data stored in the selected memory page into the temporary storage space.
  • the electronic device may use the process memory collection module 234 to recover the memory page from the memory page according to the duration threshold, and write the data stored in the recovered memory page into the temporary storage space.
  • the memory page has 100 pages, and the corresponding idle duration is between 5 seconds and 15 minutes respectively.
  • the duration threshold determined according to the idle duration is 5 minutes, the 100 pages of memory pages can be recovered.
  • the memory page that is temporarily reclaimed to store data is a reclaimable memory page.
  • the electronic device selects a memory page whose idle time exceeds a corresponding duration threshold according to the idle time of each memory page, thereby further reducing the operational impact of the application to be processed, and improving the accuracy of temporarily recovering data. It reduces the amount of data that needs to be read back into the memory page, minimizes the negative impact on each application, improves the memory usage efficiency, and maintains the balance between the recycling and operation of the application memory to be processed.
  • obtaining the idle duration of the memory page of the to-be-processed application includes: obtaining an update time of the timestamp record of each memory page, and calculating an idle duration of the corresponding memory page according to the update time.
  • the electronic device can create a timestamp for each memory page by using the resource priority and limit management module 222 described above, the timestamp is used to record the corresponding update time, and the update time indicates the time when the corresponding memory page is recently used.
  • the update time of the timestamp record can be updated.
  • the electronic device determines that the data of the corresponding memory page is used whenever the last time the memory page is allocated, recycled, released, or the like, or the cached usage of the processor is used. And will generate the system time in the corresponding situation as the update time.
  • the electronic device can calculate the idle duration of the corresponding memory page according to the update time recorded by the time stamp and the current system time. The difference between the current time and the most recent time is the idle time for the corresponding memory page.
  • the electronic device records the update time of each memory page by using the software to create a time stamp, and determines the idle duration according to the update time, which can effectively be compatible with different processors, and improves the versatility of memory recovery.
  • obtaining the idle duration of the memory to be processed by the application to be processed includes: obtaining an update time of each memory page recorded by the latest unused LRU management unit, and calculating the idleness of the corresponding memory page according to the update time. duration.
  • LRU Least Recently Used
  • the LRU management unit can record each memory address and the update time of the memory address.
  • the processor stores the corresponding memory address and update time in the LRU management unit.
  • the electronic device can obtain the memory page corresponding to each memory address according to the correspondence between the memory address and the memory page, and further read the update time of the corresponding memory page from the LRU management unit. .
  • the electronic device determines that the data of the corresponding memory page is used whenever the last time the memory page is allocated, recycled, released, or the like, or the cached usage of the processor is used. And will generate the system time in the corresponding situation as the update time.
  • the electronic device can generate an interrupt message and notify the operating system, and the operating system can clear the data after reading the data of the LRU management unit, so that the LRU management unit can restart work and store each memory address. And its corresponding update time and other information.
  • the electronic device can accurately track the usage of each memory, improve the accuracy of detecting the update time of the memory page, and improve the convenience of memory recovery.
  • determining the duration threshold according to the idle duration of each memory page includes: calculating an average idle duration of the to-be-processed application to the memory page according to the idle duration of each memory page, and using the average idle duration as the duration threshold.
  • the average idle duration may be an average value of the occupied duration of each memory page in the memory page occupied by the application to be processed.
  • the electronic device may calculate the average idle duration by using the corresponding calculation unit to calculate the average duration of each memory page according to the occupied duration of each memory page, and use the average idle duration as the duration threshold.
  • the electronic device can increase the calculation efficiency of the duration threshold by using the average idle duration as the duration threshold, and the calculation is simple, thereby correspondingly improving the efficiency of memory recovery.
  • FIG. 4 another application processing method is provided, the method comprising:
  • Operation 402 Acquire a reclaimable memory page occupied by the to-be-processed application.
  • the electronic device may traverse the memory mapped file of the to-be-processed application; query all memory pages occupied by the to-be-processed application through the memory-mapped file; and remove the memory page carrying the occupied mark from all the memory pages; from the eliminated memory page Get reclaimable memory pages.
  • Operation 404 Acquire an idle duration of the to-be-processed application for each recyclable memory page.
  • the electronic device may acquire an update time of the timestamp record of each memory page, calculate an idle duration of the corresponding memory page according to the update time, or acquire each memory page recorded by the most recently unused LRU management unit.
  • the update time based on the update time, calculates the idle duration of the corresponding memory page.
  • Operation 406 calculating an average idle duration of the to-be-processed application to the memory page according to the idle duration of each reclaimable memory page, and using the average idle duration as the duration threshold.
  • the average idle duration is the length of time calculated by averaging the idle duration of each recyclable memory page.
  • Operation 408 migrating data stored in the reclaimable memory page whose idle time exceeds the duration threshold to the storage space in the page cache.
  • the page cache may be a pre-defined storage medium for temporarily storing data stored in a memory page.
  • An electronic device can improve the efficiency of migration of data by migrating data from a reclaimable memory page to a page cache.
  • Operation 410 running the pending application in an interface that does not receive focus and is invisible to the screen.
  • the size of the screen that is not in focus and that is not visible to the screen is the same size as the system display interface.
  • a schematic diagram of an interface that does not receive focus and that is invisible to the screen is included in one embodiment.
  • the interface 502 is an interface that does not receive the focus and is invisible to the screen
  • the interface 504 is a normal system display interface.
  • the interface may be a mobile phone operation interface, and the interface that does not receive the focus and the screen is invisible may be the same interface as the screen size of the mobile phone.
  • the electronic device runs the to-be-processed application on an interface that is identifiable by the system and is invisible to the user and does not receive the focus, so that the foreground operation is not affected, and the operation of the processing application is not disturbed, so that the focus is not received.
  • the data used is also the data that needs to be used when running the pending application on the normal display interface of the system, so that the data required for running the pending application can be realized.
  • the running the application to be processed may be to start the application to be processed.
  • Operation 412 the data used in the storage space in the page cache in the process of running the application to be processed is read back into the memory page, and the unused data is recycled.
  • the electronic device can determine the data that needs to be used when the application is run, and can detect the used data to be read back from the page cache to the data used in the process of running the application.
  • the memory page can be a reallocated memory page or a memory page that corresponds to the data stored in the migration store.
  • the electronic device can recycle it into the flash memory so that it can be loaded back from the flash memory when needed later.
  • the electronic device migrates the data stored in the memory page occupied by the application to be processed into a temporary storage space for temporarily reclaiming data, and then runs in an interface that does not receive the focus and is invisible to the screen. Processing the application, so that the data used by the to-be-processed application can be accurately detected, and the data used in the temporary storage space is read back into the memory page, and the unused data is recycled, and the treatment is realized. Handling the memory data that is not needed by the application for accurate recovery, which not only improves the storage space of the available memory, but also prevents the running speed of the pending application from being resumed.
  • the method before acquiring the memory page occupied by the to-be-processed application, the method further includes: detecting whether the to-be-processed application is dependent on the foreground application; if yes, adjusting the priority of the to-be-processed application to match the foreground application; otherwise , execute the memory page occupied by the application to be processed.
  • the memory page occupied by the application to be processed is executed.
  • Dependency indicates that an application needs to utilize data from one or more applications in order to successfully implement the normal operation of the application.
  • There are two applications of the dependency which are the dependent application and the dependent application, respectively, and the electronic device detects the pending application to be processed by the foreground application to be determined by the foreground application as the background application that is depended by the foreground application.
  • the electronic device may set a corresponding dependency mark to the detected background application that is determined by the foreground application, and obtain a background application with the dependency mark from the background application pool, and determine the background application as a background that is depended by the foreground application.
  • the foreground application is the application running in the foreground.
  • the electronic device may determine that the to-be-processed application is an application that is dependent on the foreground application, and adjust the priority of the to-be-processed application that is affected by the foreground application to be prioritized with the foreground application. match.
  • the electronic device may adjust the priority of the queried application to be processed by the foreground application, so that the adjusted priority matches the priority of the foreground application.
  • the electronic device can set different matching relationships between the priority of the pending application and the foreground priority that are depended by the foreground application. According to the matching relationship, the electronic device may obtain a corresponding priority applicable to the to-be-processed application that is dependent on the foreground application, and adjust the priority of the to-be-processed application that is to be processed by the foreground application to the priority, thereby reducing the dependency on the foreground application.
  • the resource limit of the pending application is such that the degree of restriction on the resources that can be used by the pending application that is dependent on the foreground application matches the limit of the foreground application.
  • the priority that matches the priority of the foreground application may be the same priority as the foreground application. That is, the electronic device can adjust the priority of the to-be-processed application that is dependent on the foreground application to the same priority as the foreground application, so that the degree of limitation on resources that can be used by the to-be-processed application that is dependent on the foreground application is The foreground application is limited to the same extent.
  • the electronic device performs dependency detection by the application to be processed, and adjusts the priority of the to-be-processed application that the foreground application depends on to the priority of the foreground application. Because the foreground application has the highest priority, the limit of the available resources is the lowest, and the background process has the lower priority to prevent the background process from occupying too many resources and affecting the foreground application. However, there are situations in the background process that are depended on by the foreground application. When the background process is dependent on the execution efficiency, it will also affect the foreground application.
  • the embodiment of the present application adjusts the priority of the dependent application to be processed to the priority matching the foreground priority, thereby reducing the degree of limitation of resources that can be used by the dependent application to be processed, thereby improving the dependency.
  • the processing efficiency of the pending application Since the processing efficiency of the dependent pending application is improved, the processing efficiency of the foreground application depending on the dependent pending application is also improved.
  • socket communication when there is socket communication, binder communication, memory sharing or lock waiting between the to-be-processed application and the foreground application, it is determined that there is a communication mechanism between the background process and the foreground application.
  • the electronic device can set a detection mechanism for the Binder communication between the foreground application and the background process in the Binder driver, and call the detection mechanism set in the Binder driver to detect the background process that the Binder communication exists with the foreground application, and the detection will be detected.
  • the background process is determined to be a background process that is dependent on the foreground application.
  • the electronic device can detect individual lock resources, including thread locks, file handles, signals, and the like. For each lock resource, it can be detected whether a lock wait occurs, that is, the lock resource waits. When it is detected that a lock wait is generated, it may be further detected whether the behavior of the occurrence of the wait occurs on the foreground application. If so, all the background processes waiting for the lock resource are traversed, and the detected background processes waiting on the lock resource are all determined to be background processes that are depended by the foreground application.
  • the electronic device may set a lock resource monitoring module and a priority adjustment module in a kernel space of the operating system, and embed the lock resource monitoring module into the kernel's native waiting interface.
  • the lock resource monitoring module detecting thread locks, file handles, signals, etc. lock various lock resources, whether a wait occurs, whether the waiting behavior occurs in the foreground application, and if it occurs on the foreground task, it will detect
  • the message is sent to the priority adjustment module.
  • the electronic device traverses all the background threads waiting for the lock resource by the priority adjustment, and determines these background processes as the background processes that are depended by the foreground application.
  • the priority adjustment module adjusts the priority of the corresponding pending application to the matching priority.
  • the to-be-processed application with the synchronization mechanism is a background process that is dependent on the foreground application.
  • the electronic device can also detect the background process in the background process set by calling the futex system call, whether there is a background process having a synchronization mechanism with the foreground application, and determine the background process with the synchronization mechanism as the background process that is depended by the foreground application.
  • the user mode synchronization mechanism can be implemented by calling the futex system call.
  • the user state refers to the non-privileged state.
  • Synchronization mechanisms include semaphores, mutex locks, and more.
  • the electronic device determines, by the detection of at least one of a communication mechanism and a synchronization mechanism between the foreground application and the background process, that the detected background process having at least one of a communication mechanism and a synchronization mechanism with the foreground application is the foreground
  • Application-dependent background processes can improve the efficiency of detection of pending applications that are dependent on the foreground application.
  • FIGS. 3 and 4 are sequentially displayed as indicated by the arrows, these operations are not necessarily performed in the order indicated by the arrows. Except as explicitly stated herein, the execution of these operations is not strictly limited, and the operations may be performed in other sequences. Moreover, at least some of the operations in FIGS. 3 and 4 may include multiple sub-operations or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, or The order of execution of the stages is also not necessarily sequential, but may be performed alternately or alternately with at least a portion of the sub-operations or stages of other operations or other operations.
  • an application processing apparatus includes a memory page acquisition module 602, a storage data processing module 604, and an application processing module 606.
  • the memory page obtaining module 602 is configured to acquire a memory page occupied by the to-be-processed application; the storage data processing module 604 is configured to migrate data stored in the memory page to a temporary storage space for temporarily reclaiming data; and the application processing module 606 For running the to-be-processed application in the preset loading interface; the storage data processing module 604 is further configured to read back the data used in the temporary storage space in the process of running the to-be-processed application to the memory page, and the unused data will be unused. The data obtained is recycled.
  • the memory page obtaining module 602 is further configured to: traverse the memory mapped file of the to-be-processed application; query all memory pages occupied by the to-be-processed application through the memory-mapped file; and remove the memory page carrying the occupied mark from all the memory pages; Get reclaimable memory pages from the stripped memory page.
  • another memory processing device is provided, the device further comprising:
  • the duration determining module 608 is configured to obtain an idle duration of the to-be-processed application for each memory page; and determine a duration threshold according to the idle duration of each memory page.
  • the storage data processing module 604 is further configured to migrate data stored in the memory page whose idle duration exceeds the duration threshold into the temporary storage space.
  • the duration determining module 608 is further configured to obtain an update time of the timestamp record of each memory page, calculate an idle duration of the corresponding memory page according to the update time, or obtain a record that is recorded by the most recently unused LRU management unit. The update time of each memory page, and the idle time of the corresponding memory page is calculated according to the update time.
  • the duration determining module 608 is further configured to calculate an average idle duration of the to-be-processed application for the memory page according to the idle duration of each memory page, and use the average idle duration as the duration threshold.
  • the temporary storage space includes a storage space in the page cache;
  • the loading interface is an interface that does not receive the focus and is invisible to the screen, and the size of the loading interface is the same as the size of the system display interface.
  • yet another application processing device is provided, the device further comprising:
  • the dependency detection module 610 is configured to detect whether the to-be-processed application is dependent on the foreground application.
  • the priority adjustment module 612 is configured to adjust the priority of the to-be-processed application to match the foreground application when the to-be-processed application is dependent on the foreground application.
  • each module in the application processing device is for illustrative purposes only. In other embodiments, the application processing device may be divided into different modules as needed to complete all or part of the functions of the application processing device. For specific definitions of the application processing device, reference may be made to the above definition of the application processing method, and details are not described herein again.
  • the various modules in the application processing device described above may be implemented in whole or in part by software, hardware, and combinations thereof. Each of the above modules may be embedded in or independent of the processor in the electronic device, or may be stored in a memory in the electronic device in a software format, so that the processor calls to perform operations corresponding to the above modules.
  • each module in the application processing apparatus may be in the form of a computer program.
  • the computer program can run on an electronic device such as a terminal or a server.
  • the program module of the computer program can be stored on a memory of the electronic device.
  • the computer program is executed by the processor, the operation of the application processing method described in the embodiment of the present application is implemented.
  • an electronic device including a memory, a processor, and a computer program stored on the memory and operable on the processor, and the application processing provided by the above embodiments is implemented when the processor executes the computer program The operation of the method.
  • a computer readable storage medium having stored thereon a computer program for performing application processing as described in various embodiments of the present application when executed by a processor The operation of the method.
  • a computer program product comprising instructions, when executed on a computer, causes the computer to perform the application processing methods described in the various embodiments of the present application.
  • the embodiment of the present application also provides a computer device. As shown in FIG. 9 , for the convenience of description, only the parts related to the embodiments of the present application are shown. If the specific technical details are not disclosed, please refer to the method part of the embodiment of the present application.
  • the computer device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, and the like, taking a computer device as a mobile phone as an example. :
  • FIG. 9 is a block diagram showing a part of a structure of a mobile phone related to a computer device according to an embodiment of the present application.
  • the mobile phone includes: a radio frequency (RF) circuit 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wireless fidelity (WiFi) module 970, and a processor 980.
  • RF radio frequency
  • RF radio frequency
  • memory 920 includes: a radio frequency (RF) circuit 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wireless fidelity (WiFi) module 970, and a processor 980.
  • WiFi wireless fidelity
  • power supply 990 and other components.
  • the RF circuit 910 can be used for receiving and transmitting signals during the transmission and reception of information or during a call.
  • the downlink information of the base station can be received and processed by the processor 980.
  • the uplink data can also be sent to the base station.
  • RF circuits include, but are not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • LNA Low Noise Amplifier
  • RF circuitry 910 can also communicate with the network and other devices via wireless communication.
  • the above wireless communication may use any communication standard or protocol, including but not limited to Global System of Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division). Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), e-mail, Short Messaging Service (SMS), and the like.
  • GSM Global System of Mobile communication
  • GPRS General
  • the memory 920 can be used to store software programs and modules, and the processor 980 executes various functional applications and data processing of the mobile phone by running software programs and modules stored in the memory 920.
  • the memory 920 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as an application of a sound playing function, an application of an image playing function, etc.);
  • the data storage area can store data (such as audio data, address book, etc.) created according to the use of the mobile phone.
  • memory 920 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the input unit 930 can be configured to receive input numeric or character information and to generate key signal inputs related to user settings and function control of the handset 900.
  • the input unit 930 may include a touch panel 931 and other input devices 932.
  • the touch panel 931 also referred to as a touch screen, can collect touch operations on or near the user (such as the user using a finger, a stylus, or the like on the touch panel 931 or near the touch panel 931. Operation) and drive the corresponding connection device according to a preset program.
  • the touch panel 931 can include two portions of a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the processor 980 is provided and can receive commands from the processor 980 and execute them.
  • the touch panel 931 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input unit 930 may also include other input devices 932.
  • other input devices 932 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.).
  • the display unit 940 can be used to display information input by the user or information provided to the user as well as various menus of the mobile phone.
  • the display unit 940 can include a display panel 941.
  • the display panel 941 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
  • the touch panel 931 can cover the display panel 941. When the touch panel 931 detects a touch operation on or near it, the touch panel 931 transmits to the processor 980 to determine the type of the touch event, and then the processor 980 is The type of touch event provides a corresponding visual output on display panel 941.
  • touch panel 931 and the display panel 941 are used as two independent components to implement the input and input functions of the mobile phone in FIG. 9, in some embodiments, the touch panel 931 and the display panel 941 may be integrated. Realize the input and output functions of the phone.
  • the handset 900 can also include at least one type of sensor 950, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 941 according to the brightness of the ambient light, and the proximity sensor may close the display panel 941 and/or when the mobile phone moves to the ear. Or backlight.
  • the motion sensor may include an acceleration sensor, and the acceleration sensor can detect the magnitude of the acceleration in each direction, and the magnitude and direction of the gravity can be detected at rest, and can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching), and vibration recognition related functions (such as Pedometer, tapping, etc.; in addition, the phone can also be equipped with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors.
  • the acceleration sensor can detect the magnitude of the acceleration in each direction, and the magnitude and direction of the gravity can be detected at rest, and can be used to identify the gesture of the mobile phone (such as horizontal and vertical screen switching), and vibration recognition related functions (such as Pedometer, tapping, etc.; in addition, the phone can also be equipped with gyroscopes, barometers, hygrometers, thermometers, infrared sensors and other sensors.
  • Audio circuitry 960, speaker 961, and microphone 962 can provide an audio interface between the user and the handset.
  • the audio circuit 960 can transmit the converted electrical data of the received audio data to the speaker 961, and convert it into a sound signal output by the speaker 961.
  • the microphone 962 converts the collected sound signal into an electrical signal, and the audio circuit 960 After receiving, it is converted into audio data, and after being processed by the audio data output processor 980, it can be sent to another mobile phone via the RF circuit 910, or the audio data can be output to the memory 920 for subsequent processing.
  • WiFi is a short-range wireless transmission technology
  • the mobile phone can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 970, which provides users with wireless broadband Internet access.
  • FIG. 9 shows the WiFi module 970, it can be understood that it does not belong to the essential configuration of the mobile phone 900 and can be omitted as needed.
  • the processor 980 is the control center of the handset, which connects various portions of the entire handset using various interfaces and lines, by executing or executing software programs and/or modules stored in the memory 920, and invoking data stored in the memory 920, executing The phone's various functions and processing data, so that the overall monitoring of the phone.
  • processor 980 can include one or more processing units.
  • processor 980 can integrate an application processor and a modem, where the application processor primarily processes an operating system, user interface, applications, etc.; the modem primarily processes wireless communications. It will be appreciated that the above described modems may also not be integrated into the processor 980.
  • the processor 980 can integrate an application processor and a baseband processor, and the baseband processor and other peripheral chips can form a modem.
  • the mobile phone 900 also includes a power source 990 (such as a battery) that supplies power to various components.
  • the power source can be logically coupled to the processor 980 through a power management system to manage functions such as charging, discharging, and power management through the power management system.
  • the handset 900 can also include a camera, a Bluetooth module, and the like.
  • the processor included in the mobile phone implements the application processing method described above when executing a computer program stored in the memory.
  • Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM), which acts as an external cache.
  • RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronization.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM dual data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM Link (Synchlink) DRAM
  • SLDRAM Memory Bus
  • Rambus Direct RAM
  • RDRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Memory System (AREA)

Abstract

L'invention concerne un procédé de traitement d'application comprenant : l'acquisition d'une page de mémoire occupée par une application à traiter ; la migration de données mémorisées dans la page de mémoire dans un espace de mémoire temporaire afin de récupérer temporairement les données ; l'exécution de ladite application dans une interface de chargement prédéfinie ; et la lecture des données utilisées dans l'espace de mémoire temporaire pendant l'exécution de ladite application de retour vers la page de mémoire, et la récupération de données non utilisées.
PCT/CN2018/116507 2017-12-29 2018-11-20 Procédé de traitement d'application, dispositif électronique et support d'informations lisible par ordinateur WO2019128542A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711484431.XA CN109992522A (zh) 2017-12-29 2017-12-29 应用处理方法和装置、电子设备、计算机可读存储介质
CN201711484431.X 2017-12-29

Publications (1)

Publication Number Publication Date
WO2019128542A1 true WO2019128542A1 (fr) 2019-07-04

Family

ID=67065077

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/116507 WO2019128542A1 (fr) 2017-12-29 2018-11-20 Procédé de traitement d'application, dispositif électronique et support d'informations lisible par ordinateur

Country Status (2)

Country Link
CN (1) CN109992522A (fr)
WO (1) WO2019128542A1 (fr)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258965B (zh) * 2020-01-10 2024-03-08 北京聚云立方科技有限公司 一种数据获取方法、装置、电子设备及存储介质
CN114942800A (zh) * 2021-02-09 2022-08-26 荣耀终端有限公司 一种应用程序运行加速的方法及设备
CN114168225B (zh) * 2021-12-08 2024-05-14 深圳忆联信息系统有限公司 固态硬盘映射表延迟更新方法、装置、计算机设备及存储介质
CN114861209B (zh) * 2022-05-24 2024-06-04 Oppo广东移动通信有限公司 内存空间的占用信息的获取方法、装置及终端

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231619A (zh) * 2008-02-22 2008-07-30 浙江大学 一种基于非连续页的动态内存管理方法
US20090259806A1 (en) * 2008-04-15 2009-10-15 Adtron, Inc. Flash management using bad page tracking and high defect flash memory
CN102831073A (zh) * 2012-08-17 2012-12-19 广东威创视讯科技股份有限公司 一种内存数据处理方法和系统
CN106484472A (zh) * 2016-09-29 2017-03-08 华为技术有限公司 一种内存回收方法及终端
CN107066335A (zh) * 2017-03-23 2017-08-18 华南师范大学 一种云平台内存的优化方法和优化系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101231619A (zh) * 2008-02-22 2008-07-30 浙江大学 一种基于非连续页的动态内存管理方法
US20090259806A1 (en) * 2008-04-15 2009-10-15 Adtron, Inc. Flash management using bad page tracking and high defect flash memory
CN102831073A (zh) * 2012-08-17 2012-12-19 广东威创视讯科技股份有限公司 一种内存数据处理方法和系统
CN106484472A (zh) * 2016-09-29 2017-03-08 华为技术有限公司 一种内存回收方法及终端
CN107066335A (zh) * 2017-03-23 2017-08-18 华南师范大学 一种云平台内存的优化方法和优化系统

Also Published As

Publication number Publication date
CN109992522A (zh) 2019-07-09

Similar Documents

Publication Publication Date Title
US11099900B2 (en) Memory reclamation method and apparatus
EP3506106B1 (fr) Procédé de traitement d'application, dispositif électronique et support d'informations lisible par ordinateur
WO2022089452A1 (fr) Procédé et appareil de gestion de mémoire, dispositif électronique et support de stockage lisible par ordinateur
EP3506105B1 (fr) Procédé et dispositif de traitement d'une mémoire et support d'informations
WO2019137258A1 (fr) Procédé de traitement de mémoire, dispositif électronique et support de stockage lisible par ordinateur
WO2019137252A1 (fr) Procédé de traitement de mémoire, dispositif électronique et support de stockage lisible par ordinateur
EP3506114B1 (fr) Procédé et dispositif de traitement de mémoire et support d'enregistrement
WO2019128542A1 (fr) Procédé de traitement d'application, dispositif électronique et support d'informations lisible par ordinateur
WO2019128540A1 (fr) Procédé de gestion de ressources, terminal mobile et support d'informations lisible par ordinateur
EP3937016A1 (fr) Procédé et appareil de gestion de mémoire
WO2018045934A1 (fr) Procédé de gestion d'un processus d'application et dispositif terminal
WO2019128588A1 (fr) Procédé et appareil de traitement de processus, dispositif électronique et support d'informations lisible par ordinateur
WO2019128537A1 (fr) Procédé de gel d'application, dispositif informatique, et support de stockage lisible par ordinateur
US11704240B2 (en) Garbage data scrubbing method, and device
WO2019137173A1 (fr) Procédé de gestion de ressources, terminal mobile et support d'informations lisible par ordinateur
WO2019128574A1 (fr) Procédé et dispositif de traitement d'informations, dispositif informatique et support d'informations lisible par ordinateur
WO2019128573A1 (fr) Procédé de traitement d'informations, appareil, dispositif informatique et support d'informations lisible par ordinateur
CN112445766A (zh) 一种终端碎片整理方法、装置以及终端
CN114185494A (zh) 内存匿名页的处理方法、电子设备及可读存储介质
WO2019128569A1 (fr) Procédé et appareil pour geler une application et support de stockage et terminal
CN110007968B (zh) 信息处理方法、装置、计算机设备和计算机可读存储介质
WO2019128545A1 (fr) Procédé de gestion de processus, dispositif électronique et support d'informations lisible par ordinateur

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18893464

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18893464

Country of ref document: EP

Kind code of ref document: A1