Service fusing method and electronic equipment
By obtaining hardware information in electronic devices to judge the remaining resource consumption of the service and breaking the service when the conditions are no longer met, the problem of equipment usage performance is solved, and resource conservation and user experience improvement is achieved.
Patent Information
- Application Number
- CN202410042438.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-10
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-01-10
AI Technical Summary
When the background starts the service when the electronic device is in a specific state, the user's operations may break the state, resulting in a decline in the performance of the device, resource consumption is too fast, and user experience is affected.
By obtaining hardware information, we judge whether the preset conditions are met, and calculate the amount of resources required for the remaining tasks when the conditions are no longer met. If the threshold is exceeded, the corresponding service will be broken to avoid continuing background execution and reduce the impact on the foreground application and battery. Power consumption.
It effectively improves the performance of electronic devices, reduces the impact of backend services on front-end applications and battery consumption, and improves user experience.
Smart Images

Figure CN119248429A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a service fuse method and electronic equipment. Background Art
[0002] Currently, in order to improve the performance of electronic devices, when the electronic device is in a certain state, some services can be started in the background to enable the electronic device to complete some update tasks or recommended tasks. For example, when the electronic device is in a charging state with the screen off and has been idle for a period of time, the electronic device can start services such as system updates in the background.
[0003] However, since the user cannot control the use of the electronic device, when the electronic device is in the above state, the user may operate the electronic device to break this state (that is, the electronic device is no longer in the above state), but at this time the electronic device is still executing the corresponding service in the background, which will cause the performance of the electronic device to decline. Summary of the invention
[0004] The present application provides a service fusing method and an electronic device, which can improve the performance of the electronic device.
[0005] In a first aspect, the present application provides a service fuse method, which is executed by an electronic device, and includes: obtaining first hardware information, the first hardware information being information collected by a hardware driver at a first moment; when it is determined according to the first hardware information that a preset condition is met, starting a preset service, the preset condition representing a start condition of the preset service; after starting the preset service, obtaining second hardware information, the second hardware information being information collected by the hardware driver at a second moment, the second moment being greater than the first moment; when it is determined according to the second hardware information that the preset condition is not met, if the preset service is still being executed, determining the amount of resources required to be consumed by the remaining tasks corresponding to the preset service; if the amount of resources required to be consumed by the remaining tasks is greater than a preset threshold, fuse the preset service.
[0006] Among them, during the operation of the electronic device, the hardware driver can continuously collect hardware information. When the electronic device obtains the first hardware information collected at the first moment, it can judge whether the preset condition is met according to the first hardware information, and if it is met, the preset service is started. After that, the hardware driver will continue to collect hardware information. When the electronic device obtains the second hardware information collected at the second moment, it can judge whether the preset condition is still met according to the second hardware information. If the preset condition is no longer met but the preset service is still being executed, it may affect the performance of the electronic device. The electronic device can determine the amount of resources required to be consumed by the remaining tasks corresponding to the preset service. In the case where the amount of resources required to be consumed by the remaining tasks corresponding to the preset service is greater than the preset threshold, if the preset service continues to run in the background, it will cause the electronic device to consume resources faster, affecting the performance of the electronic device. Therefore, the electronic device can fuse and discard the preset service, that is, no longer execute the preset service in the background. In this way, the impact of the preset service running in the background on the foreground running application can be reduced and the consumption of battery power can be reduced to improve the performance of the electronic device.
[0007] In some implementations, the amount of resources that need to be consumed by the remaining tasks may include processor (eg, CPU) running time and / or battery power.
[0008] In combination with the first aspect, in some implementation methods of the first aspect, when the amount of resources required to be consumed by the remaining tasks includes processor running time, the above-mentioned determination of the amount of resources required to be consumed by the remaining tasks corresponding to the preset service includes: determining the processor running time required to be consumed by the remaining tasks based on the single-round execution time and the remaining execution rounds during the execution of the preset service.
[0009] When the preset service is executed in the background, it usually takes multiple rounds to complete the entire service task, and the single round execution time is the execution time of one round. Therefore, the electronic device can determine the processor running time required for the remaining tasks based on the single round execution time and the remaining execution rounds.
[0010] In some implementations, determining the processor running time required to be consumed by the remaining tasks according to the single-round execution time and the remaining execution rounds in the preset service execution process includes:
[0011] According to the inclusion , calculate the processor running time required for the remaining tasks, where It is used to calculate the single-round execution time of the preset service execution process, (TotalEpoch-CurEpoch) is used to calculate the remaining execution rounds, CurParams represents the current feature parameter size of a single round of execution during the execution of the preset service, and may include the number of samples and feature dimensions. The number of samples may include the number of operations performed by the user during the use of the electronic device (such as the number of times the screen turns on and off, the number of clicks, etc.), and the feature dimensions may include the relationship between the preset service executed this time and the previously executed service, the charging status of the electronic device, the network status, the location status and other dimensions, MaxParams represents the maximum feature parameter size of a single round of execution during the execution of the preset service obtained through training, the F function is a trained function (or model) that calculates the single-round execution time based on CurParams and MaxParams, and the F function may be a linear or nonlinear function, TotalEpoch represents the total execution rounds corresponding to the preset service, and CurEpoch represents the currently executed rounds corresponding to the preset service.
[0012] Through the above relationship, the electronic device can calculate the processor running time required for the remaining tasks corresponding to the preset service, and then determine whether to fuse the preset service based on the comparison result of the processor running time and the preset threshold (such as the time threshold) to improve the performance of the electronic device.
[0013] In combination with the first aspect, in some implementations of the first aspect, the above-mentioned determination of the processor running time required for the remaining tasks based on the single-round execution time in the preset service execution process and the remaining execution rounds includes: determining the processor running time required for the remaining tasks based on the single-round execution time in the preset service execution process, the computing power coefficient of the electronic device and the remaining execution rounds.
[0014] Since the chip types of electronic devices in actual scenarios are different, the chip computing power of electronic devices is also different. When determining the processor running time required for the remaining tasks, the electronic devices can also take the chip computing power of the electronic devices into consideration. That is, the electronic devices determine the processor running time required for the remaining tasks based on the single-round execution time during the execution of the preset service, the computing power coefficient of the electronic device, and the remaining execution rounds.
[0015] In some implementations, determining the processor running time required for the remaining tasks according to the single-round execution time in the preset service execution process, the computing power coefficient of the electronic device, and the remaining execution rounds includes:
[0016] According to the inclusion , calculate the processor running time required for the remaining tasks, where Used to calculate the single-round execution time during the execution of the preset service. It is used to calculate the computing power coefficient of the electronic device, (TotalEpoch-CurEpoch) is used to calculate the remaining execution rounds, CurParams indicates the current feature parameter size of a single round of execution during the execution of the preset service, MaxParams indicates the maximum feature parameter size of a single round of execution during the execution of the preset service obtained through training, MinPower indicates the minimum chip computing power in electronic devices of different chip types, CurPower indicates the chip computing power of the electronic device, TotalEpoch indicates the total execution rounds corresponding to the preset service, and CurEpoch indicates the currently executed rounds corresponding to the preset service.
[0017] Through the above relationship, the electronic device can calculate the processor running time required for the remaining tasks corresponding to the preset service, and then determine whether to fuse the preset service based on the comparison result of the processor running time and the preset threshold (such as the time threshold) to improve the performance of the electronic device.
[0018] In combination with the first aspect, in some implementation methods of the first aspect, when the amount of resources required to be consumed by the remaining tasks also includes battery power, the above-mentioned determination of the amount of resources required to be consumed by the remaining tasks corresponding to the preset service includes: determining the battery power required to be consumed by the remaining tasks based on the processor running time required to be consumed by the remaining tasks and the power consumption per unit time.
[0019] Among them, if the electronic device runs a preset service in the background, it will consume additional battery power. Therefore, the electronic device can also determine the battery power required for the remaining tasks. Subsequently, it can determine whether to fuse the preset service based on the comparison result of the required battery power and the preset threshold (such as the power threshold) to improve the performance of the electronic device.
[0020] In some implementations, determining the battery power required to be consumed by the remaining tasks according to the processor running time required to be consumed by the remaining tasks and the power consumption per unit time includes:
[0021] The battery power required for the remaining tasks is calculated according to the relationship including EstimatedRemainTime×PowerRatio, where EstimatedRemainTime represents the processor running time required for the remaining tasks. The relationship or inclusion The EstimatedRemainTime is calculated using the relationship between PowerRatio and PowerRatio, and PowerRatio represents the power consumption per unit time.
[0022] Through the above relationship, the electronic device can calculate the battery power required for the remaining tasks corresponding to the preset service, and then determine whether to fuse the preset service based on the comparison result between the battery power and the preset threshold (such as the power threshold) to improve the performance of the electronic device.
[0023] In combination with the first aspect, in some implementations of the first aspect, the first hardware information includes at least one of display status information of a display screen of the electronic device, operating status information of a processor, and charging status information of a battery.
[0024] Among them, the above-mentioned hardware driver may include but is not limited to a display driver, a CPU driver and a battery driver, and the first hardware information obtained may include but is not limited to the display status information of the display screen, the working status information of the processor and the charging status information of the battery. After the hardware driver obtains the hardware information, the hardware information can be broadcast so that the modules or applications that have registered to receive the broadcast can receive the hardware information broadcasted by the hardware driver. Correspondingly, the second hardware information obtained may also include but is not limited to the display status information of the display screen, the working status information of the processor and the charging status information of the battery.
[0025] In combination with the first aspect, in some implementations of the first aspect, the above-mentioned determination that the preset condition is met based on the first hardware information includes: if the display screen is off, the battery is in a charging state, and the processor is in an idle state for a preset time, then it is determined that the preset condition is met.
[0026] That is to say, when the electronic device determines according to the first hardware information that it is currently in the charging screen-off state and has been idle for a preset time, it is determined that the preset condition is met. In some implementations, the preset time can be 30 minutes. Accordingly, after the preset service is started, when the electronic device determines according to the second hardware information that it is not currently in the charging screen-off state or is no longer in the idle state, it is determined that the preset condition is no longer met, so as to subsequently determine whether the preset service needs to be fused.
[0027] In combination with the first aspect, in some implementations of the first aspect, the preset services started by the electronic device include one or more services.
[0028] The preset service may include one or more services, such as a system update service, an application update service, or a smart service, etc. The preset service may be run in a process. If there are multiple services (including preset services and other services) currently running in the process, the electronic device may only terminate the preset service, that is, the preset service stops running, and other services can still be executed normally.
[0029] In combination with the first aspect, in some implementations of the first aspect, the electronic device includes a hardware driver and a task scheduler, and when it is determined that a preset condition is met according to first hardware information, a preset service is started, including: the task scheduler receives the first hardware information broadcast by the hardware driver; the task scheduler determines that the preset condition is met according to the first hardware information, and starts the preset service.
[0030] In this implementation, the hardware driver can collect the first hardware information and broadcast the first hardware information. After receiving the first hardware information, the task scheduler (JobScheduler) can determine whether the preset condition is met according to the first hardware information. If the JobScheduler determines that the above preset condition is met, the preset service can be started asynchronously in the background.
[0031] In combination with the first aspect, in some implementations of the first aspect, the electronic device also includes a monitoring module and a fuse judgment module. When it is determined according to the second hardware information that the preset condition is not met, if the preset service is still being executed, the amount of resources required to be consumed by the remaining tasks corresponding to the preset service is determined, including: the monitoring module receives the second hardware information broadcast by the hardware driver; when the monitoring module determines according to the second hardware information that the preset condition is not met, if the preset service is still being executed, the monitoring module calls the fuse judgment module to determine the amount of resources required to be consumed by the remaining tasks corresponding to the preset service.
[0032] Among them, after the preset service is started, the monitoring module can start and continuously receive the hardware information broadcast by the above-mentioned hardware driver, and judge whether the preset condition is still met according to the received second hardware information. Then, there may be some scenarios where some operations performed by the user cause the preset condition to be broken, that is, the preset condition is no longer met. When the preset condition is not met and the above-mentioned preset service is still being executed, the monitoring module can call the fuse judgment module to determine the amount of resources required for the remaining tasks corresponding to the preset service. If the amount of resources required for the remaining tasks is still relatively large, the preset service can be fused so that the preset service no longer runs in the background, so as to improve the performance of the electronic device.
[0033] In a second aspect, the present application provides a device, which is included in an electronic device, and the device has the function of implementing the electronic device behavior in the above-mentioned first aspect and the possible implementation of the above-mentioned first aspect. The function can be implemented by hardware, or it can be implemented by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above-mentioned functions. For example, a receiving module or unit, a processing module or unit, etc.
[0034] In a third aspect, the present application provides an electronic device, the electronic device comprising: one or more processors, and a memory;
[0035] The memory is coupled to the one or more processors, and the memory is used to store computer program code, wherein the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute any one of the methods in the technical solution of the first aspect.
[0036] In a fourth aspect, the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method in the first aspect and any possible implementation thereof.
[0037] Optionally, the chip system also includes a memory, and the memory is connected to the processor via circuits or wires.
[0038] Further optionally, the chip system also includes a communication interface.
[0039] In a fifth aspect, the present application provides a computer-readable storage medium, which includes instructions. When the instructions are executed on an electronic device, the electronic device executes any one of the methods in the technical solution of the first aspect.
[0040] In a sixth aspect, the present application provides a computer program product, the computer program product comprising: a computer program code, when the computer program code runs on an electronic device, the electronic device executes any one of the methods in the technical solution of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is an application scenario diagram of a service fusing method provided in an embodiment of the present application;
[0042] Figure 2 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0043] Figure 3 is a software structure block diagram of an electronic device provided in an embodiment of the present application;
[0044] Figure 4 It is a timing flow diagram of a service fusing method provided in an embodiment of the present application;
[0045] Figure 5 This is a flow chart of a service fuse method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0047] In the following, the terms "first", "second", and "third" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first", "second", and "third" may explicitly or implicitly include one or more of the features.
[0048] Currently, in order to improve the performance of electronic devices, when the electronic device is in a certain state, some services can be started in the background to enable the electronic device to complete some update tasks or recommendation tasks. For example, when the electronic device is in a charging state with the screen off and is idle (Idle state) for a period of time, the electronic device can start the system update service, application update service or active recommendation service based on the user's usage trajectory in the background. The active recommendation service here can also be called a smart service, which can be based on the smart ability (or artificial intelligence ability) according to the user's scenario or the user's usage trajectory and habits, and recommend more matching applications or experiences to the user. For another example, when the electronic device recognizes that the system time is a certain time point in the early morning, the above service can also be started in the background.
[0049] For example, taking an electronic device using the Android system as an example, the Android system provides a service startup mechanism called JobScheduler. JobScheduler is a task scheduler, which is mainly used to trigger the execution of a task when certain conditions are met at a certain time. When using this service startup mechanism, you can create a subclass of JobService and override its onStartJob() method to implement this function.
[0050] It can be understood that when the electronic device is in a certain state and needs to start a service in the background, the service started asynchronously can be one or more, as long as it is set to be started in this state.
[0051] However, because the user's use of the electronic device is uncontrollable, when the electronic device is in the above state, the user may operate the electronic device to break this state, but at this time the electronic device is still executing the corresponding service in the background, which will cause the performance of the electronic device to decline. For example, when the electronic device is in the charging and screen-off state and has been idle for a period of time, the system update service is started in the background of the electronic device, and then the user wakes up the electronic device to the screen-on state or triggers to stop charging the electronic device, so that the electronic device no longer meets the corresponding state conditions. At this time, if the user wakes up the electronic device to the screen-on state, other applications may be running in the foreground of the electronic device. In addition to running applications in the foreground, the electronic device must also perform system updates in the background, which may cause the foreground application to run stuck; if the user triggers to stop charging the electronic device, but the electronic device is still performing system updates in the background, this will cause the electronic device to consume power faster. In short, it leads to a decline in the performance of the electronic device and affects the user experience.
[0052] For example, Figure 1 As shown in the figure, the electronic device is in charging state with the screen off and has been idle for 30 minutes. The smart service is started in the background. Shortly after the smart service starts, the charging ends (for example, the user unplugs the power adapter or charging is completed), but the smart service is still running in the background, which will cause the power of the electronic device to be consumed quickly. If the user also operates the foreground application at the same time, it will also cause the foreground application to run lag.
[0053] In view of this, an embodiment of the present application provides a service fuse method, which can determine how much resources (such as running time or power, etc.) the remaining tasks corresponding to the service will consume when it is detected that the service startup conditions are no longer met during the execution of the service in the background, and then determine whether to continue to execute the service. If the service is not to be executed, the service is fused and discarded, and the service is no longer executed in the background. This can reduce the impact of the background running of the preset service on the foreground running application and reduce battery power consumption, so as to improve the performance of the electronic device.
[0054] It should be noted that the service fuse method provided in the embodiment of the present application can be applied to electronic devices that support the background service startup mechanism, such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiment of the present application does not impose any restrictions on the specific type of electronic devices.
[0055] For example, Figure 2 1 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identity module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0056] The processor 110 may include one or more processing units, for example, the processor 110 may include a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0057] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0058] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0059] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device through the power management module 141.
[0060] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0061] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0062] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0063] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0064] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0065] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0066] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0067] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.
[0068] Figure 3 1 is a software structure diagram of the electronic device 100 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer. The application layer can include a series of application packages.
[0069] like Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0070] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0071] like Figure 3 As shown, the application framework layer may at least include a task scheduler (JobScheduler), a monitoring module, a fuse judgment module and a fuse execution module.
[0072] Among them, JobScheduler can receive hardware information broadcasted by the kernel layer, such as charging status information of electronic devices, display status information of display screens, and working status information of processors. JobScheduler can also determine whether the preset conditions are met based on the received hardware information, and start the preset service if the preset conditions are met. After starting the preset service, the monitoring module can also receive the hardware information broadcasted by the kernel layer, and determine whether the preset conditions are continuously met based on the hardware information. If the preset conditions are no longer met at a certain moment, the fuse judgment module is started. The fuse judgment module determines how much resources the remaining tasks corresponding to the started service need to consume through a preset algorithm. If the resources to be consumed are greater than the preset threshold, the fuse execution module will fuse and discard the service. If the resources to be consumed are not greater than the preset threshold, the service will continue to run. In some implementations, the fuse execution module can be coupled inside the service to end the execution process of the service by itself. In other implementations, the fuse execution module can send a message to the kernel layer to interrupt the service process.
[0073] In addition, the application framework layer may also include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. (not shown in the figure). The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to the application. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build applications. The display interface can be composed of one or more views. The phone manager is used to provide communication functions for the electronic device 100. For example, the management of call status (including connecting, hanging up, etc.). The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables the application to display notification information in the status bar, which can be used to convey notification type messages, and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc.
[0074] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0075] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0076] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0077] The system library may include multiple functional modules, such as surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
[0078] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of multiple common audio and video formats, as well as static image files. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.
[0079] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, CPU driver, battery driver and other hardware drivers. The display driver can obtain the display status information of the display screen of the electronic device, such as the screen on state or the screen off state. The CPU driver can obtain the working status information of the processor, such as the working state or the idle state (Idle state), etc. The battery driver can obtain the charging status information and power information of the battery of the electronic device, such as the charging state or the uncharged state, etc. In some implementations, the hardware driver of the kernel layer can broadcast the obtained hardware information through the interface so that the above-mentioned JobScheduler and the monitoring module receive the hardware information.
[0080] For ease of understanding, the following embodiments of the present application will be described in detail with Figure 2 and Figure 3 Taking the electronic device with the structure shown as an example, the service fuse method provided in the embodiment of the present application is specifically explained in combination with the accompanying drawings and application scenarios.
[0081] Figure 4 This is a timing flow diagram of a service fuse method provided in an embodiment of the present application, which can be applied in the above Figure 2 In the software architecture shown, the method includes:
[0082] S11. The hardware driver obtains and broadcasts hardware information.
[0083] Among them, the hardware driver may include but is not limited to a display driver, a CPU driver, and a battery driver, and the obtained hardware information may include but is not limited to display status information of the display screen, working status information of the processor, and charging status information of the battery. After the hardware driver obtains the hardware information, the hardware information can be broadcast so that the modules or applications that have registered to receive the broadcast can receive the hardware information broadcasted by the hardware driver. In some implementations, the hardware driver can continuously broadcast the obtained hardware information.
[0084] S12. JobScheduler receives the hardware information broadcast by the hardware driver.
[0085] In some implementations, if the JobScheduler is enabled to receive broadcast messages from the hardware driver, the JobScheduler may register a broadcast request with the hardware driver in advance to receive the broadcasted hardware information when the hardware driver broadcasts the hardware information.
[0086] S13, JobScheduler determines whether the preset conditions are met according to the hardware information, and if so, executes S14.
[0087] The preset condition may represent a start condition of the preset service, that is, the preset service may be started when the preset condition is met.
[0088] In some implementations, the preset condition may include: the display state of the display screen of the electronic device is off, the battery is in a charging state, and the processor is in an idle state for a preset time. Then, JobScheduler can determine whether the preset condition is met based on the received hardware information, and if so, execute the following S14. Exemplarily, the preset time can be 30 minutes.
[0089] In other implementations, the preset condition may include: the display state of the electronic device is off, the battery is in a charging state, and the processor is in an idle state for a preset time period, or both. In still other implementations, the preset condition may also include: the system time is within a preset time period, such as the preset time period from 1:00 to 4:00 in the morning. In this implementation, JobScheduler also needs to obtain information about the current system time.
[0090] S14. JobScheduler starts the preset service.
[0091] That is to say, if JobScheduler determines that the above preset conditions are met, the preset service can be started asynchronously in the background. In some implementations, the preset service may include one or more services, such as a system update service, an application update service, and a smart service.
[0092] It is understood that after the preset service is started in the background, it will automatically execute the service's own tasks until the tasks are completed. It is also understood that after the JobScheduler starts the preset service, it will no longer participate in the execution process of the started service.
[0093] S15. The monitoring module receives the hardware information broadcast by the hardware driver.
[0094] S16. The monitoring module determines whether the preset condition is met according to the hardware information. If not, and the preset service is still being executed, S17 is executed.
[0095] Among them, after the preset service is started, the monitoring module can start and continuously receive the hardware information broadcast by the above-mentioned hardware driver, and judge whether the preset condition is still met based on the received hardware information. Then, there may be some scenarios that cause the preset condition to be broken. For example, when the preset conditions include that the display state of the display screen of the electronic device is off, the battery is in a charging state, and the processor is in an idle state for a preset time, if the display state of the display screen is switched to a bright screen state or the battery is switched to an uncharged state, the preset condition is no longer met. Therefore, when the preset condition is not met and the above-mentioned preset service is still being executed, the following S17 can be executed.
[0096] S17. The monitoring module calls the fuse judgment module to determine the amount of resources required to be consumed by the remaining tasks corresponding to the preset service.
[0097] Because if the preset conditions are not met, that is, the start conditions of the preset service are no longer met, but the preset service is still running in the background, this may affect the performance of the electronic device. For example, if the battery is switched to an uncharged state and the preset service is still running in the background, the power of the electronic device will be consumed faster. Then, in this scenario, the monitoring module can call the fuse judgment module to determine the amount of resources required for the remaining tasks corresponding to the preset service. If the amount of resources required for the remaining tasks is still relatively large, the preset service can be fused so that the preset service no longer runs in the background to improve the performance of the electronic device.
[0098] In some implementations, the amount of resources that the remaining tasks need to consume may include processor (eg, CPU) runtime and / or battery power.
[0099] In the case where the amount of resources required to be consumed by the remaining tasks includes the processor running time, in some implementations, the fuse judgment module can determine the processor running time required to be consumed by the remaining tasks based on the single-round execution time and the remaining execution rounds during the execution of the preset service. When the preset service is executed in the background, it usually takes multiple rounds to complete the tasks of the entire service, and the single-round execution time is the execution time of one round. Then the fuse judgment module can calculate the processor running time required for the remaining tasks based on the single-round execution time and the remaining execution rounds.
[0100] Exemplarily, the fuse judgment module may include The relationship between the remaining tasks and the processor running time (EstimatedRemainTime) is calculated. In the case where the preset service includes intelligent services (such as gallery search function, intelligent recommendation application, etc.), It is used to calculate the single-round execution time of the preset service execution process, and (TotalEpoch-CurEpoch) is used to calculate the remaining execution rounds. CurParams represents the current feature parameter size of a single round of execution during the execution of the preset service, which may include the number of samples and feature dimensions. The number of samples may include the number of operations of the user using the electronic device (such as the number of screen on and off times, the number of clicks, etc.), and the feature dimensions may include the relationship between the preset service executed this time and other services executed previously, the charging status of the electronic device, the network status, the location status and other dimensions. MaxParams represents the maximum feature parameter size of a single round of execution during the execution of the preset service obtained through training. The F function is a function (or model) obtained through training that calculates the single-round execution time based on CurParams and MaxParams. The F function can be a linear or nonlinear function. TotalEpoch represents the total execution rounds corresponding to the preset service, and CurEpoch represents the currently executed rounds corresponding to the preset service. It can be understood that CurParams and CurEpoch can be read from the running parameters (or the information carried) during the execution of the preset service, and MaxParams and TotalEpoch are fixed parameters obtained through training. Optionally, MaxParams can be the default value 7332000, and TotalEpoch can be the default value 100000.
[0101] In other implementations, the fuse determination module may determine the processor running time required for the remaining tasks based on the single-round execution time during the preset service execution process, the computing power coefficient of the electronic device, and the remaining execution rounds.
[0102] Exemplarily, the fuse judgment module may include The relationship between the remaining tasks is used to calculate the processor running time required. Among them, It is used to calculate the single-round execution time during the execution of the preset service. (TotalEpoch-CurEpoch) is used to calculate the remaining execution rounds. Used to calculate the computing power coefficient of electronic devices. MinPower represents the lowest chip computing power among electronic devices of different chip types, and CurPower represents the chip computing power of the current electronic device. It can be understood that if the influence of chip computing power is not considered, then The value can be 1 or other constant items. If the influence of chip computing power is taken into account, the stronger the chip computing power of the current electronic device, the shorter the processor running time required.
[0103] In some other implementations, the fuse judgment module can calculate the total processor running time required for the preset service based on the single-round execution time during the execution of the preset service, the computing power coefficient of the electronic device, and the total execution rounds corresponding to the preset service, and then determine the processor running time required for the remaining tasks based on the total processor running time required for the preset service and the consumed processor running time.
[0104] Exemplarily, the fuse determination module may calculate the total processor running time (EstimatedTime) required for the preset service according to the following relationship:
[0105]
[0106] Then, the processor running time required for the remaining tasks is calculated based on the relationship between EstimatedTime-ConsumedTime. Used to calculate the single-round execution time during the execution of the preset service. Used to calculate the computing power coefficient of the electronic device, TotalEpoch represents the total execution rounds corresponding to the preset service, and ConsumedTime represents the consumed processor running time.
[0107] When the amount of resources required to be consumed by the remaining tasks includes battery power, in some implementations, the fuse judgment module can determine the battery power required to be consumed by the remaining tasks based on the processor running time (EstimatedRemainTime) required to be consumed by the remaining tasks and the power consumption per unit time.
[0108] Exemplarily, the fuse judgment module can calculate the battery power (EstimatedRemainPower) required to be consumed by the remaining tasks according to the relationship including EstimatedRemainPower×PowerRatio. Wherein, PowerRatio represents the power consumption per unit time, and the power consumption process of the electronic device can be regarded as uniform consumption, for example, PowerRatio is 10 mA per minute.
[0109] In other implementations, the fuse judgment module can calculate the total battery power required for the preset service based on the total processor running time (EstimatedTime) required for the preset service and the power consumption per unit time, and then determine the battery power required for the remaining tasks based on the total battery power required for the preset service and the consumed battery power.
[0110] Exemplarily, the fuse judgment module can calculate the total battery power (EstimatedPower) required for the preset service according to the relationship formula including EstimatedTime×PowerRatio, and then calculate the battery power required for the remaining tasks according to the relationship formula including EstimatedPower-ConsumedPower, where ConsumedPower represents the battery power consumed.
[0111] S18, the fuse judgment module judges whether the amount of resources consumed by the remaining tasks is greater than the preset threshold. If so, S19 is executed; if not, the preset service is kept running.
[0112] Among them, when the amount of resources required to be consumed by the remaining tasks corresponding to the preset service is greater than the preset threshold, if the preset service is continued to run, the resources of the electronic device will be consumed faster, affecting the performance of the electronic device, so the process of fusing the preset service in S19 below can be executed. When the amount of resources required to be consumed by the remaining tasks corresponding to the preset service is not greater than the preset threshold, the performance of the electronic device may be less affected, so the preset service can continue to run.
[0113] In some implementations, when the amount of resources required to be consumed by the remaining tasks includes processor runtime and / or battery power, the preset threshold may include a time threshold and a power threshold, and the fuse judgment module may respectively judge whether the processor runtime required to be consumed by the remaining tasks is greater than the time threshold, and whether the battery power required to be consumed by the remaining tasks is greater than the power threshold. Exemplarily, the time threshold may be 10 minutes, and the power threshold may be 10%×the total battery power of the electronic device.
[0114] S19. The fuse judgment module sends an instruction message to the fuse execution module to instruct the fuse execution module to fuse the preset service.
[0115] S20, the fuse execution module fuses the preset service.
[0116] That is to say, when the amount of resources required to be consumed by the remaining tasks is greater than the preset threshold, the preset service needs to be blown. Then, the blow judgment module can send an indication message to the blow execution module, and the blow execution module will blow and discard the preset service.
[0117] Because the preset service usually runs in the process, in some implementations, if there are multiple services (including the preset service and other services) currently running in the process, the fuse execution module can only end the operation of the preset service, that is, the preset service stops running. In other implementations, if the process is a dedicated process of the preset service and is only used to run the preset service, the fuse execution module can interrupt the process or destroy the process, or, in the scenario where the freezing process can be achieved, the fuse execution module can also freeze the process.
[0118] In the above-mentioned service fuse method, when the preset conditions are met, the electronic device executes the preset service in the background. If it is detected during the execution of the preset service that the preset conditions are no longer met, it is determined how much resources the remaining tasks corresponding to the preset service still need to consume. If the amount of resources required is greater than the preset threshold, the preset service is fused and discarded, and the service is no longer executed in the background, thereby reducing the impact of the background running of the preset service on the foreground running application and reducing battery power consumption, so as to improve the performance of the electronic device.
[0119] based on Figure 4 The embodiment shown, Figure 5 : is a flow chart of a service fuse method provided in an embodiment of the present application. The method can be executed by an electronic device and may specifically include:
[0120] S101: Acquire first hardware information.
[0121] The first hardware information may be information collected by the hardware driver at the first moment. The hardware driver usually collects hardware information in real time. The first moment is any moment in the process of collecting hardware information, that is, the electronic device can also obtain the first hardware information in real time.
[0122] S102: Determine whether a preset condition is met according to the first hardware information, and if so, start the preset service.
[0123] After obtaining the first hardware information, the electronic device can determine whether the preset condition is met based on the first hardware information. The judgment process can refer to the description of S13 in the above embodiment, which will not be repeated here. It can be understood that if the electronic device obtains the first hardware information in real time, then the electronic device can also determine in real time whether the preset condition is met. In some implementations, the electronic device can use a service startup mechanism based on JobScheduler to start the preset service.
[0124] S103: After the preset service is started, obtain second hardware information.
[0125] Among them, after the preset conditions are met and the preset service is started, the electronic device will continue to obtain hardware information, and the obtained hardware information can be recorded as second hardware information. Then, the second hardware information can be information collected by the hardware driver at the second moment, and the second moment is greater than the first moment.
[0126] S104: Determine whether the preset condition is met according to the second hardware information; if not, and the preset service is still being executed, determine the amount of resources that need to be consumed by the remaining tasks corresponding to the preset service.
[0127] After acquiring the second hardware information, the electronic device can continue to determine whether the preset condition is still satisfied based on the second hardware information. If the preset condition is no longer satisfied but the preset service is still being executed, it may affect the performance of the electronic device. The electronic device can determine the amount of resources required to be consumed by the remaining tasks corresponding to the preset service. The process of the electronic device determining the amount of resources required to be consumed by the remaining tasks corresponding to the preset service can be referred to in the above S17, which will not be repeated here.
[0128] S105: If the amount of resources required to be consumed by the remaining tasks corresponding to the preset service is greater than a preset threshold, the preset service is disconnected.
[0129] That is to say, when the amount of resources required by the remaining tasks corresponding to the preset service is greater than the preset threshold, continuing to run the preset service in the background will cause the resources of the electronic device to be consumed faster, affecting the performance of the electronic device. Therefore, the preset service can be fused and discarded, that is, the preset service will no longer be executed in the background.
[0130] In the above-mentioned service fuse method, when the preset conditions are met, the electronic device executes the preset service in the background. If it is detected during the execution of the preset service that the preset conditions are no longer met, it is determined how much resources the remaining tasks corresponding to the preset service still need to consume. If the amount of resources required is greater than the preset threshold, the preset service is fused and discarded, and the service is no longer executed in the background, thereby reducing the impact of the background running of the preset service on the foreground running application and reducing battery power consumption, so as to improve the performance of the electronic device.
[0131] The above describes in detail an example of a service fuse method provided by an embodiment of the present application. It is understandable that, in order to implement the above functions, the electronic device includes hardware and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, 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 the present application.
[0132] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0133] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0134] The electronic device provided in this embodiment is used to execute the above-mentioned service fuse method, and thus can achieve the same effect as the above-mentioned implementation method.
[0135] In the case of an integrated unit, the electronic device may further include a processing module, a storage module and a communication module. The processing module may be used to control and manage the actions of the electronic device. The storage module may be used to support the electronic device to execute stored program codes and data, etc. The communication module may be used to support the electronic device to communicate with other devices.
[0136] Among them, the processing module can be a processor or a controller. It 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 a digital signal processor (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, a Wi-Fi chip, etc.
[0137] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 2 Device of the structure shown.
[0138] The embodiment of the present application also provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the processor executes the service fuse method of any of the above embodiments. The storage medium may include: 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, and other media that can store program codes.
[0139] An embodiment of the present application also provides a computer program product. When the computer program product runs on a computer, it enables the computer to execute the above-mentioned related steps to implement the service fuse method in the above-mentioned embodiment.
[0140] In addition, an embodiment of the present application also provides a device, which may specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor may execute the computer-executable instructions stored in the memory so that the chip executes the service fuse method in the above-mentioned method embodiments.
[0141] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above and will not be repeated here.
[0142] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0143] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0144] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field 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. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A service fuse method, the method being executed by an electronic device, characterized in that: The method comprises: Acquire first hardware information, where the first hardware information is information collected by a hardware driver at a first moment; In the case where it is determined according to the first hardware information that a preset condition is satisfied, starting a preset service, wherein the preset condition represents a starting condition of the preset service; After starting the preset service, obtaining second hardware information, where the second hardware information is information collected by the hardware driver at a second time, and the second time is greater than the first time; In the case where it is determined according to the second hardware information that the preset condition is not satisfied, if the preset service is still being executed, determining the amount of resources required to be consumed by the remaining tasks corresponding to the preset service; If the amount of resources required to be consumed by the remaining tasks is greater than a preset threshold, the preset service is disconnected.
2. The method according to claim 1, characterized in that In a case where the amount of resources required to be consumed by the remaining tasks includes processor running time, determining the amount of resources required to be consumed by the remaining tasks corresponding to the preset service includes: The processor running time required to be consumed by the remaining tasks is determined according to the single-round execution time and the remaining execution rounds in the preset service execution process.
3. The method according to claim 2, characterized in that The determining, according to the single-round execution time and the remaining execution rounds in the preset service execution process, the processor running time required to be consumed by the remaining tasks includes: According to the inclusion , and calculate the processor running time required for the remaining tasks, where It is used to calculate the single-round execution time of the preset service execution process, (TotalEpoch-CurEpoch) is used to calculate the remaining execution rounds, CurParams represents the current feature parameter size of a single round of execution during the preset service execution process, MaxParams represents the maximum feature parameter size of a single round of execution during the preset service execution process obtained by training, TotalEpoch represents the total execution rounds corresponding to the preset service, and CurEpoch represents the currently executed round corresponding to the preset service.
4. The method according to claim 2, characterized in that: The determining, according to the single-round execution time and the remaining execution rounds in the preset service execution process, the processor running time required to be consumed by the remaining tasks includes: The processor running time required for the remaining tasks is determined according to the single-round execution time during the execution of the preset service, the computing power coefficient of the electronic device and the remaining execution rounds.
5. The method according to claim 4, characterized in that The determining, according to the single-round execution time in the execution process of the preset service, the computing power coefficient of the electronic device and the remaining execution rounds, the processor running time required to be consumed by the remaining tasks includes: According to the inclusion , and calculate the processor running time required for the remaining tasks, where Used to calculate the single-round execution time during the execution of the preset service, Used to calculate the computing power coefficient of the electronic device, (TotalRpoch-CurEpoch) is used to calculate the remaining execution rounds, CurParams represents the current feature parameter size of a single round of execution during the execution of the preset service, MaxParams represents the maximum feature parameter size of a single round of execution during the execution of the preset service obtained through training, MinPower represents the minimum chip computing power in electronic devices of different chip types, CurPower represents the chip computing power of the electronic device, TotalEpoch represents the total execution rounds corresponding to the preset service, and CurEpoch represents the currently executed rounds corresponding to the preset service.
6. The method according to any one of claims 2 to 5, characterized in that In a case where the amount of resources required to be consumed by the remaining tasks also includes battery power, determining the amount of resources required to be consumed by the remaining tasks corresponding to the preset service includes: The battery power required to be consumed by the remaining tasks is determined according to the processor running time required to be consumed by the remaining tasks and the power consumption per unit time.
7. The method according to claim 6, characterized in that The determining the battery power required to be consumed by the remaining tasks according to the processor running time required to be consumed by the remaining tasks and the power consumption per unit time includes: The battery power required to be consumed by the remaining tasks is calculated according to a relationship including EstimatedRemainTime×PowerRatio, wherein EstimatedRemainTime represents the processor running time required to be consumed by the remaining tasks, and PowerRatio represents the power consumption per unit time.
8. The method according to any one of claims 1 to 7, characterized in that The first hardware information includes at least one of display status information of a display screen of the electronic device, working status information of a processor, and charging status information of a battery.
9. The method according to claim 8, characterized in that The determining, according to the first hardware information, that a preset condition is satisfied includes: If the display screen is in an off state, the battery is in a charging state, and the processor is in an idle state for a preset time, it is determined that the preset condition is met.
10. The method according to any one of claims 1 to 9, characterized in that The preset services started by the electronic device include one or more services.
11. The method according to claim 1, characterized in that: The electronic device includes a hardware driver and a task scheduler, and when it is determined according to the first hardware information that a preset condition is satisfied, starting a preset service includes: The task scheduler receives the first hardware information broadcast by the hardware driver; The task scheduler determines that a preset condition is met according to the first hardware information, and starts the preset service.
12. The method according to claim 11, characterized in that The electronic device further includes a monitoring module and a fuse judgment module, and when it is determined according to the second hardware information that the preset condition is not satisfied, if the preset service is still being executed, determining the amount of resources required to be consumed by the remaining tasks corresponding to the preset service, including: The monitoring module receives the second hardware information broadcast by the hardware driver; When the monitoring module determines according to the second hardware information that the preset condition is not satisfied, if the preset service is still being executed, the monitoring module calls the fuse determination module to determine the amount of resources required to be consumed by the remaining tasks corresponding to the preset service.
13. An electronic device, characterized in that: The electronic device comprises: one or more processors, and memory; The memory is coupled to the one or more processors, and the memory is used to store computer program codes, wherein the computer program codes include computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method as claimed in any one of claims 1 to 12.
14. A chip system, characterized in that: The chip system is applied to an electronic device, and the chip system includes one or more processors, and the one or more processors are used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium comprises instructions, which, when executed on an electronic device, enable the electronic device to perform the method as claimed in any one of claims 1 to 12.
Citation Information
Patent Citations
Centralized task scheduling
CN105190555A
Application service control method and device, storage medium and mobile terminal
CN107885588A
Application service control method and apparatus, storage medium and mobile terminal
CN107943270A
Method, device, apparatus and computer-readable storage medium for fusing service resources
CN109240765A
System resource control method and device based on terminal process fusing algorithm
CN113961359A
