CN111949492B - System resource obtaining method and device and terminal equipment - Google Patents

System resource obtaining method and device and terminal equipment Download PDF

Info

Publication number
CN111949492B
CN111949492B CN202010841312.0A CN202010841312A CN111949492B CN 111949492 B CN111949492 B CN 111949492B CN 202010841312 A CN202010841312 A CN 202010841312A CN 111949492 B CN111949492 B CN 111949492B
Authority
CN
China
Prior art keywords
memory
system resource
acquiring
new
occupied
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010841312.0A
Other languages
Chinese (zh)
Other versions
CN111949492A (en
Inventor
姚坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Realme Mobile Telecommunications Shenzhen Co Ltd
Original Assignee
Realme Mobile Telecommunications Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Realme Mobile Telecommunications Shenzhen Co Ltd filed Critical Realme Mobile Telecommunications Shenzhen Co Ltd
Priority to CN202010841312.0A priority Critical patent/CN111949492B/en
Publication of CN111949492A publication Critical patent/CN111949492A/en
Application granted granted Critical
Publication of CN111949492B publication Critical patent/CN111949492B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/3013Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is an embedded system, i.e. a combination of hardware and software dedicated to perform a certain function in mobile devices, printers, automotive or aircraft systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3051Monitoring arrangements for monitoring the configuration of the computing system or of the computing system component, e.g. monitoring the presence of processing resources, peripherals, I/O links, software programs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/32Monitoring with visual or acoustical indication of the functioning of the machine
    • G06F11/324Display of status information
    • G06F11/328Computer systems status display

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Computer Hardware Design (AREA)
  • Stored Programmes (AREA)
  • Telephone Function (AREA)

Abstract

The application is applicable to the technical field of system resource information acquisition, and provides a system resource acquisition method, a device and terminal equipment, wherein the system resource acquisition method comprises the following steps: acquiring a system resource acquisition instruction sent by a user in a preset application button or cnd instruction mode; acquiring system resources occupied by the process of the terminal equipment according to the system resource acquisition instruction, wherein the system resources comprise a memory; and determining a sequencing result according to system resources occupied by different processes, and displaying the sequencing result. By the method, the user can quickly and accurately obtain the sequencing result related to the memory occupied by the process.

Description

System resource obtaining method and device and terminal equipment
Technical Field
The present application belongs to the technical field of system resource information acquisition, and in particular, to a method and an apparatus for acquiring system resources, a terminal device, and a computer-readable storage medium.
Background
At present, a user cannot know memory information of a terminal device based on an Android system used by the user, and the user can usually estimate whether the terminal device has insufficient memory when the terminal device encounters a system pause, or a small part of users with professional knowledge can acquire the memory information of the terminal device according to an instruction, for example, the corresponding memory information is acquired through a "/proc/meminfo" instruction.
In the existing technical scheme for monitoring the memory of the terminal equipment based on the Android system, the current use situation of the memory of the terminal equipment cannot be ascertained if some professional instructions or professional tools are not used. That is, the memory information of the terminal device is hidden/semi-hidden for the user, which brings great inconvenience to the user who needs to visually check the state of the terminal device (such as a mobile phone). In addition, even for a user with professional knowledge, the acquired memory information is not detailed enough, or the data volume is too large, the acquisition time is long, and the memory information which is not the focus of the user exists, so that the user is difficult to acquire the required information quickly.
Therefore, it is necessary to provide a new method to solve the above technical problems.
Disclosure of Invention
The embodiment of the application provides a system resource obtaining method, which can solve the problem that the existing method is difficult to obtain the memory information quickly.
In a first aspect, an embodiment of the present application provides a system resource obtaining method, which is applied to a terminal device based on an android system, and includes:
acquiring a system resource acquisition instruction sent by a user in a preset application button or cnd instruction mode;
acquiring system resources occupied by the process of the terminal equipment according to the system resource acquisition instruction, wherein the system resources comprise a memory;
and determining a sequencing result according to system resources occupied by different processes, and displaying the sequencing result.
Compared with the prior art, the embodiment of the application has the advantages that:
the terminal equipment acquires a system resource acquisition instruction sent by a user through a preset application button or cmd mode, and the terminal equipment can directly acquire the system resource occupied by the process and display the sequencing result after sequencing. Because the system resource comprises the memory, the sequencing result is the sequencing result of the memory occupied by the processes, and the sequenced sequencing result is more convenient for a user to quickly focus, namely, the user can quickly know which processes occupy the most memory and which processes occupy the least memory. In addition, the user can obtain the sequencing result of the memory occupied by the process only by sending out the system resource acquisition instruction in a preset application button or cmd mode, so the operation is simple, and the operation complexity of the user is reduced.
In a second aspect, an embodiment of the present application provides a system resource obtaining apparatus, which is applied to a terminal device based on an android system, and includes:
the system resource acquisition instruction acquisition module is used for acquiring a system resource acquisition instruction sent by a user in a preset application button or cnd instruction mode;
the system resource acquisition module is used for acquiring system resources occupied by the process of the terminal equipment according to the system resource acquisition instruction, and the system resources comprise a memory;
and the sequencing result display module is used for determining a sequencing result according to the system resources occupied by different processes and displaying the sequencing result.
In a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program that is stored in the memory and is executable on the processor, where the terminal device is based on an android system, and the processor implements the method according to the first aspect when executing the computer program.
In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a computer program product, which, when run on a terminal device, causes the terminal device to execute the method described in the first aspect.
It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the embodiments or the description of the prior art will be briefly described below.
Fig. 1 is a schematic flowchart of a system resource obtaining method according to an embodiment of the present application;
FIG. 2 is a diagram of a preset application button provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a system resource obtaining apparatus according to a second embodiment of the present application;
fig. 4 is a schematic structural diagram of a terminal device according to a third embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The first embodiment is as follows:
at present, when a user wants to acquire memory information of a terminal device, the user needs to send a professional instruction or obtain the memory information through a professional tool, and the information obtained through the professional instruction or the professional tool includes other types of information besides the memory information. That is, the existing memory information obtaining method has high requirements on users, which results in difficulty in obtaining the memory information, and the obtained information is more, which is not convenient for the users to obtain the required memory information quickly. In order to solve the above technical problem, an embodiment of the present application provides a method for acquiring system resources. In the method for acquiring system resources, a terminal device acquires a system resource acquisition instruction sent by a user in a preset application button or cmd (Command) mode, and the terminal device can directly acquire system resources occupied by a process and display a sequencing result after sequencing. Because the system resource comprises the memory, the sequencing result is the sequencing result of the memory occupied by the process, and the sequenced memory is more convenient for the user to focus quickly. In addition, the user can obtain the sequencing result of the memory occupied by the process only by sending out the system resource acquisition instruction in a preset application button or cmd mode, so the operation is simple, and the operation complexity of the user is reduced.
Fig. 1 shows a flowchart of a system resource obtaining method provided in an embodiment of the present application, which is applied to a terminal device based on an android system, where the terminal device may be a mobile phone based on the android system, a wearable device, and the system resource obtaining method includes:
and step S11, acquiring a system resource acquisition instruction sent by a user in a preset application button or cmd instruction mode.
The preset application buttons are buttons represented by pictures and/or characters. For the convenience of user operation, the preset application button is displayed on the screen of the terminal device, as shown in fig. 2. And after the user triggers the application button, the terminal equipment receives a system resource acquisition instruction.
The cmd mode is to open a cmd command line window and send a system resource acquisition instruction on the corresponding command line window. In this embodiment, after the user inputs information related to system resource acquisition in the cmd command line window, the terminal device determines to acquire a system resource acquisition instruction. In some embodiments, in order to avoid an error in the recognition of the user intention by the terminal device, after the user inputs information related to system resource acquisition in the cmd command line window, the terminal device prompts whether the user wishes to acquire the system resource, and if a confirmation instruction sent by the user is received, it is determined that the system resource acquisition instruction is acquired.
And S12, acquiring the system resources occupied by the process of the terminal equipment according to the system resource acquisition instruction, wherein the system resources comprise a memory.
In this embodiment, the terminal device can acquire the system resource occupied by the process of the terminal device according to the system resource acquisition instruction, and in view of that the user is only interested in the system resource occupied by the process being started, the terminal device only acquires the system resource occupied by the process being started, so as to improve the acquisition speed of the system resource.
In some embodiments, if the number of the processes being started by the terminal device is large (for example, greater than the preset number threshold), since the user is usually interested in only the first few processes that occupy the most system resources, in order to further increase the acquisition speed of the system resources, only the system resources occupied by the processes being started, which are ranked at the top and have the preset number of occupied system resources, are acquired. Wherein the preset number can be determined in the following manner: and taking the number of lines which can be displayed on one page of the terminal equipment as the preset number. For example, it is assumed that the number of lines that can be displayed on one page of the terminal device is 15 lines, and the preset number is 15. That is, the system resources occupied by the first 15 processes occupying the most system resources are acquired.
In some embodiments, the system resources may also include a Central Processing Unit (CPU) and Input/Output (I/O).
And S13, determining a sequencing result according to system resources occupied by different processes, and displaying the sequencing result.
Specifically, the terminal device sorts the system resources occupied by different processes from high to low, and obtains and displays a sorting result.
In the embodiment of the application, the terminal device obtains the system resource obtaining instruction sent by the user through a preset application button or cmd mode, and the terminal device can directly obtain the system resources occupied by the processes and display the sequencing result after sequencing. Because the system resource comprises the memory, the sequencing result is the sequencing result of the memory occupied by the processes, and the sequenced sequencing result is more convenient for a user to quickly focus, namely, the user can quickly know which processes occupy the most memory and which processes occupy the least memory. In addition, the user can obtain the sequencing result of the memory occupied by the process only by sending out the system resource acquisition instruction in a preset application button or cmd mode, so the operation is simple, and the operation complexity of the user is reduced.
In some embodiments, when the sorting result is the memory occupied by each process, it is difficult for a user to quickly know from the sorting result whether a process occupies more or less memory than other processes, so as to facilitate the user to know from the sorting result which process occupies more memory and which process occupies less memory, and then calculate a ratio of the memory occupied by each process to the memory used by the terminal device, specifically, before the step S12, the method includes:
a1, acquiring all available memories and unused memories of the terminal equipment according to the system resource acquisition instruction.
Specifically, all available memory of the terminal device is determined from the kernel, and unused memory of the terminal device may be determined from an Activity Manager Service (AMS).
And A2, determining the used memory according to all available memories and unused memories of the terminal equipment.
Specifically, all available memories of the terminal device are differentiated from unused memories to obtain used memories of the terminal device.
The step S12 includes:
and acquiring the memory occupied by the process of the terminal equipment according to the system resource acquisition instruction.
The step S13 includes:
and determining the ratio of the memory occupied by each process to the used memory, determining the sequencing result of each process according to the ratio, and displaying the sequencing result.
Specifically, when the terminal device obtains the memory occupied by each process (for example, the process which has the most occupied memory and is ranked at the front and is being started), the ratio of the memory occupied by each process to the used memory is calculated for each process, and then the sorting result is determined and displayed according to the size of the ratio. For example, if the ratio of the memory occupied by the process 1 to the memory used by the terminal device is 1/100, and the ratio of the memory occupied by the process 2 to the memory used by the terminal device is 2/100, the displayed ordering result may be: process 2,2/100; process 1,1/100. That is, the ratio corresponding to the process 2 is displayed first, and then the ratio corresponding to the process 1 is displayed.
In some embodiments, because the unused memory of the terminal device is dynamically changed, in order to ensure the accuracy of the displayed sorting result, a preset period refresh duration is determined, and after the period refresh duration is reached, the terminal device reacquires the unused memory and the memories occupied by different processes, specifically, after step A1, the method includes:
and if the preset periodic refreshing time length is reached, acquiring a new unused memory, wherein the preset periodic refreshing time length is the time length for periodically acquiring data.
The step A2 includes:
and determining a new used memory according to all available memories and a new unused memory of the terminal equipment.
The step S12 includes:
and if the preset periodic refreshing time length is reached, acquiring a new memory occupied by the process of the terminal equipment according to the system resource acquisition instruction.
When determining the ratio of the memory occupied by each process to the used memory, determining the sorting result of each process according to the ratio, and displaying the sorting result, the step S13 includes:
determining the ratio of the new memory occupied by each process to the new used memory to obtain a new ratio, determining a new sorting result of each process according to the new ratio, displaying the new sorting result, and returning to the step of obtaining the new unused memory and the subsequent steps if the preset periodic refreshing time is up until an instruction of stopping obtaining data is received.
In this embodiment, since the terminal device displays the sorting result after determining the sorting result, for example, the sorting result is displayed through a display interface, in the process of displaying the sorting result on the display interface, if the terminal device does not receive an instruction to stop obtaining data, after a preset period refresh duration is reached each time, the memory unused by the terminal device and the memory occupied by each process are obtained again, a new sorting result is obtained according to newly obtained data, and then, the display interface displays the new sorting result, thereby implementing the refresh of the sorting result.
It should be noted that, since all available memories of the terminal device are not changed during the same start, after all available memories of the terminal device are acquired once, the terminal device cannot be acquired again even if the preset periodic refresh duration is reached.
In some embodiments, the receiving an instruction to stop acquiring data comprises:
if an instruction for closing the display interface is received, judging that an instruction for stopping acquiring data is received, wherein the display interface is as follows: an interface for displaying the new ranking results.
In this embodiment, after the user closes the display interface for displaying the sorting result, the terminal device will not acquire new data. For example, the unused memory of the terminal device and the memory occupied by each process are no longer acquired.
In some embodiments, the step S12 includes:
and B1, acquiring a process group list processlist of the terminal equipment according to the system resource acquisition instruction, wherein the process group list stores the identifier of the process which is started by the terminal equipment.
B2, traversing the identification of the process which is started by the terminal equipment in the processlist, and acquiring the memory occupied by the process which is started by the terminal equipment according to the traversal result.
The AMS stores the processslist, so after the terminal equipment acquires the system resource acquisition instruction, the system resource acquisition instruction is sent to the AMS, and the AMS acquires the memory occupied by the process corresponding to the process identifier in the processslist by calling the corresponding service. Through the operation, the memory occupied by the process can be quickly acquired without setting a new in-process list, so that the consumption of resources is reduced.
In this embodiment, because there are usually a plurality of processes being started by the terminal device, in order to avoid missing and without obtaining the memory of a certain process, the memory occupied by the corresponding process is obtained by traversing the process identifier in the processslist, for example, assuming that the processslist includes the process identifier X1, the process identifier X2, and the process identifier X3, the memory occupied by the process identifier X1 is obtained first according to the process identifier X1, the memory occupied by the process identifier X2 is obtained according to the process identifier X2, and the memory occupied by the process identifier X3 is obtained finally. Of course, if only the memories occupied by the first processes with the most occupied memories need to be acquired, after the memories occupied by the processes being started by the terminal device are acquired according to the traversal result, only the memories occupied by the first processes with the most occupied memories are selected as the final acquisition result of the terminal device.
In some embodiments, since the AMS further stores an activity record (activitrecord) that stores an identifier of the process and application package (package) information of the application in which the process is located, such as an application name, the terminal device may acquire information of the application name and the like of the application in which the process is located based on the activitrecord, and then display the application name together with the sorting result, so that the user can more intuitively know memories occupied by different applications.
In some embodiments, since a user may wish to close some processes after viewing the sorting result, at this time, an interface for closing the processes may be set on the display interface, and in particular, the system resource obtaining method further includes:
an interface for closing the process is set.
The displaying the sorting result comprises:
and displaying a sequencing result by adopting one line of a display interface of the terminal equipment, displaying a process closing button corresponding to the sequencing result on the same line, and entering the interface for closing the process after the process closing button is triggered so as to close the process corresponding to the sequencing result on the same line as the process closing button.
In this embodiment, when the sorting result is displayed, the process closing button corresponding to the sorting result is also displayed, so that the user enters the interface corresponding to the process closing function by triggering, for example, clicking the process closing button, thereby implementing quick closing of the process.
In some embodiments, to improve the intelligent response, the system resource obtaining method further includes:
c1, obtaining the times of closing different processes in the historical time length, wherein the historical time length is as follows: and taking the current moment as the termination moment and the interval with the current moment as the duration corresponding to the preset duration. For example, assuming that the preset time period is 1 hour, and the current time is 12 00, the history time period is a time period of 1 hour in which 11.
And C2, sequencing different processes from high to low according to the acquired times, and prompting a user to trigger process closing buttons corresponding to the processes sequenced in the previous preset number.
In this embodiment, if the preset number is 2, and the obtained times that the process X1, the process X2, and the process X3 are closed in the historical duration are 3, 2, and 4, respectively, the user is prompted to trigger the process closing buttons corresponding to the process X1 and the process X3.
In some embodiments, the system resource obtaining method further includes: and if the terminal equipment does not display the sequencing result of the memory occupied by each process at present, prompting the user to close the processes with the preset number in the front sequencing.
In this embodiment, if the user does not currently instruct the terminal device to display the sorting result of the memory occupied by each process, the user is prompted to close the processes sorted in the previous preset number through text, voice, or the like, so as to close the processes in time.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Example two:
corresponding to the system resource obtaining method described in the foregoing embodiment, fig. 3 shows a block diagram of a system resource obtaining apparatus provided in the embodiment of the present application, where the system resource obtaining apparatus is applied to a terminal device based on an android system, and for convenience of description, only a part related to the embodiment of the present application is shown.
Referring to fig. 3, the system resource acquisition apparatus 3 includes: a system resource acquisition instruction acquisition module 31, a system resource acquisition module 32, and a sorting result display module 33. Wherein:
a system resource obtaining instruction obtaining module 31, configured to obtain a system resource obtaining instruction sent by a user in a preset application button or cnd instruction mode.
The preset application buttons are buttons represented by pictures and/or characters.
A system resource obtaining module 32, configured to obtain, according to the system resource obtaining instruction, a system resource occupied by a process of the terminal device, where the system resource includes a memory.
In some embodiments, if the number of the processes being started by the terminal device is large (for example, greater than the preset number threshold), since the user is usually interested in only the first few processes that occupy the most system resources, in order to further increase the acquisition speed of the system resources, only the system resources occupied by the processes being started, which are ranked at the top and have the preset number of occupied system resources, are acquired. Wherein the preset number can be determined in the following manner: and taking the number of lines which can be displayed on one page of the terminal equipment as the preset number.
In some embodiments, the system resources may also include a Central Processing Unit (CPU) and Input/Output (I/O).
And the sorting result display module 33 is configured to determine a sorting result according to system resources occupied by different processes, and display the sorting result.
In the embodiment of the application, the terminal device obtains the system resource obtaining instruction sent by the user through a preset application button or cmd mode, and the terminal device can directly obtain the system resource occupied by the process and display the sequencing result after sequencing. The system resource comprises the memory, so the sequencing result is the sequencing result of the memory occupied by the processes, and the sequenced sequencing result is more convenient for the user to quickly focus, namely, the user can quickly know which processes occupy the most memory and which processes occupy the least memory. In addition, the user can obtain the sequencing result of the memory occupied by the process only by sending out the system resource acquisition instruction in a preset application button or cmd mode, so the operation is simple, and the operation complexity of the user is reduced.
In some embodiments, the system resource acquisition device 3 includes:
and the all-memory and unused-memory acquisition module is used for acquiring all available memories and unused memories of the terminal equipment according to the system resource acquisition instruction.
And the used memory determining module is used for determining the used memory according to all available memories and unused memories of the terminal equipment.
The system resource obtaining module 32 is specifically configured to:
and acquiring the memory occupied by the process of the terminal equipment according to the system resource acquisition instruction.
The sorting result display module 33 is specifically configured to:
and determining the ratio of the memory occupied by each process to the used memory, determining the sequencing result of each process according to the ratio, and displaying the sequencing result.
In some embodiments, the system resource acquiring device 3 includes:
and the new unused memory obtaining module is used for obtaining a new unused memory if a preset periodic refreshing time length is reached, wherein the preset periodic refreshing time length is the time length for periodically obtaining data.
The used memory determination module is specifically configured to:
and determining a new used memory according to all available memories and a new unused memory of the terminal equipment.
When the system resource obtaining module 32 obtains the memory occupied by the process of the terminal device according to the system resource obtaining instruction, the system resource obtaining module is specifically configured to:
and if the preset periodic refreshing time length is reached, acquiring a new memory occupied by the process of the terminal equipment according to the system resource acquisition instruction.
The sorting result display module 33 is specifically configured to, when determining a ratio between the memory occupied by each process and the used memory, determining a sorting result of each process according to the ratio, and displaying the sorting result:
determining the ratio of a new memory occupied by each process to the new used memory to obtain a new ratio, determining a new sorting result of each process according to the new ratio, displaying the new sorting result, and returning to the step of obtaining the new unused memory and the subsequent steps if the preset periodic refreshing time is up until an instruction of stopping obtaining data is received.
In some embodiments, the receiving an instruction to stop acquiring data comprises:
if an instruction for closing the display interface is received, judging that an instruction for stopping acquiring data is received, wherein the display interface is as follows: an interface for displaying the new ranking results.
In some embodiments, when the system resource obtaining module 32 obtains the memory occupied by the process of the terminal device according to the system resource obtaining instruction, the system resource obtaining module is specifically configured to:
acquiring a processlist of the terminal equipment according to the system resource acquisition instruction, wherein the processlist stores an identifier of a process which is started by the terminal equipment; and traversing the identifier of the process which is started by the terminal equipment in the processslist, and acquiring the memory occupied by the process which is started by the terminal equipment according to the traversal result.
In some embodiments, since the AMS further stores an activity record (activiyrecord) that stores an identifier of the process and application package (package) information of the application in which the process is located, such as an application name, the terminal device may obtain information of the application name of the application in which the process is located and the like based on the activiyrecord, and then display the application name together with the sorting result, so that the user can more intuitively know memories occupied by different applications.
In some embodiments, the system resource acquiring apparatus 3 further includes:
and the interface setting module is used for setting an interface for closing the process.
The sorting result display module 33 is specifically configured to, when displaying the sorting result:
and displaying a sequencing result by adopting one line of a display interface of the terminal equipment, displaying a process closing button corresponding to the sequencing result on the same line, and entering the interface for closing the process after the process closing button is triggered so as to close the process corresponding to the sequencing result on the same line as the process closing button.
In some embodiments, the system resource acquiring apparatus 3 further includes: and the process closing prompting module is used for prompting a user to close the processes with the preset number in the front sequence if the terminal equipment does not display the sequencing result of the memory occupied by each process currently.
In some embodiments, the system resource acquiring apparatus 3 further includes:
the process closing frequency acquisition module is used for acquiring the closing frequency of different processes in historical time length, wherein the historical time length is as follows: and taking the current time as the termination time, and setting the interval between the current time and the preset time as the time corresponding to the preset time.
And the process closing module is used for sequencing different processes from high to low according to the acquired times and prompting a user to trigger process closing buttons corresponding to the processes sequenced in the front by the preset number.
It should be noted that, for the information interaction, execution process, and other contents between the above-mentioned devices/units, the specific functions and technical effects thereof are based on the same concept as those of the embodiment of the method of the present application, and specific reference may be made to the part of the embodiment of the method, which is not described herein again.
Example three:
fig. 4 is a schematic structural diagram of a terminal device based on an android system according to an embodiment of the present application. As shown in fig. 4, the terminal device 4 of this embodiment includes: at least one processor 40 (only one processor is shown in fig. 4), a memory 41, and a computer program 42 stored in the memory 41 and executable on the at least one processor 40, the processor 40 implementing the steps of any of the various method embodiments described above when executing the computer program 42:
acquiring a system resource acquisition instruction sent by a user in a preset application button or cnd instruction mode;
acquiring system resources occupied by the process of the terminal equipment according to the system resource acquisition instruction, wherein the system resources comprise a memory;
and determining a sequencing result according to system resources occupied by different processes, and displaying the sequencing result.
The terminal device 4 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is merely an example of the terminal device 4, and does not constitute a limitation to the terminal device 4, and may include more or less components than those shown, or may combine some components, or different components, and may further include, for example, an input/output device, a network access device, and the like.
The Processor 40 may be a Central Processing Unit (CPU), and the Processor 40 may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may in some embodiments be an internal storage unit of the terminal device 4, such as a hard disk or a memory of the terminal device 4. The memory 41 may also be an external storage device of the terminal device 4 in other embodiments, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like provided on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of the computer program. The memory 41 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. For the specific working processes of the units and modules in the system, reference may be made to the corresponding processes in the foregoing method embodiments, which are not described herein again.
An embodiment of the present application further provides a network device, where the network device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the foregoing method embodiments.
The embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the methods of the embodiments described above may be implemented by instructing relevant hardware by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the embodiments of the methods described above may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing apparatus/terminal apparatus, a recording medium, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), an electrical carrier signal, a telecommunications signal, and a software distribution medium. Such as a usb-disk, a removable hard disk, a magnetic or optical disk, etc. In certain jurisdictions, computer-readable media may not be an electrical carrier signal or a telecommunications signal in accordance with legislative and patent practice.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the technical solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other ways. For example, the above-described apparatus/network device embodiments are merely illustrative, and for example, the division of the modules or units is only one logical function division, and other divisions may be realized in practice, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (8)

1. The system resource obtaining method is applied to terminal equipment based on an android system, and comprises the following steps:
acquiring a system resource acquisition instruction sent by a user in a preset application button or cnd instruction mode;
acquiring system resources occupied by the process of the terminal equipment according to the system resource acquisition instruction, wherein the system resources comprise a memory;
determining a sequencing result according to system resources occupied by different processes, and displaying the sequencing result; before the acquiring the system resource occupied by the process of the terminal device according to the system resource acquiring instruction, the method includes:
acquiring all available memories and unused memories of the terminal equipment according to the system resource acquisition instruction;
determining a used memory according to all available memories and unused memories of the terminal equipment;
the acquiring the system resource occupied by the process of the terminal device according to the system resource acquisition instruction includes:
acquiring a memory occupied by the process of the terminal equipment according to the system resource acquisition instruction;
the determining the sorting result according to the system resources occupied by different processes and displaying the sorting result includes:
determining the ratio of the memory occupied by each process to the used memory, determining the sequencing result of each process according to the ratio, and displaying the sequencing result;
after the acquiring of all available memories and unused memories of the terminal device according to the system resource acquiring instruction includes:
if a preset periodic refreshing time length is reached, acquiring a new unused memory, wherein the preset periodic refreshing time length is the time length for periodically acquiring data;
the determining the used memory according to all available memories and unused memories of the terminal device includes:
determining a new used memory according to all available memories and a new unused memory of the terminal equipment;
the acquiring the memory occupied by the process of the terminal device according to the system resource acquisition instruction includes:
if the preset periodic refreshing time length is reached, acquiring a new memory occupied by the process of the terminal equipment according to the system resource acquisition instruction;
the determining a ratio of the memory occupied by each process to the used memory, determining a sorting result of each process according to the ratio, and displaying the sorting result includes:
determining the ratio of the new memory occupied by each process to the new used memory to obtain a new ratio, determining a new sorting result of each process according to the new ratio, displaying the new sorting result, and returning to the step of obtaining the new unused memory and the subsequent steps if the preset periodic refreshing time is up until an instruction of stopping obtaining data is received.
2. The system resource acquisition method according to claim 1, wherein said receiving an instruction to stop acquiring data comprises:
if an instruction for closing the display interface is received, judging that an instruction for stopping acquiring data is received, wherein the display interface is as follows: an interface for displaying the new ranking results.
3. The method for acquiring system resources according to claim 1, wherein the acquiring, according to the system resource acquisition instruction, the memory occupied by the process of the terminal device includes:
acquiring a process list of the terminal equipment according to the system resource acquisition instruction, wherein the process list stores an identifier of a process which is started by the terminal equipment;
and traversing the identifier of the process which is started by the terminal equipment in the process list, and acquiring the memory occupied by the process which is started by the terminal equipment according to the traversal result.
4. The system resource acquisition method according to any one of claims 1 to 3, wherein the system resource acquisition method further comprises:
setting an interface for closing the process;
the displaying the sorting result comprises:
and displaying a sequencing result by adopting one line of a display interface of the terminal equipment, displaying a process closing button corresponding to the sequencing result on the same line, and entering the interface for closing the process after the process closing button is triggered so as to close the process corresponding to the sequencing result on the same line as the process closing button.
5. The system resource acquisition method according to claim 4, wherein the system resource acquisition method further comprises:
obtaining the times of closing different processes in a historical time length, wherein the historical time length is as follows: taking the current time as a termination time, and setting the interval between the current time and the preset time as a time corresponding to the preset time;
and sequencing different processes from high to low according to the acquired times, and prompting a user to trigger process closing buttons corresponding to the processes sequenced in the previous preset number.
6. The utility model provides a system resource acquisition device which characterized in that is applied to terminal equipment based on android, includes:
the system resource acquisition instruction acquisition module is used for acquiring a system resource acquisition instruction sent by a user in a preset application button or cnd instruction mode;
a system resource obtaining module, configured to obtain, according to the system resource obtaining instruction, a system resource occupied by a process of the terminal device, where the system resource includes a memory;
the sequencing result display module is used for determining a sequencing result according to system resources occupied by different processes and displaying the sequencing result;
all-memory and unused-memory obtaining module, configured to obtain all available memories and unused memories of the terminal device according to the system resource obtaining instruction;
a used memory determining module, configured to determine a used memory according to all available memories and unused memories of the terminal device;
the system resource obtaining module is specifically configured to:
acquiring a memory occupied by the process of the terminal equipment according to the system resource acquisition instruction;
the sorting result display module is specifically configured to:
determining the ratio of the memory occupied by each process to the used memory, determining the sequencing result of each process according to the ratio, and displaying the sequencing result;
the system comprises a new unused memory obtaining module, a new unused memory obtaining module and a data updating module, wherein the new unused memory obtaining module is used for obtaining a new unused memory if a preset periodic refreshing time length is reached, and the preset periodic refreshing time length is the time length for periodically obtaining data;
the used memory determination module is specifically configured to:
determining a new used memory according to all available memories and a new unused memory of the terminal equipment;
the system resource obtaining module is specifically configured to, when obtaining the memory occupied by the process of the terminal device according to the system resource obtaining instruction:
if the preset periodic refreshing time length is reached, acquiring a new memory occupied by the process of the terminal equipment according to the system resource acquisition instruction;
when determining the ratio of the memory occupied by each process to the used memory, determining the ranking result of each process according to the ratio, and displaying the ranking result, the ranking result display module is specifically configured to:
determining the ratio of a new memory occupied by each process to the new used memory to obtain a new ratio, determining a new sorting result of each process according to the new ratio, displaying the new sorting result, and returning to the step of obtaining the new unused memory and the subsequent steps if the preset periodic refreshing time is up until an instruction of stopping obtaining data is received.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the terminal device is based on the android system, and wherein the processor implements the method according to any of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 5.
CN202010841312.0A 2020-08-20 2020-08-20 System resource obtaining method and device and terminal equipment Active CN111949492B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010841312.0A CN111949492B (en) 2020-08-20 2020-08-20 System resource obtaining method and device and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010841312.0A CN111949492B (en) 2020-08-20 2020-08-20 System resource obtaining method and device and terminal equipment

Publications (2)

Publication Number Publication Date
CN111949492A CN111949492A (en) 2020-11-17
CN111949492B true CN111949492B (en) 2023-01-06

Family

ID=73358565

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010841312.0A Active CN111949492B (en) 2020-08-20 2020-08-20 System resource obtaining method and device and terminal equipment

Country Status (1)

Country Link
CN (1) CN111949492B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009129742A1 (en) * 2008-04-22 2009-10-29 大唐移动通信设备有限公司 A method and device for downlink data transmission
CN106055407A (en) * 2016-05-25 2016-10-26 努比亚技术有限公司 Process resource adjusting device and method
CN109857561A (en) * 2019-02-12 2019-06-07 武汉深之度科技有限公司 A kind of EMS memory management process and calculate equipment
CN110311813A (en) * 2019-06-25 2019-10-08 贵阳海信网络科技有限公司 A kind of method and device of track comprehensive network management

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104133761A (en) * 2013-11-28 2014-11-05 腾讯科技(成都)有限公司 Memory usage analysis method, device and system of mobile terminal
CN104503887A (en) * 2014-12-15 2015-04-08 北京奇虎科技有限公司 Method and device for showing state of computing equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009129742A1 (en) * 2008-04-22 2009-10-29 大唐移动通信设备有限公司 A method and device for downlink data transmission
CN106055407A (en) * 2016-05-25 2016-10-26 努比亚技术有限公司 Process resource adjusting device and method
CN109857561A (en) * 2019-02-12 2019-06-07 武汉深之度科技有限公司 A kind of EMS memory management process and calculate equipment
CN110311813A (en) * 2019-06-25 2019-10-08 贵阳海信网络科技有限公司 A kind of method and device of track comprehensive network management

Also Published As

Publication number Publication date
CN111949492A (en) 2020-11-17

Similar Documents

Publication Publication Date Title
CN106445292B (en) Method and system for managing application programs in different body modes
CN111488088B (en) Equipment state identification method and device and intelligent terminal
CN108415657B (en) Message sending method, device, medium and electronic equipment
US20210191580A1 (en) Method and Apparatus for Displaying Application Program, Terminal Device, and Storage Medium
CN112099684A (en) Search display method and device and electronic equipment
CN110795180A (en) Two-dimensional code management method and system, electronic device and storage medium
CN108664301B (en) Menu generation method, system and terminal equipment
CN108874697A (en) The processing method and its system of USB device
CN108062401B (en) Application recommendation method and device and storage medium
CN107729491B (en) Method, device and equipment for improving accuracy rate of question answer search
CN111949492B (en) System resource obtaining method and device and terminal equipment
US11287949B2 (en) Method and device for displaying icon
CN112181570A (en) Background task display method and device and electronic equipment
CN111610917A (en) Display method, display device and electronic equipment
CN105094608A (en) Task display method and device
CN108536512B (en) Interface switching method and device and terminal equipment
CN115617748A (en) Material list information analysis method, device, equipment and storage medium
CN113138702B (en) Information processing method, device, electronic equipment and storage medium
CN109710278A (en) Method and device for unloading application program and terminal equipment
CN114531340A (en) Log acquisition method and device, electronic equipment, chip and storage medium
CN111694498B (en) Interface display method and device and electronic equipment
CN110162374B (en) Theme switching method, device, equipment and computer readable storage medium
CN108415656B (en) Display control method, device, medium and electronic equipment in virtual scene
CN112988160B (en) Server compiling method, device, equipment and computer readable storage medium
CN111176813B (en) Running mode dynamic switching method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant