System resource scheduling method and device and computer program product

By comprehensively considering task attributes and terminal priorities and adjusting resource allocation strategies, the problem of unreasonable resource allocation in multi-user systems is solved, ensuring the stable operation of key tasks and improving user experience and system performance.

CN120704890APending Publication Date: 2025-09-26SHANGHAI JIACHE INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510853883.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

Existing multi-user systems lack a reasonable mechanism for resource allocation, resulting in critical tasks being squeezed out by non-critical tasks, affecting user experience and system stability, especially in vehicle-mounted systems, which may affect driving safety.

Method used

By combining the attributes of the task itself and the priority of the initiating terminal, the task priority is comprehensively determined, and the resource allocation strategy is adjusted when the system is abnormal to ensure the resource requirements of critical tasks, reduce the performance or resource allocation of non-critical tasks, and optimize system resource allocation.

Benefits of technology

It improves the rationality of system resource allocation, ensures the stable operation of key tasks, enhances user experience, reduces waiting time, and improves the overall system performance and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120704890A_ABST
    Figure CN120704890A_ABST
Patent Text Reader

Abstract

The invention provides a system resource scheduling method and device and a computer program product, and the system comprises at least two terminals. The task priorities of the at least two terminals are not completely the same. The method comprises the following steps: determining a basic allocation strategy for allocating system resources to each task according to the priority of the tasks; adjusting the basic distribution strategy in combination with the task priority of the terminal initiating the task to obtain an adjusted distribution strategy; and distributing system resources for the task according to the adjusted distribution strategy. According to the method, the priority of the currently executed task is comprehensively determined by combining the priority determined according to the attribute of the task and the priority of the initiating terminal corresponding to the task, and then reasonable resource allocation is carried out, so that the operation of the system better meets the user requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of system resource management, and in particular to a method, device, and computer program product for scheduling system resources. Background Art

[0002] Systems that run multiple user interfaces and applications on a single hardware platform (SoC), such as smart home systems, smart office systems, smart education systems, and smart cockpit systems. These systems are usually equipped with multiple user-computer interaction terminals, such as touch screens.

[0003] Current systems of this type lack a rational resource allocation mechanism for multi-user concurrent operations. Specifically, these systems typically prioritize tasks based solely on their attributes and then allocate system resources accordingly.

[0004] In other words, because current systems with multiple terminals lack a reasonable allocation mechanism for allocating system resources, the system's operation cannot well meet user needs. This is especially true in vehicle systems with multiple terminals. For example, the driver's terminal is using navigation or smart driving, while the rear terminal is playing a 4K video with extremely high GPU usage. Another example: the driver's terminal is using smart driving, and the passenger terminal also opens the navigation to view accommodation and restaurants along the way. With the traditional resource allocation mechanism, more system resources are usually allocated to the navigation task initiated by the passenger terminal due to the higher priority of the navigation task itself. However, such non-critical tasks initiated by the passenger terminal are considered to be resource occupation of the more critical smart driving task for the driver's smart driving, thus affecting driving safety and user experience. Summary of the Invention

[0005] The purpose of the embodiments of the present application is to provide a method, device and computer program product for scheduling system resources. By determining the priority based on the attributes of the task itself and combining it with the priority of the initiating terminal corresponding to the task, the priority of the currently executed task is comprehensively determined, and then reasonable resource allocation is performed, so that the operation of the system can better meet user needs.

[0006] In a first aspect, the present application provides a method for scheduling system resources, wherein the system includes at least two terminals; the task priorities of the at least two terminals are not exactly the same; the method includes: determining a basic allocation strategy for allocating system resources to each of the tasks based on the priority of the task; adjusting the basic allocation strategy in combination with the task priority of the terminal that initiates the task to obtain an adjusted allocation strategy; and allocating system resources to the task based on the adjusted allocation strategy.

[0007] The above-mentioned system resource scheduling method comprehensively determines the priority of the currently executed task by determining the priority based on the attributes of the task itself and combining it with the priority of the initiating terminal corresponding to the task. Since both the attributes of the task to be executed and the terminal that initiates the task are taken into account, the allocation of system resources is more reasonable, and ultimately better meets user needs.

[0008] In combination with the first aspect, optionally, the system includes a vehicle-computer system, the terminal includes a main driver terminal with the highest task priority, and the task includes a persistent critical task; allocating system resources to the task according to the adjusted allocation strategy includes: monitoring the operating status of the system; and in the event of an abnormality in the operation of the system, keeping the system resources occupied by the persistent critical task initiated by the main driver terminal unchanged.

[0009] The above-mentioned system resource scheduling method can alleviate the situation where anomalies occur during system operation and it is necessary to allocate system resources among tasks or reduce the system resources allocated to most tasks, etc. By keeping the system resources occupied by continuous critical tasks such as navigation initiated by the main driver terminal unchanged, the performance of the task is ensured to be stable during operation, thereby further meeting the needs of users.

[0010] In combination with the first aspect, optionally, the task also includes a non-critical task; the exception includes an operating environment exception; and the allocation of system resources to the task according to the adjusted allocation strategy also includes: when the environmental exception occurs during the operation of the system, calling the application performance control tools corresponding to the non-critical task and the task not initiated by the main driver terminal to reduce the performance of the corresponding task.

[0011] The above-mentioned system resource scheduling method, when the system operation environment is abnormal, calls the application performance control tool of the corresponding task to reduce the performance of the task, thereby releasing system resources to ensure the smoothness of system operation, thereby better meeting user needs and further improving user experience.

[0012] In combination with the first aspect, optionally, the abnormality also includes a high resource consumption abnormality; allocating system resources to the task according to the adjusted allocation strategy also includes: when the high resource consumption abnormality occurs during the operation of the system, calling the system resource management tool to reduce the system resources allocated to the non-critical tasks and tasks not initiated by the main driver terminal.

[0013] The above-mentioned system resource scheduling method, when the system operation has abnormal high resource consumption, reduces the system resources allocated to non-critical tasks and tasks initiated by non-driver terminals by calling the system resource management tool, thereby releasing system resources to ensure the smoothness of system operation and the performance of continuous critical tasks initiated by the driver terminal, thereby better meeting user needs and further improving user experience.

[0014] In combination with the first aspect, optionally, the basic allocation strategy is adjusted in combination with the task priority of the terminal that initiates the task to obtain the adjusted allocation strategy, including: after receiving the task request that initiates the task, obtaining the identity of the terminal from the task request; determining the role of the terminal based on the identity; wherein the role indicates whether the terminal is the main driving terminal or the non-main driving terminal; and determining the task priority of the terminal based on the role of the terminal.

[0015] The above-mentioned system resource scheduling method, based on terminal identity, enables more precise resource allocation. This allows terminals with different identities or roles to be allocated different CPU, GPU, memory, and other resources. This ensures that critical tasks (such as navigation and driver assistance) initiated by designated terminals have sufficient resources to run. This further improves the rationality of system resource allocation, enhances overall system performance and stability, and ultimately enhances the user experience.

[0016] In combination with the first aspect, optionally, the task includes a trigger-critical task; and allocating system resources to the task according to the adjusted allocation strategy includes: when the trigger-critical task is triggered by the main driver terminal, increasing the system resources allocated to the trigger-critical task.

[0017] The above-mentioned system resource scheduling method ensures the smooth execution of the triggering critical task by increasing the system resources allocated to the task when the triggering critical task is triggered by the main driver terminal. The system can respond to the user's voice commands and other instructions that trigger the task more quickly, thereby providing timely feedback, reducing the user's waiting time, and ultimately further improving the user experience.

[0018] In combination with the first aspect, optionally, the increasing of system resources allocated to the trigger-critical task includes: increasing at least one of the CPU time slice, the number of CPU threads, and the memory allocation of the trigger-critical task, and / or increasing the graphics processor usage frequency of the trigger-critical task.

[0019] The above-mentioned system resource scheduling method, when a trigger-critical task is initiated by the main driver terminal, specifically controls at least one of the CPU time slice, the number of CPU threads, the memory allocation, and the graphics processor usage frequency to increase the system resources allocated to the trigger-critical task, provides a variety of optional system resources for targeted allocation to the trigger-critical task, further ensures the smooth execution of the trigger-critical task, and thus further improves the user experience.

[0020] In combination with the first aspect, optionally, the basic allocation strategy is adjusted in combination with the task priority of the terminal that initiates the task to obtain an adjusted allocation strategy, including: assigning a first weight coefficient to each task according to the type of each task; wherein the first weight coefficient represents the priority of the task; assigning a second weight coefficient to each terminal according to the type of each terminal; wherein the second weight coefficient represents the task priority of the terminal; determining the priority coefficient when the task is initiated on the corresponding terminal according to the product of the first weight coefficient and the second weight coefficient; wherein the priority coefficient is used to determine the proportion of the allocated system resources.

[0021] The above-mentioned system resource scheduling method assigns a first weight coefficient based on the type of each task and a second weight coefficient based on the type of each terminal. The method then determines the priority coefficient of a specific task initiated by a specific terminal based on the product of the first and second weight coefficients. System resources are allocated based on this priority coefficient, and the priority of resource allocation is determined accordingly. This method comprehensively considers the attributes of the task to be executed and the type of terminal initiating the task, and further refines the calculation details of the specific priority coefficient. This further improves the rationality of system resource allocation, better meets user needs, and further enhances the user experience.

[0022] In the second aspect, the present application provides a scheduling device for system resources, including: a determination module, used to determine a basic allocation strategy for allocating system resources to each task based on the type of task; an adjustment module, used to adjust the basic allocation strategy in combination with the task priority of the terminal that initiates the task to obtain an adjusted allocation strategy; an allocation module, used to allocate system resources to the task according to the adjusted allocation strategy.

[0023] The above-mentioned system resource scheduling device has the same beneficial effects as the system resource scheduling method provided by the above-mentioned first aspect, or any optional implementation method of the first aspect, and will not be described in detail here.

[0024] In a third aspect, the present application further provides a computer program product, which includes a computer program / instructions, and when the computer program / instructions are executed by a processor, implements the method described in the first aspect.

[0025] The above-mentioned computer program product has the same beneficial effects as the system resource scheduling method provided by the above-mentioned first aspect, or any optional implementation method of the first aspect, and will not be described in detail here.

[0026] In summary, the system resource scheduling method, apparatus, and computer program product provided by the present application comprehensively determine the priority of the currently executed task by combining the priority determined by the task's own attributes with the priority of the initiating terminal corresponding to the task, and then reasonably allocate resources, so that the operation of the system better meets user needs. Furthermore, when an abnormality occurs during system operation and it is necessary to allocate system resources between tasks or reduce the system resources allocated to most tasks to alleviate the abnormality, by maintaining the system resources occupied by persistent critical tasks such as navigation initiated by the main driver terminal unchanged, the performance of the task is ensured to be stable during operation, thereby further meeting user needs. In the event of an abnormal operating environment during system operation, the performance of the task is reduced by calling the application performance control tool of the corresponding task. In the event of high resource consumption abnormality during system operation, the system resource management tool is called to reduce the system resources allocated to non-critical tasks and tasks initiated by non-main driver terminals, respectively. Both better meet user needs and further improve the user experience. In the event that a triggering critical task is triggered by the main driver terminal, the system resources allocated to the task are increased to ensure the smooth execution of the triggering critical task. This provides timely feedback, reduces user waiting time, and ultimately further improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without creative work.

[0028] Figure 1 A schematic diagram of the connection of the system provided in the embodiment of the present application; Figure 2 A flowchart of a method for scheduling system resources provided in an embodiment of the present application; Figure 3 A specific flow chart of step S160 in the system resource scheduling method provided in an embodiment of the present application; Figure 4 A first specific flow chart of step S140 in the system resource scheduling method provided in an embodiment of the present application; Figure 5 A second specific flow chart of step S140 in the system resource scheduling method provided in an embodiment of the present application; Figure 6 A functional module diagram of a system resource scheduling device provided in an embodiment of the present application.

[0029] Icons: 600, system resource scheduling device; 610, determination module; 620, adjustment module; 630, allocation module. DETAILED DESCRIPTION

[0030] The following embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application and are therefore only examples and are not intended to limit the scope of protection of the present application.

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application.

[0032] In the description of the embodiments of this application, the technical terms "first," "second," etc. are used only to distinguish different objects and should not be understood to indicate or imply relative importance or to implicitly indicate the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise specifically defined.

[0033] Taking the vehicle-mounted system (VMI) of a smart cockpit as an example, this system may include terminals such as the driver's touchscreen for the driver's seat, the passenger touchscreen for the front passenger seat, and the rear touchscreens for the rear seats. For this type of VMI system, traditional system resource scheduling schemes primarily prioritize tasks based solely on their inherent attributes, failing to consider that the same task may have different priorities when initiated by different terminals. For example, when a navigation task is initiated by the driver's touchscreen, it primarily provides guidance to the driver, which is crucial for driving safety. Therefore, given limited system resources, the system resources required for the navigation task initiated by the driver's touchscreen should be prioritized. Conversely, when a navigation task is initiated by the passenger touchscreen or rear seat touchscreen, it is typically used for non-critical tasks such as viewing nearby restaurants and attractions based on the navigation route. Therefore, given limited system resources, when the driver's touchscreen initiates other critical tasks, it should be considered that these tasks corresponding to these non-critical tasks yield certain system resources to the critical tasks. Among them, system resources include but are not limited to CPU (central processing unit) time slices, number of CPU (central processing unit) threads, GPU execution efficiency, GPU video memory, GPU screen refresh rate, physical memory (RAM), memory bandwidth, and read-only memory (ROM).

[0034] It is precisely because traditional resource scheduling solutions do not take into account comprehensive factors during the system resource scheduling process that such solutions lack rationality in scheduling system resources and are unable to meet user needs well.

[0035] In view of this, the present application provides a system resource scheduling method, apparatus, and computer program product to solve the above technical problems. Specifically, please read the embodiments and drawings provided in the present application.

[0036] See Figure 1 , is a connection diagram of the system provided in an embodiment of the present application. In the method for scheduling system resources provided in an embodiment of the present application, the system may specifically be a vehicle system, or a smart home system, a smart office system, or a smart education system. It may include a host and at least two terminals capable of human-computer interaction, such as a touch screen. The task priorities of these terminals are not exactly the same. That is, at least one of these terminals has a higher priority than all other terminals.

[0037] See Figure 2 , Figure 2 This is a flow chart of a method for scheduling system resources provided by an embodiment of the present application. The method may include: Step S120: Determine a basic allocation strategy for allocating system resources to each task based on the priority of the task.

[0038] In step S120 above, the priority of a task generally refers to the priority corresponding to the attributes of the task itself. For example, different tasks are initiated by the same terminal in the vehicle system, such as an entertainment audio-visual task and a system patch download task. Of these two tasks, the entertainment audio-visual task generally has a higher priority than the system patch download task, which means that the patch download task can be performed when the system is restricted. Correspondingly, the task priority of a terminal refers to the fact that the same task, when initiated by terminals with different priorities, generally has different corresponding priorities. For example, the priority of the main driver terminal corresponding to the main driver and the secondary driver terminal corresponding to the secondary driver in the vehicle system is generally higher than that of the secondary driver terminal. If a navigation task is initiated by these two different terminals, the navigation task of the main driver terminal is generally used to provide important guidance and assistance to the driver, while the navigation task of the secondary driver terminal is generally used for the secondary driver to check nearby food, attractions, and other non-critical needs according to the navigation route. Therefore, the task priority of the navigation task when initiated by the main driver terminal is higher than that when initiated by the secondary driver terminal.

[0039] After the system boots up and completes initialization, the system can determine the priority of each task based on its own attributes. This priority can be used to determine the basic allocation strategy for system resources allocated to each task when it is initiated. This basic allocation strategy corresponds to the relative criticality of tasks when they are initiated by the same terminal.

[0040] Step S140: adjusting the basic allocation strategy in combination with the task priority of the terminal that initiates the task to obtain an adjusted allocation strategy. In the above step S140, that is, when a certain task is initiated, the priority determined by the task's own attributes and the task priority of the terminal that initiated the task can be combined to comprehensively determine the system resources allocated for the execution of the task and whether other tasks will transfer system resources to the task or the task will transfer system resources to other tasks under special circumstances during the execution of the task. Specifically, when the number of terminals assigned to the vehicle system and the number of tasks to be executed are small, priority can be sorted for each task in all situations initiated by each terminal according to actual conditions. For example, the vehicle system includes a main driver terminal and a co-driver terminal, and the tasks to be executed include: Task A, Task B, and Task C. Then, the priority sorting for them can be: Task A initiated by the main driver terminal has the highest priority, Task B initiated by the main driver terminal has the second highest priority, Task C initiated by the main driver terminal, Task A, Task B, and Task C initiated by the co-driver terminal have the lowest priority.

[0041] Step S160: Allocate system resources to the task according to the adjusted allocation strategy.

[0042] In the above step S160, based on the priorities of the tasks when initiated by the corresponding terminals, the priorities for allocating system resources and the method for allocating system resources in special cases can be determined.

[0043] In the above implementation process, the priority of the currently executed task is determined by combining the priority determined by the attributes of the task itself and the priority of the initiating terminal corresponding to the task. Since the attributes of the task to be executed and the terminal that initiates the task are taken into account, the allocation of system resources is more reasonable, and ultimately better meets user needs.

[0044] Please refer to Figure 3 , Figure 3 It is a specific flow chart of step S160 in the method for scheduling system resources provided in an embodiment of the present application. In some optional implementations, the system may include a vehicle-mounted system, and the terminal may include a main driver terminal with the highest task priority (that is, the terminal corresponding to the main driver mentioned above). Tasks may include persistent critical tasks. Continuous critical tasks may refer to tasks that need to maintain a higher priority during the operation of the main driver terminal once they are initiated by the main driver terminal, for example: a navigation task, in the process of being initiated and run by the main driver terminal, the operating performance of the navigation task must be prioritized.

[0045] Accordingly, step S160 may include: Step S161: Monitor the operating status of the system.

[0046] In step S161 above, a behavior analysis module in the system can be used, and a behavior analysis mechanism can be introduced for the module to evaluate the real-time resource usage of the task by reading system resource call data, such as the GPU drawing frequency and CPU usage curve of SurfaceFlinger (the core display service in the Android system, responsible for managing the graphics buffer, synthesizing each layer of Surface, and ultimately outputting to the display).

[0047] Step S162: In the event of an abnormality in the system operation, the system resources occupied by the persistent critical tasks initiated by the main driver terminal are kept unchanged.

[0048] In step S162 above, abnormal conditions that may occur during system operation may include: high resource consumption abnormalities, where the system resource usage level exceeds a set threshold, and operating environment abnormalities, such as excessively high system hardware temperatures caused by factors such as the vehicle's external ambient temperature. In the event of these abnormalities, it is usually necessary to reduce resource consumption across the entire system by allocating system resources between tasks or reducing the system resources allocated to most tasks to alleviate the abnormality. However, whether allocating system resources between tasks or reducing the system resources allocated to most tasks, the system resources occupied by the persistent critical task initiated by the driver's terminal can be kept unchanged to ensure the performance of this persistent critical task.

[0049] During the above implementation process, if an anomaly occurs during system operation and it is necessary to allocate system resources between tasks or reduce the system resources allocated to most tasks to alleviate the anomaly, the system resources occupied by continuous critical tasks such as navigation initiated by the main driver terminal are kept unchanged, thereby ensuring the stable performance of the task during operation, thereby further meeting the needs of users.

[0050] In some optional implementations, tasks may also include non-critical tasks. Non-critical tasks may refer to tasks that do not require a high priority for resource allocation, such as music playback tasks and video playback tasks. Exceptions may include operating environment exceptions. Operating environment exceptions may include system hardware exceptions caused by the external environment exceptions described above.

[0051] Accordingly, step S160 may further include: Step S163: When an abnormal environment occurs during system operation, the application performance control tools corresponding to non-critical tasks and tasks initiated by non-driver terminals are called to reduce the performance of the corresponding tasks.

[0052] In the above step S163, the application performance tools may include Choreographer and setFrameRate() API, etc. Among them, Choreographer is the frame scheduler in the Android system responsible for coordinating application drawing, animation and input events. Its core function is to listen to the VSync (vertical synchronization) signal and trigger the application's UI rendering process at the appropriate time to ensure a stable frame rate. setFrameRate() is an API introduced in Android 12 (API 31), which allows applications to actively request a specific rendering frame rate (such as 90Hz, 120Hz) and inform the system of the optimal refresh rate of its content. Choreographer and setFrameRate() APIs can be used to reduce the task frame rate to achieve control of SurfaceFlinger frame rate refresh.

[0053] During the above implementation process, when the system encounters an abnormal operating environment, the application performance control tool of the corresponding task is called to reduce the performance of the task, thereby releasing system resources to ensure the smoothness of system operation, thereby better meeting user needs and further improving user experience.

[0054] In some optional implementations, the anomaly may also include a high resource consumption anomaly. A high resource consumption anomaly may refer to the aforementioned anomaly where system resource usage exceeds a set threshold. For example, a CPU utilization rate consistently exceeding 60%, a GPU rendering frame rate exceeding 40fps, or any of these conditions may be met to determine that the system has experienced a high resource consumption anomaly.

[0055] Accordingly, allocating system resources to tasks according to the adjusted allocation strategy may further include: Step S164: When the system operation has abnormal high resource consumption, the system resource management tool is called to reduce the system resources allocated to non-critical tasks and tasks initiated by non-main driver terminals.

[0056] In step S164, the system resource management tools may include JobScheduler, WorkManager, nice values, and cgroups. JobScheduler is a system service introduced by Android that automatically schedules tasks when conditions are met; WorkManager is a Jetpack component used to manage task latency and ensure task executability; nice values ​​are a parameter in Linux process scheduling, and group is a Linux kernel function used to limit and isolate resource usage by process groups. Both can be used to limit the CPU time slice of a task.

[0057] During the above implementation process, when the system operation encounters abnormal high resource consumption, the system resource management tool is called to reduce the system resources allocated to non-critical tasks and tasks initiated by non-driver terminals, thereby releasing system resources to ensure the smoothness of system operation and the performance of continuous critical tasks initiated by the driver terminal, thereby better meeting user needs and further improving user experience.

[0058] Please refer to Figure 4 , Figure 4 This is a first specific flow chart of step S140 in the system resource scheduling method provided in the embodiment of the present application. In some optional implementations, the basic allocation strategy is adjusted in combination with the task priority of the terminal initiating the task to obtain the adjusted allocation strategy, which may include: Step S141: After receiving a task request for initiating a task, an identity identifier of the terminal is obtained from the task request.

[0059] In step S141, the binding of user roles to task interfaces can be achieved by identifying different user profiles and display mappings based on the Android system's UserHandle and DisplayManager. For example, the driver's terminal is identified by DisplayId = 0, and the passenger terminal is identified by DisplayId = 1. Furthermore, if the vehicle to which the in-vehicle system belongs is equipped with a rear-seat touchscreen, the rear-seat touchscreen can function as a rear-seat terminal using a sub-user profile or DisplayId = 2. UserHandle is the Android mechanism for identifying and managing multi-user environments; DisplayManager is the Android system service for managing multiple display devices (such as external screens and virtual monitors).

[0060] Step S142: Determine the role of the terminal according to the identity identifier.

[0061] In step S142, the role indicates whether the terminal is a driver's seat terminal or a non-driver's seat terminal. In other words, based on the value of the terminal's DisplayId, the specific identity or role of the terminal, such as the driver's seat terminal, the co-driver's seat terminal, or the rear-seat terminal, can be determined.

[0062] Step S143: Determine the task priority of the terminal according to the role of the terminal.

[0063] In the above implementation, terminal-based identification enables more precise resource allocation. This allows terminals with different identities or roles to be allocated different CPU, GPU, memory, and other resources. This ensures that critical tasks (such as navigation and driver assistance) initiated by a designated terminal have sufficient resources to run. This further improves the rationality of system resource allocation, enhances overall system performance and stability, and ultimately enhances the user experience.

[0064] In some optional implementations, tasks may include triggerable critical tasks. A triggerable critical task may be a task whose critical function may be triggered during operation, for example, a voice assistant in a vehicle system.

[0065] Accordingly, step S160 may include: Step S165: when the triggerable critical task is triggered by the main driving terminal, increase the system resources allocated to the triggerable critical task.

[0066] In step S165, using the aforementioned voice assistant as an example, if the voice assistant is not activated by the driver's terminal, its resource allocation during operation may not require a higher priority. However, if it is activated by the driver's terminal during operation, the system can immediately increase the voice module thread scheduling priority to preempt some background task CPU resources to ensure real-time performance.

[0067] During the above implementation process, when a triggering critical task is triggered by the main driver terminal, the system resources allocated to the task are increased to ensure the smooth execution of the triggering critical task. The system can respond to the user's voice commands and other instructions that trigger the task more quickly, thereby providing timely feedback, reducing the user's waiting time, and ultimately further improving the user experience.

[0068] In some optional implementations, step S165 may include: Step S1651: increasing at least one of the CPU time slice, the number of CPU threads, and the memory allocation of the triggering critical task, and / or increasing the GPU usage frequency of the triggering critical task.

[0069] In the above step S1651, when the triggering critical task is triggered by the main driver terminal, the CPU time slice of the triggering critical task can be increased by using the nice value or cgroup, the number of CPU threads can be increased, the physical memory (RAM) and read-only memory (ROM) can be increased, and / or the GPU frequency can be increased.

[0070] During the above implementation process, when a trigger-critical task is initiated by the main driver terminal, the system resources allocated to the trigger-critical task are increased by controlling at least one of the CPU time slice, the number of CPU threads, the memory allocation, and the graphics processor usage frequency. A variety of optional system resources are provided to be targetedly allocated to the trigger-critical task, further ensuring the smooth execution of the trigger-critical task, thereby further improving the user experience.

[0071] Please refer to Figure 5 , Figure 5 This is a second specific flow chart of step S140 in the system resource scheduling method provided in an embodiment of the present application. In some optional implementations, the basic allocation strategy is adjusted in combination with the task priority of the terminal initiating the task to obtain the adjusted allocation strategy, which may include: Step S144: assigning a first weight coefficient to each task according to the type of each task.

[0072] In the above step S144, the first weight coefficient represents the priority of the task. For example, please refer to Table 1, which is a table of the first weight coefficients of each task.

[0073] Table 1

[0074] Step S145: assigning a second weight coefficient to each terminal according to the type of each terminal.

[0075] In the above step S145, the second weight coefficient represents the task priority of the terminal. For example, please refer to Table 2, which is a table of second weight coefficients for each task.

[0076] Table 2

[0077] Step S146: Determine the priority coefficient of the task when it is initiated on the corresponding terminal according to the product of the first weight coefficient and the second weight coefficient. In step S146, the priority coefficient is used to determine the proportion of allocated system resources. Combining Tables 1 and 2, we can derive the corresponding priority coefficients for each task initiated by each terminal. For example, the priority coefficient for a navigation task initiated by the driver's terminal is 1.0 × 1.0 = 1.0. Another example is the priority coefficient for a video task initiated by the passenger's terminal is 0.5 × 0.4 = 0.2.

[0078] In the above implementation, a first weight coefficient is assigned based on the type of each task, a second weight coefficient is assigned based on the type of each terminal, and the priority coefficient of a specific task initiated by a specific terminal is determined based on the product of the first and second weight coefficients. System resources are allocated based on this priority coefficient, and the priority during resource allocation is determined. This takes into account the attributes of the task to be executed and the type of terminal initiating the task, and refines the calculation details of the specific priority coefficient. This further improves the rationality of system resource allocation, better meets user needs, and further enhances the user experience.

[0079] In order to further understand the scheme of the system resource scheduling method provided in this application, this application is further explained by taking an on-board system equipped with multiple terminals on a vehicle as an example.

[0080] First, when the vehicle starts and the in-vehicle system is powered on and initialized, a basic allocation strategy is determined based on the attributes of the tasks themselves. For example, navigation tasks are prioritized over audio and video entertainment tasks. The user role identification module uses the Android system's UserHandle and DisplayManager to identify the terminal currently connected to the host and the corresponding user role. For example, the in-vehicle system's host identifies the terminal with DisplayId = 1 as the primary driver's terminal.

[0081] The first weight coefficient assigned to each task and the second weight coefficient assigned to each terminal are then used to calculate the priority coefficient of each task when initiated by the corresponding terminal. For example, the priority coefficient of the navigation task initiated by the driver's terminal is 1.0 × 1.0 = 1.0, which is a higher priority. The priority coefficient of the video task initiated by the passenger terminal is 0.5 × 0.4 = 0.2, which is a lower priority.

[0082] Next, when each terminal launches an application, the application type identification and behavior analysis module classifies the launched application. For example, if the driver (driver's terminal) opens a navigation application, the module identifies it as a critical task type; if the passenger (passenger terminal) launches a video playback application, it is identified as a secondary task type; if the rear passenger (rear terminal) opens a high-definition video player, it is also identified as a secondary task type.

[0083] Secondly, the system continuously monitors the running status and resource usage of each application, reading system resource call data (such as SurfaceFlinger's GPU rendering frequency and CPU utilization curves) to assess the real-time resource usage of each task. For example, while the driver's navigation application is planning a route, CPU usage temporarily increases but does not exceed the threshold; while the passenger's video playback application is playing, the GPU rendering frame rate is normal; when the rear passenger's high-definition video playback software starts playing, both GPU and CPU usage begin to increase, and the system detects that their resource usage levels are gradually approaching the set threshold.

[0084] Then, the system allocates sufficient CPU and GPU resources to the navigation task to ensure the smoothness of its path planning and real-time traffic display; for the video playback task for the co-pilot, appropriate resources are allocated to meet basic playback needs; for the high-definition video playback task for rear passengers, due to its relatively low priority and high resource usage, the system appropriately limits its GPU frame rate to balance the overall system resource usage.

[0085] Next, the anomaly detection and downgrade strategy module monitors system resource bottlenecks in real time. When abnormal conditions such as overheating of the SoC, CPU congestion, or GPU frame loss are detected, the corresponding downgrade strategy is triggered. For example, while the vehicle is in motion, CPU congestion occurs due to multiple applications running simultaneously, triggering the anomaly detection mechanism. Based on the downgrade strategy, the performance of the driver's navigation task is first guaranteed to be unaffected. The video playback task for the passenger is then downgraded, reducing its video quality or frame rate. Simultaneously, the high-definition video playback task for rear passengers is further prioritized or even paused, freeing up resources for critical tasks.

[0086] Finally, as an optional implementation, the system can use an adaptive learning mechanism to continuously optimize scheduling strategies and weight mapping models based on historical behavior records and resource consumption patterns. For example, after running similar multi-tasking scenarios multiple times, the system discovered that rear-seat passengers typically don't demand high frame rates when watching videos. Therefore, a pre-set priority adjustment strategy lowers the GPU frame rate weight for such tasks in specific scenarios, further improving the rationality of system resource allocation.

[0087] See Figure 6 , Figure 6 6 is a functional block diagram of a system resource scheduling apparatus 600 according to an embodiment of the present application. The system resource scheduling apparatus 600 according to an embodiment of the present application may include a determination module 610, an adjustment module 620, and an allocation module 630.

[0088] The determination module 610 may be configured to determine a basic allocation policy for allocating system resources to each task based on the task type. The adjustment module 620 may be configured to adjust the basic allocation policy based on the task priority of the terminal initiating the task to obtain an adjusted allocation policy. The allocation module 630 may be configured to allocate system resources to the task based on the adjusted allocation policy.

[0089] As an optional implementation, the system may specifically be a vehicle-mounted system, the terminal may include the driver's terminal with the highest task priority, and the task may include a persistent critical task. Accordingly, when allocating system resources to tasks according to the adjusted allocation strategy, allocation module 630 may specifically be configured to: monitor the system's operating status. In the event of system operational anomalies, maintain the system resources occupied by the persistent critical task initiated by the driver's terminal unchanged.

[0090] As an optional implementation, tasks may also include non-critical tasks. Exceptions may include operating environment exceptions. Accordingly, in allocating system resources to tasks according to the adjusted allocation strategy, allocation module 630 may also be specifically configured to: in the event of an environmental anomaly during system operation, invoke application performance control tools corresponding to non-critical tasks and tasks initiated by non-driver terminals, respectively, to reduce the performance of the corresponding tasks.

[0091] As an optional implementation, the anomaly may also include a high resource consumption anomaly. In allocating system resources to tasks according to the adjusted allocation policy, the allocation module 630 may further be configured to, if a high resource consumption anomaly occurs during system operation, invoke a system resource management tool to reduce the system resources allocated to non-critical tasks and tasks initiated by non-driver terminals.

[0092] As an optional implementation, in the process of adjusting the basic allocation strategy based on the task priority of the terminal initiating the task to obtain the adjusted allocation strategy, the adjustment module 620 can specifically be used to: after receiving the task request initiating the task, obtain the terminal's identity from the task request. Based on the identity, determine the terminal's role. The role indicates whether the terminal is a primary driver terminal or a non-primary driver terminal. Based on the terminal's role, determine the terminal's task priority.

[0093] As an optional implementation, the tasks may include trigger-critical tasks. Accordingly, in allocating system resources to the tasks according to the adjusted allocation strategy, the allocation module 630 may be specifically configured to increase the system resources allocated to the trigger-critical task when the trigger-critical task is triggered by the driver's terminal.

[0094] As an optional embodiment, in the process of increasing the system resources allocated to the trigger-critical task, the allocation module 630 can be more specifically used to: increase at least one of the CPU time slice, the number of CPU threads and the memory allocation of the trigger-critical task, and / or increase the graphics processor usage frequency of the trigger-critical task.

[0095] As an optional implementation, in the process of adjusting the basic allocation strategy in combination with the task priority of the terminal that initiates the task to obtain the adjusted allocation strategy, the adjustment module 620 can be specifically used to: assign a first weight coefficient to each task according to the type of each task. The first weight coefficient represents the priority of the task. According to the type of each terminal, a second weight coefficient is assigned to each terminal. The second weight coefficient represents the task priority of the terminal. Based on the product of the first weight coefficient and the second weight coefficient, the priority coefficient when the task is initiated by the corresponding terminal is determined. The priority coefficient can be used to determine the proportion of allocated system resources.

[0096] It should be understood that this device corresponds to the aforementioned embodiment of the method for scheduling system resources and is capable of executing each of the steps involved in the aforementioned method embodiment. The specific functions of this device can be found in the description above; to avoid repetition, a detailed description is omitted here. The device includes at least one software functional module that can be stored in a memory in the form of software or firmware or embedded in the device's operating system (OS).

[0097] An embodiment of the present application further provides a computer program product, which includes a computer program / instruction, and the computer program / instruction executes the above method when executed by a processor.

[0098] The computer program product may be stored on a computer-readable storage medium. The computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0099] In summary, the system resource scheduling method, device and computer program product provided by each embodiment of the present application comprehensively determine the priority of the currently executed task by combining the priority determined by the attributes of the task itself and the priority of the initiating terminal corresponding to the task, and then perform reasonable resource allocation, so that the operation of the system can better meet the needs of users. Furthermore, when an abnormality occurs during the operation of the system and it is necessary to allocate system resources between tasks or reduce the system resources allocated to most tasks to alleviate the abnormality, by keeping the system resources occupied by persistent critical tasks such as navigation initiated by the main driver terminal unchanged, the performance of the task during operation is ensured to be stable, thereby further meeting the needs of users. In the case of an abnormal operating environment during system operation, the performance of the task is reduced by calling the application performance control tool of the corresponding task, and in the case of high resource consumption abnormality during system operation, the system resource management tool is called to reduce the system resources allocated to non-critical tasks and tasks initiated by non-main driver terminals, respectively, which better meets the needs of users and further improves the user experience. When a critical task is triggered by the driver's terminal, the system resources allocated to the task are increased to ensure its smooth execution. This provides timely feedback, reduces user waiting time, and ultimately further improves the user experience.

[0100] In the several embodiments provided in the embodiments of the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions, and operations of the devices, methods, and computer program products according to the multiple embodiments of the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment, or a portion of code, and the module, program segment, or a portion of code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the boxes can also occur in a different order than the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.

[0101] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0102] The above description is only an optional implementation method of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited to this. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in the embodiment of the present application, and they should all be covered by the protection scope of the embodiment of the present application.

Claims

1. A method for scheduling system resources, characterized in that: in, The system includes at least two terminals; the task priorities of the at least two terminals are not completely the same; The method comprises: Determining a basic allocation strategy for allocating system resources to each of the tasks based on the priority of the tasks; Adjusting the basic allocation strategy in combination with the task priority of the terminal that initiates the task to obtain an adjusted allocation strategy; and Allocate system resources to the task according to the adjusted allocation strategy.

2. The method according to claim 1, characterized in that in, The system includes a vehicle system, the terminal includes a main driver terminal with the highest task priority, and the task includes a persistent critical task; Allocating system resources to the task according to the adjusted allocation strategy includes: monitoring the operating status of the system; as well as In the event of an abnormality in the system operation, the system resources occupied by the persistent critical task initiated by the main driver terminal remain unchanged.

3. The method according to claim 2, characterized in that in, The tasks also include non-critical tasks; the anomalies include operating environment anomalies; Allocating system resources to the task according to the adjusted allocation strategy further includes: When the environment abnormality occurs during the operation of the system, the application performance control tools corresponding to the non-critical tasks and the tasks not initiated by the main driving terminal are called to reduce the performance of the corresponding tasks.

4. The method according to claim 3, characterized in that in, The anomaly also includes high resource consumption anomaly; Allocating system resources to the task according to the adjusted allocation strategy further includes: When the high resource consumption exception occurs during the system operation, a system resource management tool is called to reduce the system resources allocated to the non-critical tasks and tasks not initiated by the main driving terminal.

5. The method according to claim 2, characterized in that The adjusting the basic allocation strategy in combination with the task priority of the terminal that initiates the task to obtain the adjusted allocation strategy includes: After receiving the task request for initiating the task, obtaining the identity of the terminal from the task request; Determine the role of the terminal according to the identity identifier; wherein the role indicates whether the terminal is the primary driver terminal or the non-primary driver terminal; The task priority of the terminal is determined according to the role of the terminal.

6. The method according to claim 2, characterized in that in, The tasks include triggering key tasks; Allocating system resources to the task according to the adjusted allocation strategy includes: When a triggerable critical task is triggered by the main driving terminal, system resources allocated to the triggerable critical task are increased.

7. The method according to claim 6, characterized in that The increasing of the system resources allocated to the triggerable critical task includes: At least one of the CPU time slice, the number of CPU threads, and the memory allocation of the triggering critical task is increased, and / or the graphics processor usage frequency of the triggering critical task is increased.

8. The method according to any one of claims 1 to 7, characterized in that The adjusting the basic allocation strategy in combination with the task priority of the terminal that initiates the task to obtain the adjusted allocation strategy includes: Assigning a first weight coefficient to each of the tasks according to the type of each of the tasks; wherein the first weight coefficient represents the priority of the task; assigning a second weight coefficient to each terminal according to the type of each terminal; wherein the second weight coefficient represents the task priority of the terminal; The priority coefficient of the task when initiated on the corresponding terminal is determined according to the product of the first weight coefficient and the second weight coefficient; wherein the priority coefficient is used to determine the proportion of the allocated system resources.

9. A system resource scheduling device, characterized in that: include: A determination module, configured to determine a basic allocation strategy for allocating system resources to each task according to the type of the task; an adjustment module, configured to adjust the basic allocation strategy in combination with the task priority of the terminal that initiates the task, to obtain an adjusted allocation strategy; An allocation module is used to allocate system resources to the task according to the adjusted allocation strategy.

10. A computer program product, characterized in that The method comprises a computer program / instruction which, when executed by a processor, implements the method according to any one of claims 1 to 8.