System service management method and device and electronic equipment

By detecting the triggering conditions of system services in the operating system and loading and unloading system services at the appropriate time, the problems of system resource waste and performance degradation are solved, and system performance and device startup speed are improved.

CN118535231APending Publication Date: 2024-08-23HUAWEI DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310155345.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-22
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In existing operating systems, system services are always started after booting and do not exit until shutting down, resulting in waste of resources and reduced performance, prolonged startup time, and increased power consumption due to too many processes.

Method used

By detecting the triggering conditions of system services, incubate the process of running system services, receive and save service handles, and load and unload system services at the appropriate time to avoid premature startup and resource occupation in idle states.

Benefits of technology

It achieves efficient utilization of system resources, reduces hardware costs, and improves system performance and device startup speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535231A
    Figure CN118535231A
Patent Text Reader

Abstract

The embodiment of the invention provides a system service management method and device and electronic equipment, in the system service management method, after system service management in the electronic equipment detects a triggering condition of system service starting, a system process running the system service is hatched so as to start the system process, and the system service starting time is shortened. And then the system service management receives the service handle sent by the system service, stores the service handle corresponding to the system service, and executes the system service, so that the electronic equipment can accurately identify the operation requirement of the system service, the system service is loaded at a proper time, and the situation that the system service is started too early and system resources are wasted is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of smart terminal technology, and in particular to a method, device and electronic device for managing system services. Background Art

[0002] In current operating systems, a large number of system services are started when the computer is turned on and are not exited until the computer is shut down. In fact, many services are always idle in the background and no applications use these services. Idle system services waste a lot of system resources. The above system resources may include: central processing unit (CPU), memory and / or input output (IO).

[0003] Moreover, once the system services are started, they will not be shut down, resulting in a waste of system resources and a negative impact on system performance. In addition, the system services are concentrated in the moment of booting, which makes the device boot time longer, and many system services are not used. Too many system services will also cause too many processes in the system, resulting in increased power consumption of electronic devices. Summary of the invention

[0004] The embodiments of the present application provide a method, device and electronic device for managing system services. The embodiments of the present application also provide a computer-readable storage medium to enable the electronic device to accurately identify the operating requirements of the system services, load the system services at the appropriate time, and avoid starting the system services too early and wasting system resources.

[0005] In a first aspect, an embodiment of the present application provides a method for managing a system service, comprising: after detecting a trigger condition for starting a system service, incubating a system process that runs the system service to start the system process; receiving a service handle sent by the system service, wherein the service handle is generated after the system service is loaded by the system process, and the system service is loaded after the system process is started; saving the service handle corresponding to the system service; and executing the system service.

[0006] In the above-mentioned system service management method, after the system service management in the electronic device detects the triggering conditions for starting the system service, it incubates the system process running the above-mentioned system service to start the above-mentioned system process, and then the system service management receives the service handle sent by the above-mentioned system service, saves the service handle corresponding to the above-mentioned system service, and executes the above-mentioned system service, so that the electronic device can accurately identify the operating requirements of the system service, load the system service at the appropriate time, and avoid starting the system service too early and wasting system resources.

[0007] In one possible implementation, the trigger condition for detecting the start of the system service includes: receiving a command from a client requesting the system service; and executing the system service includes: returning a service handle corresponding to the system service to the client, so that the client can call the system service according to the service handle.

[0008] In one possible implementation, before the triggering condition for starting the system service is detected, it also includes: parsing the loading configuration file of the system service to obtain the loading condition of the system service; monitoring the loading condition; the detecting the triggering condition for starting the system service includes: monitoring that the loading condition is met.

[0009] In one possible implementation, after generating the service handle corresponding to the system service, it also includes: after detecting the triggering condition for uninstalling the system service, notifying the system service to release the system resources occupied by the system service and destroying the service handle of the system service; if there are no other system services running under the system process running the system service, cleaning up the system process.

[0010] In one possible implementation, the trigger condition for detecting uninstallation of the system service includes: receiving an uninstall request sent by the system service; wherein the uninstall request is sent after the system service determines that it is in an idle state, and the uninstall request is used to request uninstallation of the system service; the system service determines that it is in an idle state includes that the system service has completed its own task, or the time period for which the system service has not been called is greater than or equal to a predetermined time period.

[0011] In one possible implementation, the detecting of the triggering condition for uninstalling the system service includes: parsing the uninstallation configuration file of the system service to obtain the uninstallation condition of the system service; monitoring the uninstallation condition; the detecting of the triggering condition for uninstalling the system service includes: monitoring that the uninstallation condition is satisfied.

[0012] In a second aspect, an embodiment of the present application provides a management device for system services, which is included in an electronic device, and has the function of implementing the electronic device behavior in the first aspect and the possible implementation of the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, an incubation module, a receiving module, a storage module, and an execution module.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, including:

[0014] One or more processors; a memory; a plurality of applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the electronic device, enable the electronic device to execute the method provided in the first aspect.

[0015] It should be understood that the second and third aspects of the embodiments of the present application are consistent with the technical solutions of the first aspect of the embodiments of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method provided in the first aspect.

[0017] In a fifth aspect, an embodiment of the present application provides a computer program, which, when executed by a computer, is used to execute the method provided in the first aspect.

[0018] In one possible design, the program in the fifth aspect may be stored in whole or in part on a storage medium packaged together with the processor, or may be stored in whole or in part on a memory not packaged together with the processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A schematic diagram of the structure of an electronic device provided by an embodiment of the present application;

[0020] Figure 2 A schematic diagram of an application scenario provided for an embodiment of the present application;

[0021] Figure 3 A schematic diagram of an application scenario provided for another embodiment of the present application;

[0022] Figure 4 A schematic diagram of an application scenario provided for yet another embodiment of the present application;

[0023] Figure 5 A schematic diagram of an application scenario provided for yet another embodiment of the present application;

[0024] Figure 6 A flowchart of a method for managing system services provided in one embodiment of the present application;

[0025] Figure 7 A flowchart of a method for managing system services provided in another embodiment of the present application;

[0026] Figure 8A flowchart of a method for managing system services provided in yet another embodiment of the present application;

[0027] Fig. 9 A flowchart of a method for managing system services provided in yet another embodiment of the present application;

[0028] Fig.10 A flowchart of a method for managing system services provided in yet another embodiment of the present application;

[0029] Fig.11 A flowchart of a method for managing system services provided in yet another embodiment of the present application;

[0030] Fig.12 A flowchart of a method for managing system services provided in yet another embodiment of the present application;

[0031] Fig.13 A schematic diagram of the structure of an electronic device provided in another embodiment of the present application;

[0032] Fig.14 A schematic diagram of the structure of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0033] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0034] In the existing related technologies, for the management of system services, taking the Android system as an example, most of the system services in Android are resident system services. Android has no effective means of controlling background processes and services. The huge number of background processes and services has always been a key factor restricting Android performance. Therefore, the existing related technologies have the following problems: idle system services occupy memory in the background, resulting in insufficient system available memory; too many idle processes consume central processing unit (CPU) resources, reducing the system energy efficiency ratio.

[0035] Based on the above problems, an embodiment of the present application provides a system service management method, which can accurately identify the running time of the system service and load it when needed; it can also accurately identify the running status of the system service, unload the service when idle, and provide a dynamic loading and unloading mechanism.

[0036] The system service management method provided in the embodiment of the present application can be applied to electronic devices, wherein the above-mentioned electronic device can be a server, which can be set in the cloud, or the above-mentioned electronic device can be a terminal device. For example, the above-mentioned terminal device can be a smart phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA) and other devices; the embodiment of the present application does not impose any restrictions on the specific type of electronic device.

[0037] For example, Figure 1 A schematic diagram of the structure of an electronic device provided by an embodiment of the present application is shown as follows: Figure 1 As shown, the electronic device 100 may include a processor 110 and a communication interface 120. Optionally, the electronic device 100 may also include a memory 130. The processor 110, the communication interface 120 and the memory 130 may communicate with each other through an internal connection path to transmit control and / or data signals, and the memory 130 is used to store a computer program, and the processor 110 is used to call and run the computer program from the memory 130.

[0038] The processor 110 and the memory 130 may be combined into a processing device, or more commonly, they are independent components, and the processor 110 is used to execute program codes stored in the memory 130. In specific implementation, the memory 130 may also be integrated into the processor 110, or may be independent of the processor 110.

[0039] In addition, in order to make the functions of the electronic device 100 more complete, the electronic device 100 may further include one or more of an input unit 160 and a display unit 170 .

[0040] Optionally, the electronic device 100 may further include a power supply 150 for providing power to various devices or circuits in the electronic device 100 .

[0041] It should be understood that Figure 1 The processor 110 in the electronic device 100 shown may be a system on chip SOC, and the processor 110 may include a central processing unit (CPU), and may further include other types of processors, such as a graphics processing unit (GPU) and the like.

[0042] For ease of understanding, the following embodiments of the present application will be described in detail with Figure 1 Taking the electronic device with the structure shown as an example, the management method of the system service provided in the embodiment of the present application is specifically explained in combination with the accompanying drawings and application scenarios.

[0043] Figure 2 This is a schematic diagram of an application scenario provided by an embodiment of the present application. One application scenario of the system service management method provided by the embodiment of the present application is external call triggering service loading. Figure 2 As shown, the application process needs to call a system service. It first requests the system service management to query, and then the system service management loads the system service, and then returns the service object to the application process. The application process can call the system service.

[0044] Figure 3 A schematic diagram of an application scenario provided for another embodiment of the present application. Another application scenario of the system service management method provided in the embodiment of the present application is a timer-triggered service loading an execution task timer triggering a timing plan. The system service management starts a system service according to preset conditions, and the system service executes the scheduled task after it is started.

[0045] Figure 4 A schematic diagram of an application scenario provided for another embodiment of the present application. Another application scenario of the system service management method provided in the embodiment of the present application is uninstalling services that require networking after the device is disconnected from the network. The system service management receives the device disconnection event and uninstalls the system services that require networking according to preset conditions.

[0046] Figure 5 A schematic diagram of an application scenario provided for another embodiment of the present application. Another application scenario of the system service management method provided in the embodiment of the present application is that the system service actively requests to uninstall after performing a task. For example, when the upgrade service detects that there is no online version that needs to be updated, it can actively request to uninstall the system service.

[0047] In the above application scenarios, the system service management method provided in the embodiment of the present application can accurately identify the operating requirements and idle status of the system service through the monitoring of system service management and system key events, load the system service at the appropriate time, and avoid starting the system service too early and wasting system resources; in addition, by uninstalling idle system services, system resources can be released and hardware costs can be reduced.

[0048] The following describes the management method of the system service provided by the embodiment of the present application in combination with the above application scenario.

[0049] Figure 6This is a flowchart of a system service management method provided in one embodiment of the present application. The system service management method can be executed by the system service management in the electronic device 100.

[0050] like Figure 6 As shown, the management method of the above system services may include:

[0051] Step 601: After the system service management in the electronic device 100 detects a trigger condition for starting the system service, it incubates the system process running the system service to start the system process.

[0052] In this embodiment, the triggering conditions for starting the system service can be divided into two situations: one is triggered by an external call, for example, an external client requests a system service; the other is triggered by an event and a change in state. Therefore, the system service management in the electronic device 100 can identify the operating requirements of the system service by monitoring external calls and key system events.

[0053] Step 602: the system service management receives the service handle sent by the system service, wherein the service handle is generated after the system service is loaded by the system process, and the system service is loaded after the system process is started.

[0054] In this embodiment, after the system service is triggered, the system service management incubates the system process. After the system process is started, the system service is loaded. After the system service is loaded by the system process, the above-mentioned service handle is generated. Then the system service sends the service handle to the system service management, and the system service management receives the service handle sent by the above-mentioned system service.

[0055] Step 603: The system service management saves the service handle corresponding to the above system service.

[0056] Step 604, executing the above system services.

[0057] In the above-mentioned system service management method, after the system service management in the electronic device 100 detects the triggering conditions for starting the system service, it incubates the system process running the above-mentioned system service to start the above-mentioned system process, and then the system service management receives the service handle sent by the above-mentioned system service, saves the service handle corresponding to the above-mentioned system service, and executes the above-mentioned system service, so that the electronic device 100 can accurately identify the operating requirements of the system service, load the system service at the appropriate time, and avoid starting the system service too early and wasting system resources.

[0058] Figure 7 This is a flowchart of a method for managing system services provided by another embodiment of the present application. This embodiment introduces a method for starting a system service under a scenario where an external call triggers the system service. Figure 6In the illustrated embodiment, the trigger condition for detecting the start of the system service may be: receiving a command from the client requesting the system service; thus, executing the system service may be: returning the service handle corresponding to the system service to the client, so that the client can call the system service according to the service handle.

[0059] like Figure 7 As shown, the management method of the above system services may include:

[0060] Step 701: The system service management receives a command from a client requesting a system service.

[0061] The client may be an application process or other system service, and may be a local client or a remote client.

[0062] Step 702: System service management requests Init to incubate the system process.

[0063] Step 703: After the system process is started, the system service is loaded. After the system service is loaded, the system service generates a service handle.

[0064] Step 704: The system service sends the service handle to the system service management.

[0065] Step 705: the system service management saves the service handle and returns the service handle corresponding to the system service to the client. The client calls the system service according to the service handle.

[0066] In this embodiment, after the system service management receives the command from the client requesting the system service, it starts the system service, thereby accurately identifying the timing of starting the system service and loading the system service at the appropriate time, avoiding wasting system resources by starting the system service too early.

[0067] Figure 8 This is a flowchart of a method for managing system services provided in another embodiment of the present application. This embodiment introduces a method for starting a system service in a scenario where an event or state change triggers the system service. Figure 6 In the illustrated embodiment, before detecting the triggering condition for starting the system service, the system service management may also parse the loading configuration file of the system service to obtain the loading condition of the system service; then, the system service management monitors the loading condition; in this way, detecting the triggering condition for starting the system service may be: monitoring that the loading condition is satisfied.

[0068] like Figure 8 As shown, the management method of the above system services may include:

[0069] Step 801, the system service management parses the loading configuration file of the system service, obtains the loading conditions of the system service, and monitors the loading conditions.

[0070] Step 802: The system service management receives a notification of a change in the monitored loading condition and learns that the loading condition is satisfied.

[0071] Step 803: System service management requests Init to incubate the system process.

[0072] Step 804: After the system process is started, the system service is loaded. After the system service is loaded, the system service generates a service handle.

[0073] Step 805: The system service sends the service handle to the system service management.

[0074] Step 806: the system service management saves the service handle, and the system executes the predetermined task.

[0075] See also Figure 8 In this embodiment, the system service may include: event service, soft bus and / or attribute service, etc. The loading conditions of the above system services may include: system attribute changes, timers, device networking and / or public events, etc. Taking the timer as an example, the system management service can monitor the data of the timer. After the timer reaches the timing duration, the system service management determines that the loading conditions of the timer are met, so Init can be requested to incubate the system process corresponding to the timer. After the system process is started, the system service corresponding to the timer is loaded. After the system service corresponding to the timer is loaded, a service handle is generated, and then the system service corresponding to the timer sends the service handle to the system service management. The system service management saves the above service handle, and the operating system of the electronic device 100 executes the system task corresponding to the timer, and prompts the event of the timer expiring. For example, the electronic device 100 can prompt the event of the timer expiring through a ringtone and / or vibration.

[0076] In this embodiment, the system management service monitors the loading conditions of the system service, and starts the system service after the above loading conditions are met, so as to accurately identify the operating requirements of the system service through monitoring of key system events, start the system service at the appropriate time, and avoid starting the system service too early and wasting system resources.

[0077] Fig. 9 This is a flowchart of a method for managing system services provided by another embodiment of the present application. This embodiment uses a distributed device network as an example to illustrate the method for managing system services provided by the embodiment of the present application. Fig. 9 As shown, the management method of the above system services may include:

[0078] Step 901: When the system service management is initialized, the loading configuration file of the distributed service is parsed and the loading condition of the distributed service is read.

[0079] Among them, the loading condition of the above-mentioned distributed service can be that the distributed device group is online.

[0080] Step 902, the system service management monitors the loading conditions of the distributed service, receives the message that the distributed device group is online, and incubates the above distributed service process through the service process management request Init.

[0081] In this embodiment, the system service management receives the message that the distributed device group network is online, and can determine that the loading condition of the distributed service is met, so the system service management can request Init to incubate the distributed service process.

[0082] Step 903: the distributed service process is initialized, and the service loader loads the distributed service.

[0083] Step 904, after the distributed service is loaded, a service handle is generated, and the distributed service sends the service handle to the system service management, which saves the service handle, thereby completing the startup of the distributed device networking system service. By monitoring the loading conditions of the distributed service, the distributed service is started after the distributed device networking is online, thereby starting the distributed service at the appropriate time and avoiding premature startup and wasting system resources.

[0084] Fig.10 A flowchart of a method for managing system services provided in another embodiment of the present application is shown in FIG. Fig.10 As shown, this application Figure 6 In the illustrated embodiment, after step 604, the following may also be included:

[0085] Step 1001, after detecting the triggering condition for uninstalling the above system service, notify the system service to release the system resources occupied by the above system service and destroy the service handle of the above system service.

[0086] Step 1002: If no other system services are running under the system process running the system service, then the system process is cleared.

[0087] Fig.11 This is a flowchart of a method for managing system services provided in yet another embodiment of the present application. This embodiment describes a situation in which the system service determines that it has entered an idle state and requests to be uninstalled.

[0088] like Fig.11 As shown, this may include:

[0089] Step 1101: The system service determines that it is in an idle state, and sends an uninstall request to the system service management.

[0090] The uninstall request is sent after the system service determines that it is in an idle state, and the uninstall request is used to request uninstallation of the system service.

[0091] Specifically, the system service determines that it is in an idle state, which may include: the system service has completed its own task, or the time period for which the system service has not been called is greater than or equal to a predetermined time period. The predetermined time period may be set according to system performance and / or implementation requirements during specific implementation, and this embodiment does not limit the length of the predetermined time period.

[0092] That is to say, in this embodiment, for system services that execute their own tasks without external calls, the system service itself can be judged to have entered an idle state after completing its own tasks; for system services that respond to external calls, if they are not called within a predetermined period of time (that is, there are no requests to be processed), the system service can also be considered to have entered an idle state.

[0093] Step 1102: The system service management notifies the system service to release the system resources occupied by the system service and destroys the service handle of the system service.

[0094] Step 1103, the system service management determines whether there are other system services running under the system process running the above system service. If not, the system service management clears the above system process.

[0095] Specifically, the service handle management in the system service management determines whether there are other system services running under the system process running the above system service. If not, the service handle management notifies the service process management to clean up the above system process, and the service process management requests the memory control process to clean up the above system process, and then the memory control process notifies the service loader to clean up the above system process.

[0096] Fig.12 This is a flowchart of a method for managing system services provided in yet another embodiment of the present application. This embodiment describes the situation of uninstalling system services according to uninstall conditions for system service management.

[0097] like Fig.12 As shown, this may include:

[0098] Step 1201, the system service management parses the uninstallation configuration file of the system service to obtain the uninstallation condition of the system service.

[0099] Step 1202: the system service management monitors the above uninstallation conditions.

[0100] Step 1203: The system service management monitors that the above uninstallation condition is met.

[0101] Step 1204: the system service management notifies the system service to release the system resources occupied by the system service and destroys the service handle of the system service.

[0102] Step 1205, the system service management determines whether there are other system services running under the system process running the above system service. If not, the system service management clears the above system process.

[0103] Specifically, the service handle management in the system service management determines whether there are other system services running under the system process running the above system service. If not, the service handle management notifies the service process management to clean up the above system process, and the service process management requests the memory control process to clean up the above system process, and then the memory control process notifies the service loader to clean up the above system process.

[0104] It is to be understood that some or all of the steps or operations in the above embodiments are merely examples, and the present application embodiments may also perform other operations or variations of various operations. In addition, the various steps may be performed in different orders presented in the above embodiments, and it is possible that not all of the operations in the above embodiments need to be performed.

[0105] It is understandable that, in order to realize the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to exceed the scope of this application.

[0106] This embodiment can divide the electronic device into functional modules according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0107] Fig.13 A schematic diagram of the structure of an electronic device provided in another embodiment of the present application, in which each functional module is divided according to each function, Fig.13A possible schematic diagram of the composition of the electronic device 1300 involved in the above embodiment is shown. Fig.13 As shown, the electronic device 1300 may include: an incubation module 1301, a receiving module 1302, a storage module 1303 and an execution module 1304;

[0108] The incubation module 1301 is used to incubate the system process running the system service after detecting the triggering condition for starting the system service, so as to start the system process;

[0109] The receiving module 1302 is used to receive the service handle sent by the system service, wherein the service handle is generated after the system service is loaded by the system process, and the system service is loaded after the system process is started;

[0110] The storage module 1303 is used to store the service handle corresponding to the above system service;

[0111] The execution module 1304 is used to execute the above system services.

[0112] It should be noted that this application Figure 6 All relevant contents of each step involved in the illustrated method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0113] The electronic device 1300 provided in this embodiment is used to execute the present application Figure 6 The system service management method provided by the illustrated embodiment can therefore achieve the same effect as the above method.

[0114] Fig.14 A schematic diagram of the structure of an electronic device provided in another embodiment of the present application, Fig.13 The electronic device shown is different in that Fig.14 In the electronic device 1300 shown,

[0115] The receiving module 1302 is also used to receive a command from a client requesting a system service; thus, the executing module 1304 is specifically used to return a service handle corresponding to the system service to the client, so that the client can call the system service according to the service handle.

[0116] Furthermore, the electronic device 1300 may further include: a parsing module 1305 and a monitoring module 1306;

[0117] The parsing module 1305 is used to parse the loading configuration file of the system service to obtain the loading condition of the system service before detecting the triggering condition for starting the system service;

[0118] A monitoring module 1306, used to monitor the above loading conditions;

[0119] In this way, the trigger condition for detecting the start of the system service may be: monitoring that the above-mentioned loading condition is met.

[0120] Furthermore, the electronic device 1300 may further include: a notification module 1307 and a cleaning module 1308;

[0121] Notification module 1307, configured to notify the system service to release the system resources occupied by the system service and destroy the service handle of the system service after detecting the triggering condition for uninstalling the system service;

[0122] The cleaning module 1308 is used to clean up the above system process when no other system services are running under the system process running the above system service.

[0123] Furthermore, the receiving module 1302 is also used to receive an uninstall request sent by the above-mentioned system service; wherein, the above-mentioned uninstall request is sent after the system service determines that it is in an idle state, and the above-mentioned uninstall request is used to request to uninstall the above-mentioned system service; the above-mentioned system service determines that it is in an idle state includes that the system service has completed its own task, or the time period for which the system service has not been called is greater than or equal to a predetermined time period.

[0124] Furthermore, the electronic device 1300 may further include: a parsing module 1305 and a monitoring module 1306;

[0125] The parsing module 1305 is used to parse the uninstallation configuration file of the system service to obtain the uninstallation condition of the system service;

[0126] A monitoring module 1306, used for monitoring the above uninstallation conditions;

[0127] In this way, detecting the triggering condition for uninstalling the system service may include: monitoring that the uninstalling condition is satisfied.

[0128] It should be noted that this application Figure 6 to Figure 12 All relevant contents of each step involved in the illustrated method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0129] The electronic device 1300 provided in this embodiment is used to execute the present application Figure 6 to Figure 12 The system service management method provided by the illustrated embodiment can therefore achieve the same effect as the above method.

[0130] It should be understood that the electronic device 1300 may correspond to Figure 1 The electronic device 100 shown in FIG. 100 includes a receiving module 1302 and a receiving module 1303. Figure 1 The processor 110 and the communication interface 120 in the electronic device 100 are implemented; the functions of the incubation module 1301, the storage module 1303, the execution module 1304, the analysis module 1305, the monitoring module 1306, the notification module 1307 and the cleaning module 1308 can be implemented by Figure 1 The processor 110 in the electronic device 100 is shown implemented.

[0131] In the case of adopting an integrated unit, the electronic device 1300 may include a processing module, a storage module, and a communication module.

[0132] The processing module can be used to control and manage the actions of the electronic device 1300, for example, it can be used to support the electronic device 1300 to execute the steps executed by the above modules 1301 to 1308. The storage module can be used to support the electronic device 1300 to store program codes and data, etc. The communication module can be used to support the communication between the electronic device 1300 and other devices.

[0133] Among them, the processing module can be a processor or a controller, which can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip and / or a Wi-Fi chip.

[0134] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device 1300 involved in this embodiment can be a Figure 1 Device of the structure shown.

[0135] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the present application. Figure 6 to Figure 12 The method provided by the illustrated embodiment.

[0136] The present application also provides a computer program product, which includes a computer program, which, when executed on a computer, enables the computer to execute the present application. Figure 6 to Figure 12 The method provided by the illustrated embodiment.

[0137] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0138] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0139] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0140] In several embodiments provided in the present application, any function can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0141] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for managing system services, characterized in that: include: After detecting a trigger condition for starting a system service, incubating a system process running the system service to start the system process; Receiving a service handle sent by the system service, wherein the service handle is generated after the system service is loaded by the system process, and the system service is loaded after the system process is started; Save the service handle corresponding to the system service; Execute the system service.

2. The method according to claim 1, characterized in that The triggering condition for detecting the startup of the system service includes: Receive a command from the client requesting system services; The executing of the system service comprises: The service handle corresponding to the system service is returned to the client, so that the client can call the system service according to the service handle.

3. The method according to claim 1, characterized in that Before the triggering condition for starting the system service is detected, the method further includes: Parsing a loading configuration file of the system service to obtain a loading condition of the system service; Monitoring the loading condition; The triggering condition for detecting the startup of the system service includes: It is monitored that the loading condition is met.

4. The method according to any one of claims 1 to 3, characterized in that: After executing the system service, the method further includes: After detecting a triggering condition for uninstalling the system service, notifying the system service to release system resources occupied by the system service and destroying a service handle of the system service; If no other system services are running under the system process running the system service, the system process is cleaned up.

5. The method according to claim 4, characterized in that The trigger condition for detecting uninstallation of the system service comprises: Receive an uninstall request sent by the system service; wherein the uninstall request is sent after the system service determines that it is in an idle state, and the uninstall request is used to request uninstallation of the system service; the system service determines that it is in an idle state includes that the system service has completed its own task, or the time period for which the system service has not been called is greater than or equal to a predetermined time period.

6. The method according to claim 4, characterized in that The trigger condition for detecting uninstallation of the system service comprises: Parsing the uninstallation configuration file of the system service to obtain the uninstallation condition of the system service; Monitoring the uninstallation condition; The trigger condition for detecting uninstallation of the system service comprises: It is monitored that the uninstallation condition is met.

7. A system service management device, characterized in that: include: An incubation module, configured to incubate a system process running the system service after detecting a trigger condition for starting the system service, so as to start the system process; A receiving module, configured to receive a service handle sent by the system service, wherein the service handle is generated after the system service is loaded by the system process, and the system service is loaded after the system process is started; A saving module, used for saving the service handle corresponding to the system service; The execution module is used to execute the system service.

8. An electronic device, characterized in that: include: one or more processors; Memory; Multiple applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the electronic device, enable the electronic device to perform the method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 6.