CN115617529B - Process management method and device in mobile application compatible running environment - Google Patents

Process management method and device in mobile application compatible running environment Download PDF

Info

Publication number
CN115617529B
CN115617529B CN202211438411.XA CN202211438411A CN115617529B CN 115617529 B CN115617529 B CN 115617529B CN 202211438411 A CN202211438411 A CN 202211438411A CN 115617529 B CN115617529 B CN 115617529B
Authority
CN
China
Prior art keywords
priority
compatible
memory
android
mobile application
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
CN202211438411.XA
Other languages
Chinese (zh)
Other versions
CN115617529A (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.)
National University of Defense Technology
Original Assignee
National University of Defense Technology
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 National University of Defense Technology filed Critical National University of Defense Technology
Priority to CN202211438411.XA priority Critical patent/CN115617529B/en
Publication of CN115617529A publication Critical patent/CN115617529A/en
Application granted granted Critical
Publication of CN115617529B publication Critical patent/CN115617529B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • 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/3017Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system is implementing multitasking
    • 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/3037Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a memory, e.g. virtual memory, cache
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3055Monitoring arrangements for monitoring the status of the computing system or of the computing system component, e.g. monitoring if the computing system is on, off, available, not available
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/526Mutual exclusion algorithms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/483Multiproc
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/508Monitor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/509Offload
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention provides a process management method and a device in a mobile application compatible running environment, which can effectively manage a system native process and an android compatible process, reduce potential risks caused by uncontrolled resource competition of the compatible android process, improve the overall performance and reduce the jamming risk of the system, and the method comprises the following steps: packaging a system native process and an android compatible process in a mobile application compatible running environment, comprehensively studying and judging the multidimensional characteristic information of the packaged processes to obtain a priority, and distributing available resources of the processes according to the priority of the processes; dynamically monitoring memory risk, triggering garbage recovery and low memory searching and killing processes according to the priority real-time distribution result of the processes and the memory tension degree, and keeping alive important processes.

Description

Process management method and device in mobile application compatible running environment
Technical Field
The invention relates to the technical field of mobile application compatible running environments, in particular to a process management method and device in a mobile application compatible running environment.
Background
The compatible operation environment of the mobile application can realize that the heterogeneous application runs in one system, for example, an kylin mobile operation system is constructed based on Web technology, and can be compatible with a mobile terminal operation system running an android application program on the Web operation system, and the compatible operation environment of the android application and some background service processes for guaranteeing the normal running of the android application are adapted on the basis that the original operation system supports the running of the Web application. The operation modes of the application programs under the heterogeneous compatible operation environment,
for an operating system, a web has a process management mode, an android also has a process management mode, the two processes operate together to seize resources, the situation that an original operating system cannot sense and control heterogeneous android processes to consume CPUs, memories and the like is caused, the phenomenon of intense competition of system resources is caused, and the abuse of the resources such as the CPUs, the memories and the like inevitably causes the increase of the system blocking risk.
Taking the kylin mobile operating system as an example, in a native Web framework of the kylin mobile operating system, the priority of a process can be controlled by using an application type, a foreground and background switching condition and the like, so that the proportion of resources such as a CPU (central processing unit), a memory and the like used by the process can be adjusted, but the whole framework does not cover a complicated and changeable use scene, and the unified management of an android process is lacked.
In an android operating system, AMS (active management service) is used for realizing application process management and unified scheduling of four large components, the scheduling priority and scheduling strategy of a process are adjusted, and Low-Memory condition processing is realized by combining a kernel Memory pressure event and LMKD (Low Memory Killer Daemon), but a mobile application compatible operating environment framework such as a unicon mobile operating system cannot be directly compatible.
Therefore, a new process management method in a mobile application compatible running environment needs to be designed to improve the performance of native applications and compatible android applications.
Disclosure of Invention
In order to solve the problems, the invention provides a process management method and a process management device in a mobile application compatible running environment, which can effectively manage a system native process and an android compatible process, reduce potential risks caused by uncontrolled resource competition of the compatible android process, improve the overall performance and reduce the system jamming risk.
The technical scheme is as follows: the process management method in the compatible operating environment of the mobile application comprises the following steps:
packaging a system native process and an android compatible process in a mobile application compatible running environment, comprehensively studying and judging the multidimensional characteristic information of the packaged processes to obtain a priority, and distributing available resources of the processes according to the priority of the processes, wherein the mobile application compatible running environment is an kylin mobile operating system, and the system native process is a web process;
dynamically monitoring memory risk, triggering garbage recovery and low memory searching and killing processes according to the priority real-time distribution result of the processes and the memory tension degree, and keeping the important processes alive.
Furthermore, when the system native process and the android compatible process are packaged, the system native process and the android compatible process are packaged into a process template object, the process characteristics are cut, and the process characteristics migrated to the process template object include held resource locks, application types and running states.
Further, the comprehensive study and judgment of the multidimensional characteristic information of the process after the encapsulation is adopted to obtain the priority, specifically comprising the following steps:
obtaining an initial priority according to the application type of the process;
acquiring a standard priority according to the process active notification fused with the initial priority, wherein the process active notification can reflect the running state of the process;
the standard priority is adjusted depending on whether the process holds a resource lock, whether a perceptible resource is used, or not.
Further, when the application process is set to the top and becomes the foreground process, the priorities of the foreground process and the previous affected process at the moment are updated.
Further, the initial priority level from high to low comprises a management process, a user customized keep-alive process, a foreground input method, a foreground process, a background perceptible process and a pre-allocation process.
Further, when the WEB process and the android compatible process behavior change or the system behavior changes, the process activity notification is updated, the activity notification message is sent to the corresponding process template object, the initial priority is updated according to the process activity notification to obtain the standard priority, the process behavior comprises process creation, starting, backing to the background, destruction, resource lock application and resource lock release, the system behavior comprises screen lightening, screen extinguishing, screen locking, unlocking and memory clearing, and the sensible resources comprise audio, video playing, recording and video recording.
Further, the allocating the available resources of the process according to the priority of the process is specifically implemented as follows:
establishing a priority mapping table, mapping the standard priority adjusted by the process to a CGROUP control node in a CGROUP grouping module of the system through the priority mapping table, and distributing available resources of the process by the CGROUP control node according to the written standard priority, wherein the available resources comprise CPU resources, memory resources and boost acceleration performance.
Further, a process manager is arranged, after the android process is created, a binder service interface of the process manager is called to package and map the android process into a process template object, when the management process of the system derives the system native process, the process manager packages the system native process into the process template object, and the process template object is embedded into the management process to run;
when the behaviors of the WEB process and the android compatible process are changed or the system behavior is changed, the original process of the system sends an active notification message to a corresponding process template object through an IPDL communication mode and the android compatible process through a binder interface, and the initial priority is updated according to the active notification of the process to obtain a standard priority;
and setting a CGROUP grouping module, setting an impl interface by the CGROUP grouping module, mapping the priority in the priority mapping table into the attribute value of the CGROUP grouping, and distributing the system available resources by the CGROUP control node according to the priority.
Further, memory resources are uniformly distributed by a system kernel, a result is distributed in real time according to the priority of a system native process and an android compatible process, the memory tension degree is monitored, garbage recycling operation is triggered regularly, when the memory tension degree is not relieved, a process which is low in priority and occupies a large memory is searched, and the process is killed by sending a program killing signal until the memory pressure threat is relieved.
A system for process management in a mobile application compatible runtime environment, comprising:
the process template object is used for packaging a system WEB process and an android compatible process in a mobile application compatible running environment;
the process manager is used for comprehensively studying and judging the multidimensional characteristic information of the packaged process to obtain the priority;
the CGROUP grouping module is used for distributing available resources of the process according to the priority of the process;
and the memory management module is used for dynamically monitoring memory risks, triggering garbage recovery and low memory searching and killing processes according to the priority real-time distribution result of the processes and the memory tension degree, and keeping alive important processes.
A computer device, comprising: comprising a processor, a memory, and a program;
the program is stored in the memory, and the processor calls the program stored in the memory to execute the process management method in the mobile application compatible running environment.
A computer-readable storage medium for storing a program for executing the process management method in the mobile application compatible execution environment as described above.
The invention has the following advantages:
1. according to the invention, the native process of the system and the android compatible process are encapsulated, and a heterogeneous application normalization processing mode is adopted, so that the behavior of the heterogeneous process can be conveniently and uniformly evaluated.
2. According to the method, the native process and the android compatible process of the system are brought into management by packaging the native process and the android compatible process of the system, the standard priority is uniformly distributed, the proportion of CPU and memory resources occupied by the process and the boost acceleration performance are adjusted according to the priority, the potential risk caused by uncontrolled resource competition of the android process is reduced, and the overall performance is improved.
3. The method comprises the steps of firstly obtaining an initial priority according to the application type of a process; however, the running state of the feedback application is informed actively through the process, the initial priority is fused to obtain the standard priority, and the priority evaluation is carried out on the heterogeneous process through fusing the multidimensional information according to whether the process holds the resource lock or not and whether the sensible resource is used for adjusting the standard priority, so that the resource distribution is matched with the user operation in a finer granularity, and the use experience is better.
4. The memory is managed based on the shared kernel, the memory condition is checked periodically in the using process of the terminal, so that the memory recovery and the low memory searching and killing are more efficient, important processes are protected, and the user experience is ensured.
Drawings
FIG. 1 is a diagram illustrating steps of a process management method in a mobile application compatible runtime environment according to an embodiment;
FIG. 2 is a schematic diagram illustrating a module configuration implemented by the kylin mobile OS according to the process management method in the embodiment in the compatible runtime environment of the mobile application;
FIG. 3 is a block diagram that illustrates components of a process management system in an embodiment of a mobile application compatible runtime environment;
FIG. 4 is a diagram of the internal structure of a computing device in accordance with one embodiment.
Detailed Description
The following description will explain the process management method in the mobile application compatible running environment according to the present invention, which implements unified scheduling and control of the native system Web process and the android process on the resource usage of CPU, memory, etc. in the kylin mobile operating system, so as to improve the system performance in the heterogeneous mobile application compatible running environment.
Referring to fig. 1, the method for managing processes in a mobile application compatible execution environment in the embodiment at least includes the following steps:
step 1: packaging a system WEB process and an android compatible process in a mobile application compatible running environment, comprehensively studying and judging by adopting multi-dimensional characteristic information of the packaged processes to obtain priorities, distributing available resources of the processes according to the priorities of the processes, including distributing CPU (central processing unit) and memory resources, adjusting boost acceleration performance, reducing potential risks caused by uncontrolled resource competition, improving overall performance of the system, and providing evaluation basis for memory recovery;
step 2: and dynamically monitoring the memory risk by using a memory management mechanism based on a shared kernel, triggering a garbage recovery and low memory searching and killing process according to a priority real-time distribution result of the process and the memory tension degree, and keeping the important process alive.
Referring to fig. 2, in the kylin mobile operating system, specifically in step 1, the system packages a Web process and an android compatible process as process template objects and stores the process template objects by setting a Process Manager (PM), and determines and decides a standard priority according to process multidimensional characteristic data. In the kylin mobile operating system, the operation of a management process runs through the service cycle of equipment, other processes are derived, and a process manager is embedded into the management process to run in order to guarantee the continuity of priority updating and facilitate process management. When the management process of the system derives the process, the system native process is packaged into a Process Template Object (PTO), the process characteristics are cut, and partial characteristics are migrated into the process template object, wherein the migrated characteristics include but are not limited to held resource locks, application types and running states. And simultaneously, the process manager is designed into a binder server-side form, after the android process is established, a binder service interface of the process manager is called to package and map the android process into a process template object, and the process template object is stored in the process manager in an array form. And the process manager monitors the life cycle event of the process and updates the process template object array according to the creation and destruction conditions of the process. In the step 1, unified evaluation of the process behaviors is facilitated through a normalization processing mode of heterogeneous system WEB process and android compatible process packaging.
After the WEB process and the android compatible process are packaged, comprehensive research and judgment are carried out on the multidimensional characteristic information of the packaged process to obtain the priority, and the method specifically comprises the following steps:
1-1: obtaining an initial priority according to the application type of the process;
1-2: the method comprises the steps that a standard priority is obtained according to a process active notification fusion initial priority, and the process active notification can reflect the running state of a process;
1-3: adjusting the standard priority according to whether the process holds a resource lock or uses a perceptible resource;
1-4: the priorities of the foreground process and the previous affected process are updated.
The embodiment provides a judging strategy: firstly, considering the application type, the process priority can be divided into a management process, a user customized keep-alive process, an input method process, a WEB application process, an android application process and a pre-allocation process from high to low, and an initial priority is given according to the application type.
In the kylin mobile operating system, a management process has the highest access resource authority, is a root process derived from the original system process, and can manage all other processes only by ensuring that the management process has extremely high priority. The user customizes the keep-alive process, the process which is set for the user and is not killed by mistake as far as possible when the resources are in tension is determined by whether the special field 'persistence' is identified when the application is written. The foreground input method has higher priority than the common foreground because the interaction experience of the user is determined to a great extent. The foreground process is the topmost application process visible to the user, can be an original operating system application process, and can also be an android compatible process, and whether the process is consistent with the visibility of the process at the topmost end or not is judged. When the ACTIVITY of the client process is visible and the bindService () method is called, the flags carry a BIND _ ADJUST _ WITH _ ACTIVITY parameter, and then the current android service process belongs to the foreground process. The background is an application process which does not occupy the most front end window or an inactive service process. The background perceptible process is a background process which is using video and audio services. Because the kylin mobile operating system ensures the speed of opening the application for the first time by the user, the pre-installed template process allocates resources, the priority of the process can not be high, and the process is switched to the foreground priority after the process is really operated.
According to whether the active notification is located in the foreground or not, namely whether the application can be displayed or not, a standard priority is obtained according to the process active notification and the fusion initial priority, wherein both WEB applications and android applications are possible to be located in the foreground or the background, but the management process, the user customized keep-alive process and the input method have higher priority than the foreground, the pre-distribution has lower priority than the background and is not influenced by the foreground and the background, when the behaviors of the WEB process and the android compatible process are changed or the system behavior is changed, a process manager is called to update the process active notification, the active notification message is sent to a corresponding process template object, the standard priority is determined according to the application type in the process characteristics, and therefore all the processes are brought into the management of the process manager. The method comprises the steps that process behaviors include but are not limited to process creation, starting, backing to a background, destroying, resource lock application, resource lock release and the like, system behaviors include but are not limited to screen lightening, screen blanking, screen locking, unlocking, memory cleaning and the like, when a process running state changes, a system native process sends an active notification message to a corresponding process template object through an IPDL communication mode and an android compatible process through a binder interface, and a process manager obtains a standard priority according to characteristic data stored in the process template object mapped by the system native process and the android compatible process.
And finally, fine-tuning the standard priority according to the condition that each resource lock is held in the process and whether the sensible resource condition is used. Including but not limited to audio, video playback, recording video. Such as WEB applications or android applications, enter the background but have the property of playing audio, so that the priority level is changed from the background to the background. And the priority evaluation is carried out on the compatible system process through the multidimensional information, so that the resource allocation is matched with the user operation with finer granularity, and the use experience is better.
Particularly, when the application process is set to the forefront to become a foreground process, if the rendering of the Web application or the android application is finished, a process active notification is issued, the process manager indexes a process template object, the priority of the process and the previous affected process is calculated, and the process manager calls a CGROUP grouping module (CGROUPManager, CM) to realize the updating of the process and the previous affected process. In this embodiment, a user opens an application on an original system desktop, the application has a foreground priority, and the original system desktop is a background priority; when the application exits, the application is in background priority, and the original system desktop is in foreground priority.
In the embodiment, an initial priority is obtained according to the application type of a process; however, the running state of the feedback application is informed through the process activity, the standard priority is obtained by fusing the initial priority, and the priority evaluation is carried out on the heterogeneous process through fusing the multidimensional information according to whether the process holds the resource lock and whether the standard priority is adjusted by using the sensible resource, so that the resource allocation is matched with the user operation in a finer granularity, and the use experience is better.
In the present invention, the allocation of available resources of a process according to its priority is specifically implemented as follows:
establishing a priority mapping table, mapping the standard priority adjusted by the process to a CGROUP control node in a CGROUP grouping module of the system through the priority mapping table, and distributing available resources of the process by the CGROUP control node according to the written standard priority, wherein the available resources comprise CPU resources, memory resources and boost speed-up performance.
In the embodiment, a CGROUP grouping module is designed at a hardware abstraction layer of the kylin mobile operating system, a priority mapping table is established, the process priority is determined and then mapped into an actual CGROUP control node through the priority mapping table, the operation between different levels is isolated, and the input is provided for a memory management module. Because the process priority operation is calculated and set in the management process, the CGROUP grouping module does not need to design a sandbox interface, and only needs to design an impl interface. And the process manager decides the standard priority of the process, calls a CGROUP grouping module to map the priority into the attribute value of the CGROUP grouping through a priority mapping table, and realizes the dynamic writing of the priority into the CGROUP control node. The higher the process priority decided by the process manager is, the more the number of cores which can run corresponding to the CGROUP is, the larger the share of the CPU is occupied, and the larger the boost value is, the more obvious the boost performance is improved. If the fg directory under the schedule root directory of the foreground priority group corresponding to CGROUP, the schedule.
In this embodiment, a priority mapping table, which is a mapping table for dynamically adjusting the correspondence between the process priority and the CGROUP grouping module and the key attribute values thereof in the kylin mobile operating system, is provided, so as to dynamically adjust the CPU proportion used by the process, the process speed increase size, the number of CPU cores occupied by the process, and the like according to the process priority obtained by the process manager, and table 1 provides a reference scheme for the priority mapping table, which can be specifically changed according to requirements.
The CPU in the table represents the name of a CPU group in CGROUP corresponding to each process priority, fg-default, fg-persistence, fg-keyboard, top, bg-persistence and bg-prealloc groups are distributed in the method, the CPU (CPU _ shares) represents the proportion of CPU time occupied by each group, and the larger the value is, the more the proportion of CPU time is occupied, the more the operation chance is. The schedule represents the name of a schedule group in CGROUP corresponding to the priority of each process, fg-default, fg-persistence, fg-keyboard, top, bg-persistence and bg-prealloc groups are allocated in the patent, schedule (schedule. Schedule) represents the boost speed obtained by each group, and the larger the value is, the larger the boost speed is; schedule _ idle represents each of the above sets of power consumption and performance adjustment parameters, with larger values representing higher performance and larger power consumption, and lower values representing lower performance and smaller power consumption. The memory represents a memory group name in the CGROUP corresponding to each process priority, and the memory parameters can be set according to the process priority. The cpu represents the name of a cpu set group in CGROUP corresponding to each process priority, the patent is assigned with fg-default, fg-persistent, fg-keyboard, top, bg-privileged and bg-prealloc groups, the cpu (cpus) represents the number of cpu cores which can be operated in each group, 0-7 represents the number of the cores which can be operated in 8 groups, 0-5 represents the number of the cores which can be operated in 6 groups, 0-3 represents the number of the cores which can be operated in 4 groups, the more the cores which can be operated in the groups are, the more the migration opportunities of tasks are increased, and more execution opportunities can be obtained.
Figure DEST_PATH_IMAGE001
In this embodiment, the final priority levels of the processes obtained by the policy evaluation are described as an example of using the present invention.
In the invention, in step 2, a memory management mechanism based on a shared kernel is utilized to uniformly distribute memory resources from a system kernel, dynamically monitor memory risks, periodically trigger garbage collection operation according to the priority real-time distribution result of a system native process and an android compatible process and the monitored memory tension degree, search a process with low priority and large memory occupation when the memory tension degree is not relieved, and kill the process by sending a killing process signal until the memory pressure threat is relieved.
In the embodiment of the kylin mobile operating system, in step 2, in order to ensure the consistency of the native process and the android compatible process of the system to the memory operation, a shared same kernel mechanism is adopted, the device memory resources are uniformly distributed by the kernel and can be uniformly grouped and configured by/dev/memcg. In this embodiment, a service process is designed to monitor memory _ pressure _ level of CGROUP, write the monitored memory _ pressure _ level into CGROUP _ event _ control, and timely trigger garbage collection and a low-memory searching and killing process by using a result and a memory tension degree which are allocated to a system native process and an android compatible process in real time in step 1. Since monitoring the memory _ level event trigger may affect the user experience when the memory is in tension, the memory pressure condition needs to be checked every second, and the sending system notifies the triggering of the original system Garbage Collection (GC) operation, so that memory recovery and process killing are achieved in advance. When the memory is seriously insufficient, the low priority in the previous priority grouping and the process occupying a larger memory are searched, and the process is continuously killed by sending a process killing signal until the threat of the memory pressure is relieved.
In the embodiment of the kylin mobile operating system, a killard service process is designed to monitor memory. And creating a thread in the management process, after reading that the process number in the socket message is the same as that of the management process, issuing a memory pressure notice to processes such as JS runtime, canvas, a database, GPU and the like, and recovering unnecessary memories by each module. And the killerd service process also collects the processes into fg, bg, try _ to _ keep and default groups according to parameters under the CGROUP grouping module, respectively kills the bg group and the processes in try to keep alive try to the programs in the bg group according to the amount of the memory occupied by the processes when the memory is seriously insufficient, and stops killing after the threat of the memory pressure is relieved.
In the above embodiments, the execution steps of the process management method in the compatible running environment of the mobile application in the kylin mobile operating system based on the Web technology compatible with the android application are described in detail. Correspondingly, the process management method in the compatible operation environment of the mobile application is also suitable for other compatible heterogeneous mobile application compatible operation environments compatible with android.
Fig. 3, in an embodiment of the present invention, further provides a process management system in a mobile application compatible execution environment, including:
the process template object 100 is used for encapsulating a system WEB process and an android compatible process in a mobile application compatible operating environment;
the process manager 200 is configured to comprehensively study and judge the multidimensional characteristic information of the encapsulated process to obtain a priority;
a CGROUP grouping module 300 for allocating available resources of a process according to a priority of the process;
the memory management module 400 dynamically monitors the memory risk, triggers the garbage collection and low memory searching and killing process according to the real-time allocation result of the priority of the process and the memory tension degree, and keeps the important process alive.
In an embodiment of the present invention, there is also provided a computer apparatus including: comprising a processor, a memory, and a program;
a program is stored in the memory, and the processor calls the program stored in the memory to execute the process management method in the mobile application compatible execution environment described above.
The computer device may be a terminal, and its internal structure diagram may be as shown in fig. 4. The computer device comprises a processor, a memory, a network interface, a display screen and an input device which are connected through a bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The network interface of the computer device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a method of process management in a mobile application compatible runtime environment. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on a shell of the computer device, an external keyboard, a touch pad or a mouse and the like.
The Memory may be, but is not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The memory is used for storing programs, and the processor executes the programs after receiving the execution instructions.
The processor may be an integrated circuit chip having signal processing capabilities. The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like. The Processor may also be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be appreciated by those skilled in the art that the configuration shown in fig. 4 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
In an embodiment of the present invention, there is also provided a computer-readable storage medium configured to store a program configured to execute the process management method in the mobile application compatible execution environment described above.
As will be appreciated by one of skill in the art, embodiments of the present invention may be provided as a method, computer apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, computer apparatus, or computer program products according to embodiments of the invention. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart and/or flowchart block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart.
The above detailed description is provided for the application of the process management method, system, computer device, and computer readable storage medium in a mobile application compatible running environment, and specific examples are applied herein to explain the principles and embodiments of the present invention, and the descriptions of the above embodiments are only used to help understand the method and its core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. The process management method in the compatible operation environment of the mobile application is characterized by comprising the following steps:
packaging a system native process and an android compatible process in a mobile application compatible running environment, comprehensively studying and judging the multidimensional characteristic information of the packaged processes to obtain a priority, and distributing available resources of the processes according to the priority of the processes, wherein the mobile application compatible running environment is an kylin mobile operating system, and the system native process is a web process;
dynamically monitoring memory risks, triggering garbage recovery and low memory searching and killing processes according to the priority real-time distribution result of the processes and the memory tension degree, and keeping alive important processes;
when the system native process and the android compatible process are packaged, the system native process and the android compatible process are packaged into a process template object, the process characteristics are cut, and the process characteristics migrated to the process template object comprise a held resource lock, an application type and an operation state;
the method for comprehensively studying and judging the multidimensional characteristic information of the process after packaging to obtain the priority comprises the following steps:
obtaining an initial priority according to the application type of the process;
acquiring a standard priority according to the process active notification fused with the initial priority, wherein the process active notification can reflect the running state of the process;
the standard priority is adjusted depending on whether the process holds a resource lock, whether a perceptible resource is used.
2. The method for process management in a mobile application compatible runtime environment of claim 1, wherein: when the application process is set to the top and becomes the foreground process, the priorities of the foreground process and the previous affected process at the moment are updated.
3. The method for process management in a mobile application compatible runtime environment of claim 1, wherein: the initial priority comprises a management process, a user customized keep-alive process, a foreground input method, a foreground process, a background perceptible process and a pre-distribution process from high to low.
4. The method of process management in a mobile application compatible runtime environment of claim 1, wherein: when the WEB process and the android compatible process behavior change or the system behavior changes, updating the process activity notification, sending the activity notification message to a corresponding process template object, updating the initial priority according to the process activity notification to obtain a standard priority, wherein the process behavior comprises process creation, starting, backing to a background, destruction, resource lock application and resource lock release, the system behavior comprises screen lightening, screen extinguishing, screen locking, unlocking and memory clearing, and the sensible resources comprise audio, video playing, recording and video recording.
5. The method of process management in a mobile application compatible runtime environment of claim 4, wherein: the allocation of the available resources of the process according to the priority of the process is specifically realized as follows:
establishing a priority mapping table, mapping the standard priority adjusted by the process to a CGROUP control node in a CGROUP grouping module of the system through the priority mapping table, and distributing available resources of the process by the CGROUP control node according to the written standard priority, wherein the available resources comprise CPU resources, memory resources and boost acceleration performance.
6. The method of process management in a mobile application compatible runtime environment of claim 5, wherein:
setting a process manager, calling a binder service interface of the process manager to package and map the android process into a process template object after the android process is created, and when a management process of the system derives a system native process, packaging the system native process into the process template object by the process manager, wherein the process template object is embedded into the management process to run;
when the behaviors of the WEB process and the android compatible process are changed or the system behavior is changed, the original process of the system sends an active notification message to a corresponding process template object through an IPDL communication mode and the android compatible process through a binder interface, and the initial priority is updated according to the active notification of the process to obtain a standard priority;
and setting a CGROUP grouping module, setting an impl interface by the CGROUP grouping module, mapping the priority in the priority mapping table into the attribute value of the CGROUP grouping, and distributing the system available resources by the CGROUP control node according to the priority.
7. The method of process management in a mobile application compatible runtime environment of claim 1, wherein: the method comprises the steps of uniformly distributing memory resources by a system kernel, distributing results in real time according to priorities of a system native process and an android compatible process and monitoring the memory tension degree, triggering garbage recycling operation regularly, searching a process with low priority and large memory occupation when the memory tension degree is not relieved, and killing the process by sending a killing process signal until the memory pressure threat is relieved.
8. A system for process management in a mobile application compatible runtime environment, comprising:
the process template object is used for packaging a system WEB process and an android compatible process in a mobile application compatible running environment;
the process manager is used for comprehensively studying and judging the multidimensional characteristic information of the packaged process to obtain the priority;
the CGROUP grouping module is used for distributing available resources of the process according to the priority of the process;
the memory management module dynamically monitors the memory risk, triggers the garbage recovery and low memory searching and killing process according to the priority real-time distribution result of the process and the memory tension degree, and keeps the important process alive;
when the process template object encapsulates the system native process and the android compatible process, the system native process and the android compatible process are encapsulated into a process template object, the process characteristics are cut, and the process characteristics migrated to the process template object comprise a held resource lock, an application type and an operating state;
the process manager obtains an initial priority according to the application type of the process;
acquiring a standard priority according to the process active notification fused with the initial priority, wherein the process active notification can reflect the running state of the process;
the standard priority is adjusted depending on whether the process holds a resource lock, whether a perceptible resource is used.
9. A computer device, comprising: comprising a processor, a memory, and a program;
the program is stored in the memory, and the processor calls the memory-stored program to execute the process management method in the mobile application compatible execution environment of claim 1.
10. A computer-readable storage medium characterized by: the computer-readable storage medium stores a program for executing the process management method in the mobile application-compatible execution environment of claim 1.
CN202211438411.XA 2022-11-17 2022-11-17 Process management method and device in mobile application compatible running environment Active CN115617529B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211438411.XA CN115617529B (en) 2022-11-17 2022-11-17 Process management method and device in mobile application compatible running environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211438411.XA CN115617529B (en) 2022-11-17 2022-11-17 Process management method and device in mobile application compatible running environment

Publications (2)

Publication Number Publication Date
CN115617529A CN115617529A (en) 2023-01-17
CN115617529B true CN115617529B (en) 2023-03-10

Family

ID=84879256

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211438411.XA Active CN115617529B (en) 2022-11-17 2022-11-17 Process management method and device in mobile application compatible running environment

Country Status (1)

Country Link
CN (1) CN115617529B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115827112B (en) * 2023-02-21 2023-05-05 麒麟软件有限公司 System and method for running android application program on Web operating system
CN117056173B (en) * 2023-10-12 2024-01-30 麒麟软件有限公司 Method for monitoring android application life cycle on Web operating system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040226015A1 (en) * 2003-05-09 2004-11-11 Leonard Ozgur C. Multi-level computing resource scheduling control for operating system partitions
CN102479108B (en) * 2010-11-26 2013-09-11 中国科学院声学研究所 Terminal resource management system for multi-application process embedded system and method
CN106407000B (en) * 2015-08-10 2019-09-17 联想移动通信科技有限公司 A kind of method, apparatus and system of terminal internal memory optimization
CN110532197B (en) * 2019-08-30 2022-03-01 Oppo(重庆)智能科技有限公司 Memory recovery method and device, electronic equipment and storage medium
CN113722080A (en) * 2020-05-22 2021-11-30 北京小米移动软件有限公司 Memory optimization method and device and computer storage medium

Also Published As

Publication number Publication date
CN115617529A (en) 2023-01-17

Similar Documents

Publication Publication Date Title
CN115617529B (en) Process management method and device in mobile application compatible running environment
CN110704186B (en) Computing resource allocation method and device based on hybrid distribution architecture and storage medium
CN109565515B (en) System, apparatus, and process for dynamic tenant fabric adjustment in a distributed resource management system
US11231955B1 (en) Dynamically reallocating memory in an on-demand code execution system
ES2659872T3 (en) Programming operations in protected mode
US20140201756A1 (en) Adaptive resource usage limits for workload management
CN106775699B (en) Method and system for updating UI in asynchronous thread
CN116954829A (en) Multi-cluster panel for distributed virtualized infrastructure element monitoring and policy control
CN109791500A (en) Intermediate host integrated circuit between virtual machine instance and client programmable logic
CN112000463B (en) GPU resource allocation method, system, terminal and storage medium based on CUDA
US8006055B2 (en) Fine granularity hierarchiacal memory protection
US9195505B2 (en) Method, system and an executable piece of code for controlling the use of hardware resources of a computer system
CN103150154A (en) Implementation method and device of application plug-in
WO2023011249A1 (en) I/o multiplexing method, medium, device and operation system
US20120254436A1 (en) Integration of an application server and data grid
JPH05224963A (en) Process control system for real-time system
CN115048209A (en) CPU scheduling method, device, terminal equipment and storage medium
CN112463315A (en) Cluster task scheduling method and device and related components
CN115118785B (en) Server resource protection method, apparatus, device, medium, and program product
US6981244B1 (en) System and method for inheriting memory management policies in a data processing systems
KR102436071B1 (en) A system and method for power saving of computer system by using power regulating functions
CN109274988B (en) Bullet screen message distribution method, device, equipment and storage medium
CN110704195A (en) CPU adjusting method, server and computer readable storage medium
CN109089163A (en) Barrage message distributing method, device, equipment and storage medium
Molina et al. Addressing memory exhaustion failures in Virtual Machines in a cloud environment

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