WO2020221068A1 - Procédé, appareil et dispositif de gestion de ressources - Google Patents
Procédé, appareil et dispositif de gestion de ressources Download PDFInfo
- Publication number
- WO2020221068A1 WO2020221068A1 PCT/CN2020/085949 CN2020085949W WO2020221068A1 WO 2020221068 A1 WO2020221068 A1 WO 2020221068A1 CN 2020085949 W CN2020085949 W CN 2020085949W WO 2020221068 A1 WO2020221068 A1 WO 2020221068A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- application
- resource
- cache
- file
- size
- Prior art date
Links
Images
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/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0893—Caches characterised by their organisation or structure
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/172—Caching, prefetching or hoarding of files
Definitions
- This application relates to the storage field, and in particular to a resource management method, device and equipment.
- Linux is a multi-user, multi-task, multi-thread and multi-central processing unit (CPU) operating system based on the Portable Operating System Interface of UNIX (Posix) and Unix. It can run major Unix tools, software, applications and network protocols, and supports 32-bit and 64-bit hardware. It is a multi-user network operating system with stable performance. Linux systems can be installed in various computer hardware devices, such as mobile phones, tablets, routers, video game consoles, desktop computers, mainframes, and supercomputers.
- the file cache management algorithm used in the Linux system such as the least recently used (LRU) algorithm. It can be used as a page replacement algorithm.
- LRU least recently used
- the Linux system will try to identify which file cache data is rarely accessed recently, and speculate that it is unlikely to be used for a period of time in the future, so that its memory resources can be recycled first. Make room to load other more valuable data or files.
- the smart phones applied to the Linux system for the early smart phones, due to limited hardware resources, they are generally a typical single-task system.
- the user interacts with the mobile phone through the touch screen.
- the size of the mobile phone screen is small, usually only enough to display an application window in full screen. Therefore, the application displayed on the mobile phone screen is usually the application currently used by the user, and the application is an application at the top ( Sometimes it is also called the foreground application).
- the foreground application enjoys the highest priority privileges.
- the Linux system will provide all the resources of the mobile terminal memory to the foreground application to ensure the foreground application Can bring users the smoothest experience.
- the Linux system will automatically clean up the applications running in the background to free up resources for the foreground applications.
- the file cache management algorithm (LRU-like algorithm) used by the current Linux system has the same rights in treating the file cache corresponding to the foreground application and the background application, that is, an application running in the background can obtain unlimited access Memory resources and network resources.
- a background application continuously obtains large-size video file resources from the network and writes them into the memory of the phone, which in turn causes the background application to occupy and affect the operation of other applications, even the highest priority
- the file cache resources of the foreground application are all occupied by the large-size background application video file, so that the performance of the foreground application and other background applications is degraded due to insufficient file cache resources.
- an embodiment of the present application provides a resource management method, the method includes: an operating system configures a first resource, the first resource is used to read a file related to a first application, and the first resource Less than the total resources occupied by reading the related files of the first application; using the first resource to read the related files of the first application to obtain the first resource occupied when reading the related files of the first application Cache resource; if the size of the first cache resource exceeds the size of the first resource, determine a second resource, and clear the second resource in the first cache resource, so that the second resource is cleared The remaining resources after that continue to read the files related to the first file.
- the method provided in this embodiment sets a threshold value for the first application that has been started, that is, the first resource size, and the threshold value is less than the total resources required by the first application to read related files, thereby controlling the reading of the first application.
- the size of the first cache resource occupied by the related files of an application does not exceed the threshold, thereby preventing the first application from occupying the cache resources without limitation and affecting the operation and use of other applications.
- This method effectively limits certain systems in the system.
- An application such as the memory footprint of a foreground application or a background application, reasonably manages the file cache resources of each application in the system and improves the utilization rate of file cache resources.
- the method further includes: an application scenario event triggered when the system acquires a user operation, where the application scenario event is the first When applying a scene event, determine at least one related file that has a corresponding relationship with the scene event of the first application; read the at least one related file by using the first resource.
- This aspect uses the scene events of the first application to determine the relevant files needed to read the first application, and loads these relevant files in advance, so as to prepare in advance for starting the first application, so that when starting and running the first application, Quickly read related files in the file cache to improve reading speed and operating efficiency.
- the configuring the first resource includes: parsing the configuration file after startup to obtain the quota ratio of the first application cache; according to the current free memory capacity and the first application cache; An application cached quota ratio calculates the absolute value of the quota of the first application; the absolute value of the quota is multiplied by a preset ratio to obtain the size of the first resource.
- the cache quota ratio of each application can be determined and configured, and the size of the first resource can be determined, so as to limit the size of each application not to exceed the size of the first resource when reading related files.
- Each application occupies unlimited file cache resources.
- the method before the configuring the first resource, further includes: receiving, by the operating system, a request message sent by the first application, where the request message is used for Request to read the related file of the first application; determine whether the related file of the first application is stored in the memory RAM; if not, execute the step of configuring the first resource.
- the first application is at least one of the following: a foreground application, a first type of service, a background application, and a second type of service; wherein the first application Class services are used to provide necessary services for the foreground application, and the second type of services are used to provide necessary services for the background application.
- the certain background application can also be switched to the foreground application, and correspondingly, the foreground application displayed on the current terminal interface can also be switched to the background.
- an embodiment of the present application provides a resource management device, the device includes a processing unit and an acquiring unit, and further, the processing unit is used to configure a first resource, and the first resource is used to read the first resource.
- An application related file the obtaining unit is used to obtain the first cache resource occupied when reading the related file of the first application; the processing unit is also used to determine whether the size of the first cache resource exceeds In the case of the size of the first resource, determine a second resource, and clear the second resource in the first cache resource, so that the remaining resources after clearing the second resource can continue to read the first resource.
- Application related files are used to configure a first resource, and the first resource is used to read the first resource.
- the processing unit is specifically configured to respond to the size of the first cache resource, the size of the related file of the first application to be read, and the The first resource determines the second resource.
- the acquiring unit is further configured to acquire an application scenario event triggered when the user operates after the first resource is configured; the processing unit is also configured to When the application scenario event is a scenario event of the first application, determining at least one related file that has a corresponding relationship with the scenario event of the first application, and reading the at least one related file by using the first resource.
- the processing unit is specifically configured to parse the configuration file to obtain the quota ratio of the first application cache, according to the current free memory capacity and the first application cache
- the quota ratio calculates the absolute value of the quota of the first application, and multiplies the absolute value of the quota by a preset ratio to obtain the size of the first resource.
- the acquiring unit is further configured to receive a request message sent by the first application before configuring the first resource, where the request message is used to request Read the related file of the first application; the processing unit is also used to determine whether the related file of the first application is saved; if not, execute the step of configuring the first resource.
- the first application is at least one of the following: a foreground application, a first type of service, a background application, and a second type of service; wherein the first type of service is used to provide necessary services for the foreground application, The second type of service is used to provide necessary services for the background application.
- an embodiment of the present application also provides a terminal device, including a transceiver, a processor, and a memory, the processor is coupled to the memory, and the memory is used to store instructions; and the processor is used to call all The instructions enable the network device to execute the foregoing first aspect and the resource management methods in various implementation manners of the first aspect.
- the embodiments of the present application also provide a computer-readable storage medium.
- the storage medium stores instructions.
- the instructions run on a computer or a processor, they are used to execute the aforementioned first aspect and the first aspect.
- methods in various implementations are also provided.
- the embodiments of the present application also provide a computer program product.
- the computer program product includes computer instructions. When the instructions are executed by a computer or a processor, the foregoing first aspect and various aspects of the first aspect can be implemented. The method in the implementation mode.
- an embodiment of the present application also provides a chip system, the chip system includes a processor and an interface circuit, the interface circuit is coupled with the processor, and the processor is used to execute a computer program or instruction to The foregoing first aspect and the methods in various implementation manners of the first aspect are implemented; wherein the interface circuit is used to communicate with other modules outside the chip system.
- the resource management method, device, and device provided in this embodiment set a threshold value for the first application that has been started, that is, the first resource size, and the threshold value is less than the total resources required by the first application to read related files , So as to control the size of the first cache resource occupied by reading related files of the first application not to exceed the threshold, so as to prevent the first application from occupying the cache resource unlimitedly and affecting the operation and use of other applications.
- This method is effective It limits the memory usage of a certain application in the system, such as the foreground application or the background application, reasonably manages the file cache resources of each application in the system, and improves the utilization rate of file cache resources.
- this method performs active management of file cache in the mobile phone terminal, so as to give priority to ensuring the file cache resources used by the foreground application, and quickly restore the file cache required by the application when the background application is switched to the foreground, thereby improving application performance File input and output efficiency improves user experience.
- FIG. 1 is a schematic structural diagram of a computer system provided by an embodiment of this application.
- FIG. 3 is a schematic structural diagram of a configuration file caching apparatus provided by an embodiment of the application.
- Figure 4 is a flowchart of another resource management method provided by an embodiment of the application.
- FIG. 5 is a flowchart of configuring file cache quota according to an embodiment of the application.
- FIG. 6 is a schematic structural diagram of another configuration file caching apparatus provided by an embodiment of this application.
- FIG. 7 is a schematic structural diagram of a resource management device provided by an embodiment of the application.
- FIG. 8 is a schematic structural diagram of a terminal device provided by an embodiment of the application.
- the technical solution of the embodiment of the present application can be applied to a modern computer system.
- the computer system mainly includes the following components: input device: such as keyboard and mouse, through which the user inputs data and programs; memory: such as Memory, hard disk, used to memorize programs, data, intermediate results, and final calculation results; arithmetic unit: usually integrated in the CPU, support various calculations, and can process data; controller: usually integrated in the CPU to control the program Execution; output devices: such as monitors and printers, which output data processing results to users.
- the memory can be used to store a large amount of programs and data.
- the memory can be divided into main memory and auxiliary memory.
- the main storage is also called internal storage (referred to as memory), and the auxiliary storage is also called external storage (referred to as external storage).
- the so-called “memory” and “external memory” are viewed from the perspective of the CPU.
- the memory is close to the CPU and is connected by a dedicated high-speed channel. It is all integrated circuits and has a fast access speed. Therefore, the program code executed by the CPU and the target data of the operation are directly obtained from the memory. But the capacity of the memory is small and there is no data persistence. Once the power is turned off or there is a power failure, the programs and data in it will be lost.
- external memory The characteristics of external memory are opposite to those of memory. It is far away from the CPU, generally connected by a low-speed channel, and can also include mechanical parts, and the access speed of the external memory is slow; but it has a large capacity and is not afraid of power failure, and can store information for a long time.
- the external storage includes hard disk, magnetic tape, DVD, U disk, solid state disk, etc.
- the external memory is used to store the user’s programs and data.
- the operating system will first load the relevant files of the application from the external memory into the memory, and then use the CPU to carried out. Due to the low access speed of external memory, in order to reduce the number of accesses to external memory and improve input/output (Input/Output, I/O) efficiency, the operating system will allocate a batch of memory or memory resources specifically for storing accessed applications Related documents of the program. In this way, when the application program reads these files again, it can be directly obtained from the memory, avoiding reading from the external memory again, which is slow.
- the memory or memory resources allocated in advance may be referred to as "file cache”, and optionally, it may also be referred to as "page cache” in Linux.
- the file cache management algorithm adopted by the Linux system is the Least Recently Used (LRU) algorithm, or the least recently used algorithm, which instructs the operating system to delete data that is rarely accessed recently in the file cache.
- LRU Least Recently Used
- the memory resources can be recycled first to make room to load more valuable data.
- This embodiment provides a file caching method, which can specifically adopt different resource guarantee strategies for foreground applications and multiple background applications, and improve the efficiency of file caching.
- each third-party application has its own unique identifier, such as a user ID (user ID or uid), which can also be a traditional Unix user ID.
- user ID user ID or uid
- uid Unix user ID
- the operating system allocates file cache, it needs to record and check the user ID that the memory page belongs to. If the file cache occupied by this user ID has reached the upper limit, it will no longer provide memory resources for the application, thereby avoiding unlimited application Occupies cache resources and affects the normal operation of other applications.
- OS operating system
- OS may be a Linux system for an Android system, and may be an IOS system for an Apple system.
- IOS system for an Apple system.
- it may also be other systems, which are not limited in this embodiment.
- the method provided in this embodiment is based on the unique user identification of each application.
- the system allocates and manages the file cache quota (set upper limit) for each application, so as to control the file cache resources used by each application to manage and limit each application.
- the purpose of the application occupying cache resources.
- this embodiment provides a resource management method, which may be executed by the system or operating system of the terminal. Specifically, the method includes:
- Step 101 Receive a first request message sent by a first application, where the first request message is used to request to read related files of the first application.
- the related files include: data files (pictures) or program files necessary to run the first application. Further, the data files include pictures, audio files, video files, etc., and the program files include code or computer to execute the program. program.
- a user triggers or starts a first application, and the first application sends a first request message to the system; wherein the system includes a file cache and a file system, and further, the file cache is The system allocates a batch of memory or memory resources in advance to carry related files of the first application.
- the first application may be at least one of the following: foreground application, first type of service, background application, second type of service, wherein the first type of service is used for foreground application Provide necessary services; the second type of service is used to provide necessary services for background applications.
- the first type of service is a type A service (A_services)
- the second type of service is a type B service (B_services).
- the foreground application is an application currently displayed and running on the screen of the terminal device, that is, an interface of the application displayed to the user on the screen.
- the background application is an application program running in the background of the system, and the interface of the application program is not displayed and presented to the user.
- the background application may be an application previously used by the user and switched to the background, and may be switched to the foreground at any time, and displayed to the user through a screen interface.
- the Type A service and Type B service do not have an interface. They are processes or threads that provide special services for front-end applications or back-end applications with interfaces, such as providing Global Positioning System (GPS) positioning services and audio playback. Service etc.
- GPS Global Positioning System
- the foreground application has a higher priority than the background application.
- the priority of the A service is higher than the B service, so when the memory is insufficient, the background application and the B service are first recycled and cleaned.
- File cache to ensure the normal operation of foreground applications and Class A services.
- the system obtains the request message sent by the first application in real time, and the request message includes related information of the file to be read, such as the file name, file address, and file size.
- Step 102 Determine whether relevant files of the first application are stored.
- the system detects whether relevant files of the first application are stored in the internal memory (such as RAM).
- the internal memory such as RAM
- the judgment process in step 102 may be implemented by the quota management module shown in FIG. 3.
- Step 103 If yes, send related files of the first application to the first application, so that the first application can be quickly started and run.
- Step 104 If not, configure the first resource and use the first resource to read related files of the first application. Specifically, as shown in FIG. 4, step 104 specifically includes:
- Step 1041 The system configures a first resource, and the first resource is used to read related files of the first application.
- the size of the first resource is smaller than the total resource size occupied by the relevant file for reading the first application.
- the first resource may also be referred to as a first file cache.
- the process of configuring the first resource includes: first, after the system is started, the configuration file is parsed to obtain the cache quota ratio of the first application, and then the first application cache quota ratio is calculated according to the current free memory capacity and the first application cache quota ratio. An absolute value of an applied quota is finally multiplied by a preset ratio to obtain the size of the first resource.
- the configuration file includes the correspondence between the user ID of each application and at least one cache quota ratio.
- the cache quota ratio may be preset by the system, that is, the user ID of each application and a cache are established. Correspondence between quota ratios. For example, as shown in Figure 5, after the system is started, the configuration file is parsed and the cache quota ratio corresponding to the user ID of each application is configured.
- the corresponding cache quota ratios of the foreground application, background application, type A service, and type B service are respectively: 60%, 10%, 20%, 10%.
- the absolute value of the quota of each application is calculated according to the corresponding relationship, which are respectively: 600M, 100M, 200M, and 100M.
- the preset ratio is 80%
- the absolute value of the quota of each application is multiplied by the preset ratio to obtain the size of the first resource: 480M, 80M, 160M, and 80M.
- the preset ratio may also be another ratio, which is not limited in this embodiment.
- Step 1042 Obtain the first cache resource occupied when reading the related file of the first application.
- the obtaining of the first cache resource is a process of obtaining the first cache resource dynamically by the system in real time, or the first cache resource is obtained once every time interval has elapsed.
- the operating system kernel can control the usage of system resources, and the resources occupied by each application process are accounted for, including used memory resources, open files, and so on.
- the "Memory Resource Controller" function when enabled, each application process will be recorded in the system when applying for or releasing the file cache, so the operating system can obtain each application process (including the first One application) The occupied value of the file cache, that is, the size of the first cache resource.
- Step 1043 If the size of the first cache resource exceeds the size of the first resource, determine a second resource, and clear the second resource in the first cache resource, so that the second resource is cleared The remaining resources after that continue to read related files of the first application.
- the exceeding of the first resource size may be understood as a resource currently occupied by reading related files of the first application greater than the size of the first resource.
- the determining the second resource includes: determining the second resource according to the first cache resource, the size of the related file of the first application to be read, and the first resource.
- the second resource size the first cache resource size+the size of the related file of the first application to be read-the first resource size, and the size of the resource cleared in step 1043 is not less than the The size of the second resource.
- the size of the first resource is 80M
- the currently detected size of the first cache resource is 100M
- the size of the related file to be read is 5M
- the size of the resource cleared in the first cache resource is at least 25M.
- the size of the related file of the first application to be read may be determined through a first request message.
- the system obtains the first request message sent by the first application in real time.
- the first request message includes the file name, address, and file size of the file to be read.
- the system receives the first request message, it determines according to the content contained therein.
- the size of the file to be read is used to determine the size of the resources that are still needed.
- the size of the file to be read can also be obtained in other ways, which is not limited in this embodiment.
- the method further includes: if it is currently detected that the size of the first cache resource is less than or equal to the size of the first resource, that is, the resource currently occupied by reading related files of the first application is less than the configured first resource. Resource size, continue to use the first cache resource to read related files of the first application.
- the threshold value that is, the first resource
- the threshold value is set for the first application that has been started, and the threshold value is less than the total resources required by the first application to read related files, thereby controlling the reading of the first application.
- the size of the first cache resource occupied by the related files of an application does not exceed the threshold, thereby preventing the first application from occupying the cache resources without limitation and affecting the operation and use of other applications.
- This method effectively limits certain systems in the system.
- An application such as the memory footprint of a foreground application or a background application, reasonably manages the file cache resources of each application in the system and improves the utilization rate of file cache resources.
- this embodiment takes the first application as a background application, and the first resource as an example of the background application and type B service.
- the cache quota ratios of back-end applications and class B services obtained by analyzing the configuration file are 10% and 10%, respectively. Then calculate the absolute value of the quota of the background application and the category B service according to the system's free content capacity of 1G to be 100M, and calculate the first resource size of the background application and the category B service to be 80M according to a preset ratio of 80%.
- the system detects at a certain moment that the first cache resource occupied by the background application is 100M, and the first cache resource occupied by type B services is 200M, both of which exceed the first resource size (80M) configured respectively, so it is determined And clear the second resource.
- the second resource may be the resource occupied by the file that was previously cached in the first cache resource, and the second resource is recycled.
- the second resource is 80M.
- the file cache occupied by the application is 20M
- the file cache occupied by the B-type service is 30M, which is lower than the configured first resource size of 80M. Therefore, the background application and the B-type service can continue to use the file cache to read related files after recovery.
- one way of recovering the file is to select the file loaded in the first cache resource, copy it to the external storage, and then delete the part of the file, so as to free up some resources for the first time.
- a cache resource is smaller than the corresponding first resource size.
- the method further includes: setting a timer to trigger periodic calculation of the quota, periodic detection and recycling of the file cache of each application. For example, when the timer reaches a predetermined time, the system calculates the absolute value of each application quota according to the current free memory size and allocates the updated first resource size; and detects that the current first cache resource size occupied by each application exceeds the updated first resource size The first resource is to recover the second resource occupied by the file previously loaded by the application. And after the recovery is complete, reset the timer.
- the method further includes: the system determines whether the first cache resource occupied by the foreground application and the type A service each exceeds the corresponding first resource, because the first cache resource size currently detected by the foreground application and the type A service None of them exceed the size of the first resource, so you can continue to read related files of foreground applications and Class A services.
- the specific detection and recovery method is the same as the foregoing background application and type B service recovery process, and will not be repeated here.
- the method provided in this embodiment implements active file cache management in the mobile phone terminal, thereby prioritizing the file cache resources used by the foreground application, and quickly restores the file cache required by the application when the background application is switched to the foreground, thereby improving This improves the application’s file input and output efficiency and improves user experience.
- the process of using the first resource to read the related file of the first application further includes the step of loading the related file in advance by the system, so that the first application can be It can read and run quickly, improving the startup speed and running fluency of the first application.
- the system acquires application scenario events triggered when a user operates, where each application corresponds to an application scenario event in advance, and when the application scenario event is a scenario event of the first application, Determine at least one related file that has a corresponding relationship with the scene event of the first application, and use the first resource to read the at least one related file in advance.
- the process of reading related files of the first application in advance by the system includes: the detection module of the system detects an application request triggered when the user operates the mobile phone terminal, and the application request is used to trigger the first application
- the application scenario event of the first application includes: the user starts the first application for the first time, for example, opens a window of the first application.
- the loading management module receives the application request sent by the detection module, and finds whether there is a file cache storing related files required by the first application; if not, the quota management module configures the first resource for the first application, and then
- the related files of the first application are obtained from the external storage. In the process of obtaining the related files from the external storage,
- the quota management module detects whether the first cache resource currently occupied by the relevant file of the first application exceeds a preset threshold (that is, the size of the first resource), and if it exceeds, it initiates an external memory reading to the file system. For the related file actions, after the file system obtains the related files from the external storage, these related files are stored in the file cache, so that when the first application starts, the system can directly cache the files of the first application in the file cache. Relevant files are provided to the first application to avoid obtaining them from the external memory. This method improves the reading speed and speeds up the operating efficiency of the first application due to the file cache in the internal memory.
- a preset threshold that is, the size of the first resource
- the method includes: when the user operates the mobile phone terminal, triggering a first application request, the first application requesting to start a file access requirement configuration file, and determining the application scenario event of the first application, and the application scenario At least one related file corresponding to the event.
- the file access requirement configuration file includes at least one corresponding relationship, and the corresponding relationship is a corresponding relationship between an application scenario event and at least one related file.
- the first application scenario event corresponds to related files a and b
- the second application scenario event corresponds to related file c.
- the related files a, b, or c are popular files that need to be read frequently when running a certain application, for example, when the first application is started for the first time, files a and b need to be read; when the second application is started, a certain window is opened In the interface, file c needs to be read.
- the detection module of the system After detecting the first application request, the detection module of the system obtains the application scenario event of the first application associated with the first application, and then according to the application scenario event of the first application and the corresponding relationship in the file access requirement configuration file Determine its corresponding related documents. For example, the detection module determines that the current first application scenario event corresponds to related files a and b, and then sends first indication information to the load management module, where the first indication information is used to instruct to obtain related files a and b.
- the loading management module receives the first instruction information and obtains the related files a and b from the file system. In the process of reading the related files a and b, the quota management module is used to detect in real time the first occupied files a and b. 1. Whether the cache resource exceeds the preset first resource (quota threshold), if it exceeds, the file cache recovery operation is performed to limit the size of the first cache resource and prevent reading related files a and b from occupying memory without limitation Resources.
- the process of loading files in advance described in the foregoing embodiment may include the following steps:
- the system determines whether to load the relevant files of the first application in advance according to the current free capacity
- the system allocates and manages file cache quotas based on the unique user identification of the application, thereby setting the resource size of the file cache occupied by each application, so as to prevent each application from occupying memory resources unlimitedly when reading related files, which affects The operation of other applications.
- the system configures the corresponding first resource for each application according to the role of the application (foreground application, background application, type A service, type B service), combined with the current free memory capacity of the system, so as to make the total memory resource of the system Reasonably allocate to different uses, for example, the cache resources enjoyed by foreground applications and type A services are higher than those of background applications and type B services, thereby improving user experience.
- a resource management device provided by this embodiment is used to implement the method in the foregoing embodiment.
- the device includes: an obtaining unit 701 and a processing unit 702.
- the device may also include more units, such as a sending unit, a storage unit, etc., which are not limited in this embodiment.
- the processing unit 702 is configured to configure a first resource, where the first resource is used to read related files of the first application, where the first resource is less than the total resources occupied by reading the related files of the first application;
- the unit 701 is configured to obtain the first cache resource occupied when the related file of the first application is read;
- the processing unit 701 is also configured to: when the size of the first cache resource exceeds the size of the first resource In the case of determining the second resource, and clearing the second resource in the first cache resource, so that the remaining resources after clearing the second resource can continue to read the first application related file.
- the first application is at least one of the following: foreground application, first type service, background application, second type service.
- the first type of service is used to provide necessary services for the foreground application
- the second type of service is used to provide necessary services for the background application.
- the first type of service is a type A service
- the second type of service is a type B service.
- the processing unit 702 is specifically configured to determine the size of the related file of the first application to be read according to the first cache resource, and the The first resource determines the second resource.
- the acquiring unit 701 is further configured to acquire an application scenario event triggered when the user operates after the first resource is configured; the processing unit 702 is also configured to When the application scene event is a scene event of the first application, determine at least one read file that has a corresponding relationship with the scene event of the first application; and use the first resource to read the at least one Related documents.
- the processing unit 702 is specifically configured to parse the configuration file when the operating system is started to obtain the quota ratio of the first application cache, according to the current free memory capacity and the The quota ratio cached by the first application calculates the absolute value of the quota of the first application, and multiplies the absolute value of the quota by a preset ratio to obtain the size of the first resource.
- the preset ratio is 80%.
- the acquiring unit 701 is further configured to receive a request message sent by the first application before configuring the first resource for the first application.
- the request message It is used to request to load the first application; the processing unit 702 is also used to determine whether the relevant file of the first application is saved; if not, execute the step of configuring the first resource.
- processing unit 702 is further configured to, if yes, directly send the related files of the first application cached in the internal memory RAM to the first application through the sending unit.
- the receiving unit, the processing unit, and the sending unit in the device embodiment can be implemented by software, hardware, or a combination of software and hardware.
- the software can be run on a computer or a processor.
- the acquisition unit and the processing unit may be integrated in the processor of the terminal device or a software module required for processing operation or a combination of the two.
- an embodiment of the present application also provides a terminal device for implementing part or all of the steps of the resource management method described in the foregoing embodiment.
- the terminal device includes: a transceiver 801, a processor 802, and a memory 803.
- the terminal device may also include more or fewer components, or a combination of some components, or different components. The arrangement of components is not limited in this application.
- the transceiver 801 is used to establish a communication channel so that the terminal device can connect to a network, such as a WiFi network system or a cellular network, through the communication channel, so as to realize communication transmission between the terminal device and other network devices.
- the transceiver 801 may include components such as a receiver, a transmitter and an antenna, or may also include radio frequency components such as a receiver and a transmitter, and further, the radio frequency components may include a wireless local area network (WLAN)
- WLAN wireless local area network
- At least part of the communication modules such as modules, Bluetooth modules, baseband modules, and radio frequency (RF) circuits corresponding to the communication modules are used for wireless local area network communication, Bluetooth communication, infrared communication and/or cellular Communication system, such as wideband code division multiple access (WCDMA) and/or high-speed downlink packet access (HSDPA).
- WCDMA wideband code division multiple access
- HSDPA high-speed downlink packet access
- the transceiver is also used to control the communication between
- the processor 802 is the control center of the terminal device, which uses various interfaces and lines to connect the various parts of the entire hardware device, runs or executes software programs and/or modules stored in the memory 803, and calls Data to perform various functions of the terminal device.
- the processor 802 may include one or more integrated circuits (ICs) or chips, for example, may include a single packaged IC, or may include multiple packaged ICs connected with the same function or different functions.
- the processor may only include a CPU, or may further include a combination of a GPU, a digital signal processor (digital signal processor, DSP), and a control chip in the transceiver module.
- ICs integrated circuits
- DSP digital signal processor
- the memory 803 is used to store program codes for executing the technical solutions of the present application, and the processor 802 controls the execution. Further, the processor 802 is configured to execute the computer program code stored in the memory 803 to implement the resource management method in the foregoing embodiment.
- the memory can be read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), or can store information and instructions
- ROM read-only memory
- RAM random access memory
- Other types of dynamic storage devices can also be Electrically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory, CD-ROM or other optical disk storage, Optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program codes in the form of instructions or data structures and can Any other medium accessed by the computer, but not limited to this.
- the memory can exist independently or integrated with the processor.
- the function to be implemented by the obtaining unit 701 may be implemented by the transceiver 801 of the terminal device; the function to be implemented by the processing unit 702 may be implemented by the processor 802.
- the functions of the detection module, quota management module, load management module, and file system in the system can all be implemented by the transceiver 801 and the processor 802 of the terminal device.
- the functions of the internal memory and external memory can be implemented by the memory 803, and the application can be configured in an operating system, such as an Android system or an IOS system.
- the terminal device described in this embodiment may be a mobile terminal, such as a mobile phone (or called a "cellular" phone) and a computer with a mobile terminal.
- a mobile terminal such as a mobile phone (or called a "cellular" phone) and a computer with a mobile terminal.
- it may be portable, pocket-sized, handheld, built-in computer, or vehicle-mounted.
- Mobile devices which exchange language and/or data with the wireless access network.
- PCS personal communication service
- SIP Session Initiation Protocol
- WLL wireless local loop
- PDAs personal digital assistants
- the wireless terminal may also be a subscriber unit (subscriber unit), subscriber station (subscriber station), mobile station (mobile station), mobile station (mobile), remote station (remote station), access point (access point), remote station Terminal (remote terminal), access terminal (access terminal), user terminal (user terminal), user agent (user agent), user equipment (user device) or user equipment (user equipment, UE), etc., embodiments of this application
- subscriber unit subscriber unit
- subscriber station subscriber station
- mobile station mobile station
- mobile station mobile station
- remote station remote station
- access point access point
- remote station Terminal remote station
- access terminal access terminal
- user terminal user terminal
- user agent user agent
- user equipment user device
- user equipment user equipment
- the present application also provides a computer storage medium, where the computer storage medium may store a program, and the program may include some or all of the steps in each embodiment of the antenna selection method provided in the present application when the program is executed.
- the storage medium can be a magnetic disk, an optical disk, ROM or RAM, etc.
- all or part of it may be implemented by software, hardware, firmware or any combination thereof.
- When implemented by software it can be implemented in the form of a computer program product in whole or in part.
- the computer program product includes one or more computer instructions, such as an antenna selection instruction or an antenna avoidance instruction.
- the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
- the computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium.
- the computer instructions may be transmitted from a network node, computer, server, or data center. Transmission to another site, computer or server via wired or wireless means.
- the computer-readable storage medium may be any available medium that can be accessed by a computer or a storage device such as a server or data center integrated with one or more available media.
- the usable medium may be a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape, an optical medium (such as a DVD), or a semiconductor medium, such as a solid-state hard disk (SSD).
- the technology in the embodiments of the present application can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solutions in the embodiments of the present application can be embodied in the form of a software product in essence or a part that contributes to the prior art.
- the computer software product can be stored in a storage medium, such as ROM/RAM , Magnetic disks, optical disks, etc., including a number of instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments of the present invention.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Stored Programmes (AREA)
Abstract
L'invention concerne un procédé, un appareil et un dispositif de gestion de ressources. Le procédé selon l'invention consiste : à configurer une première ressource utilisée pour lire un fichier associé d'une première application (1041) ; à obtenir une première ressource de cache occupée lorsque le fichier associé de la première application est lu (1042) ; et si la taille de la première ressource de cache dépasse la taille de la première ressource, à déterminer une deuxième ressource et à effacer la deuxième ressource de la première ressource de cache, de sorte que les ressources restantes après que la deuxième ressource a été effacée continuent à lire le fichier associé de la première application (1043). Selon le procédé, une valeur seuil, à savoir la taille de la première ressource, est réglée pour réguler la taille de la première ressource de cache occupée par la lecture du fichier associé de la première application pour qu'elle ne dépasse pas la valeur seuil, de sorte à éviter une situation dans laquelle le fonctionnement et l'utilisation d'autres applications sont affectées en raison d'une occupation illimitée de ressources de cache par la première application, et à augmenter le taux d'utilisation de ressources de cache de fichier.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910362513.X | 2019-04-30 | ||
CN201910362513.XA CN110134655A (zh) | 2019-04-30 | 2019-04-30 | 一种资源管理方法、装置和设备 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020221068A1 true WO2020221068A1 (fr) | 2020-11-05 |
Family
ID=67575997
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/085949 WO2020221068A1 (fr) | 2019-04-30 | 2020-04-21 | Procédé, appareil et dispositif de gestion de ressources |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110134655A (fr) |
WO (1) | WO2020221068A1 (fr) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110134655A (zh) * | 2019-04-30 | 2019-08-16 | 华为技术有限公司 | 一种资源管理方法、装置和设备 |
CN111104180B (zh) * | 2019-12-11 | 2021-08-03 | 惠州Tcl移动通信有限公司 | 应用程序优化方法、装置、存储介质及电子设备 |
CN113076194A (zh) * | 2021-03-29 | 2021-07-06 | Oppo广东移动通信有限公司 | 内存资源分配方法、装置、终端和存储介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105740078A (zh) * | 2016-01-29 | 2016-07-06 | 华为技术有限公司 | 一种内存管理方法、装置及终端 |
CN105824702A (zh) * | 2016-03-22 | 2016-08-03 | 乐视云计算有限公司 | 一种管理程序内存占用量的方法和终端 |
CN106776368A (zh) * | 2016-11-29 | 2017-05-31 | 郑州云海信息技术有限公司 | 一种数据读取时的缓存管理方法、装置及系统 |
US20170177255A1 (en) * | 2015-12-17 | 2017-06-22 | Le Holdings (Beijing) Co., Ltd. | Method and electronic device for allocating dynamic memory resources |
CN108073520A (zh) * | 2016-11-10 | 2018-05-25 | 腾讯科技(深圳)有限公司 | 一种内存控制方法及装置 |
CN110134655A (zh) * | 2019-04-30 | 2019-08-16 | 华为技术有限公司 | 一种资源管理方法、装置和设备 |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003288266A (ja) * | 2002-03-28 | 2003-10-10 | Fujitsu Ltd | メモリ割当方法及びそのプログラム |
CN107145392A (zh) * | 2017-04-26 | 2017-09-08 | 努比亚技术有限公司 | 一种优化内存的方法及设备 |
CN108920271A (zh) * | 2018-05-17 | 2018-11-30 | 广州优视网络科技有限公司 | 应用缓存清理方法、装置、存储介质和终端 |
-
2019
- 2019-04-30 CN CN201910362513.XA patent/CN110134655A/zh active Pending
-
2020
- 2020-04-21 WO PCT/CN2020/085949 patent/WO2020221068A1/fr active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170177255A1 (en) * | 2015-12-17 | 2017-06-22 | Le Holdings (Beijing) Co., Ltd. | Method and electronic device for allocating dynamic memory resources |
CN105740078A (zh) * | 2016-01-29 | 2016-07-06 | 华为技术有限公司 | 一种内存管理方法、装置及终端 |
CN105824702A (zh) * | 2016-03-22 | 2016-08-03 | 乐视云计算有限公司 | 一种管理程序内存占用量的方法和终端 |
CN108073520A (zh) * | 2016-11-10 | 2018-05-25 | 腾讯科技(深圳)有限公司 | 一种内存控制方法及装置 |
CN106776368A (zh) * | 2016-11-29 | 2017-05-31 | 郑州云海信息技术有限公司 | 一种数据读取时的缓存管理方法、装置及系统 |
CN110134655A (zh) * | 2019-04-30 | 2019-08-16 | 华为技术有限公司 | 一种资源管理方法、装置和设备 |
Also Published As
Publication number | Publication date |
---|---|
CN110134655A (zh) | 2019-08-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3851956B1 (fr) | Procédé et appareil pour accélérer le démarrage à froid d'application | |
WO2020221068A1 (fr) | Procédé, appareil et dispositif de gestion de ressources | |
EP3506106B1 (fr) | Procédé de traitement d'application, dispositif électronique et support d'informations lisible par ordinateur | |
EP3863337B1 (fr) | Dispositif et procédé d'attribution de bwp | |
US11586544B2 (en) | Data prefetching method and terminal device | |
EP3506114B1 (fr) | Procédé et dispositif de traitement de mémoire et support d'enregistrement | |
WO2019128434A1 (fr) | Procédé et dispositif permettant de traiter une mémoire, et support d'informations | |
US20200229024A1 (en) | Data sending method and apparatus, and device | |
WO2005091705A2 (fr) | Systeme de gestion d'energie et procede destine a un dispositif de communications sans fil | |
US20180365050A1 (en) | Method for Controlling Process and Related Device | |
US11096177B2 (en) | Operation mode switching method and user equipment | |
US20120331323A1 (en) | Devices and methods for saving energy through control of sleep mode | |
CN106897299B (zh) | 一种数据库访问方法及装置 | |
JP7558307B2 (ja) | 無線周波数リソース割り当て方法、装置及び電子機器 | |
US20180034894A1 (en) | Data Transmission Method, and Terminal | |
WO2019072020A1 (fr) | Procédé de gestion de bande passante de réseau, terminal et support d'enregistrement d'ordinateur | |
US10224972B2 (en) | Systems, methods, and computer-readable media for tracking updates and loading data | |
JP2020511819A (ja) | ネットワーク接続方法及び装置 | |
CN108958807B (zh) | 一种终端系统启动方法及终端 | |
CN111698275B (zh) | 数据处理方法、装置及设备 | |
US10575365B2 (en) | PDN connection release method and apparatus, and user equipment | |
CN114424611A (zh) | 网络功能的控制 | |
CN115460665A (zh) | 网络的切换方法和装置 | |
US20100251251A1 (en) | Apparatus and method for cpu load control in multitasking environment | |
WO2024174611A1 (fr) | Procédé et appareil de commande de commutation de réseau |
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: 20798885 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: 20798885 Country of ref document: EP Kind code of ref document: A1 |