Processor resource management and control method and system and vehicle-mounted terminal

By obtaining and comparing the CPU usage rate of the application process and its position information in the multi-level control list, the processor resources are managed and graded, and the CPU usage rate exceeds the standard in the prior art is solved, and the system performance and stability are improved.

CN119621336APending Publication Date: 2025-03-14CHENGDU CELIS TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411760345.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The lack of effective CPU resource management mechanism in the existing technology makes it difficult to control the problem of exceeding the CPU usage of the application in a multi-task operating system environment, affecting system performance and stability.

Method used

By obtaining the processor usage rate of each application process and its position information in the multi-level control list, comparing the usage rate with the preset control value, and performing hierarchical control of processor resources based on the results and position information, including moving into a higher-level control sub-table or terminating the application process.

Benefits of technology

Effectively manage and allocate processor resources to ensure that the CPU usage rate of each application process is within a reasonable range, thereby improving the smoothness and performance of the system and avoiding abnormal phenomena such as system lag and black screen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621336A_ABST
    Figure CN119621336A_ABST
Patent Text Reader

Abstract

The invention provides a processor resource management and control method and system and a vehicle-mounted terminal, and the method comprises the steps: obtaining the utilization rate of each application process relative to a processor, and obtaining the position information of each application process in a multi-stage management and control list, and the multi-stage management and control list is used for carrying out the hierarchical management and control of the application processes with the utilization rate exceeding the standard; for any application process, comparing the utilization rate with a preset utilization rate control value; and performing hierarchical management and control on processor resources on any application process according to the comparison result and the position information. By setting the multi-level management and control list, multi-level management and control processing is carried out on the application process with the processor usage rate exceeding the standard, the system operation fluency is improved, and the system operation performance is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of processor resource management, and in particular to a processor resource management method, system and vehicle-mounted terminal. Background Art

[0002] In modern smart devices, efficient use of CPU (Central Processing Unit) resources is one of the key factors to ensure smooth system operation. Especially in devices with high requirements for high-performance computing and multi-tasking capabilities, the reasonable allocation and management of CPU resources is particularly important. In order to achieve efficient resource sharing, advanced resource management technologies are usually used to optimize system performance. Therefore, the effective management and optimization of processor resources has become an important research direction.

[0003] In a multi-tasking operating system environment, various applications and services are running in the system, and these applications will occupy a certain amount of CPU resources during operation. If there is a lack of effective CPU resource management mechanism, as the number of applications increases and the complexity increases, the CPU load may be too high, which in turn affects the response speed and stability of the system. When the CPU usage of certain applications is very high, if there is no appropriate mechanism to monitor and handle it, it may cause the performance of the entire system to decline, causing the system to freeze, black screen, or even restart. However, the industry currently lacks a control mechanism for the problem of excessive CPU usage of various applications in the system, which seriously affects the system's operating performance. Summary of the invention

[0004] In view of the shortcomings of the prior art described above, the present application discloses a processor resource management method, system and vehicle-mounted terminal, which are used to solve the technical problem of poor control effect on the excessive utilization rate of processors of various application programs in the system in the prior art.

[0005] In a first aspect, the present application provides a processor resource management method, the method comprising: obtaining the processor usage rate of each application process, and obtaining the position information of each application process in a multi-level management list, the multi-level management list being used to hierarchically manage application processes whose usage rates exceed the standard; for any application process, comparing the usage rate with a preset usage rate control value; and performing hierarchical management of processor resources for any application process based on the comparison result and the position information.

[0006] In one embodiment of the present application, before obtaining the location information of each application process in the multi-level control list, it also includes: dividing multiple control levels from low to high according to the number of consecutive usage rate exceeding the standard; configuring multiple control sub-tables from low to high according to the multiple control levels to generate the multi-level control list.

[0007] In one embodiment of the present application, the processor resources of any of the application processes are hierarchically controlled based on the comparison result and the location information, including: when the usage rate is greater than the usage rate control value, if any of the application processes is not in the highest-level control subtable, any of the application processes is moved from the current control subtable to a higher-level control subtable for control; if any of the application processes is in the highest-level control subtable, any of the application processes is terminated.

[0008] In one embodiment of the present application, the hierarchical control of processor resources for any of the application processes based on the comparison result and the location information also includes: when the usage rate is less than or equal to the usage rate control value, if any of the application processes is not in the lowest-level control subtable, any of the application processes is moved from the current control subtable to a lower-level control subtable for control; if any of the application processes is in the lowest-level control subtable, any of the application processes is moved out of the multi-level control list.

[0009] In one embodiment of the present application, the method for calculating the usage rate includes: based on a preset time interval, sampling the processor usage time of each application process and the system twice; under two samplings, calculating the time change of each application process and the total time change of the system; calculating the time change and the total time change to obtain the usage rate of each application process.

[0010] In one embodiment of the present application, for any application process, the usage rate is compared with a preset usage rate control value, including: obtaining an operating mode of any of the application processes, the operating mode including a foreground operating mode and a background operating mode; if any of the application processes is in the foreground operating mode, the usage rate is compared with a preset foreground process control value; if any of the application processes is in the background operating mode, the usage rate is compared with a preset background process control value.

[0011] In one embodiment of the present application, before comparing the usage rate with a preset usage rate control value, it also includes: obtaining the idle rate of the processor; comparing the idle rate with a preset idle rate threshold to determine whether the control condition of the processor resources is met; when the control condition is met, entering the comparison operation between the usage rate and the usage rate control value.

[0012] In one embodiment of the present application, before comparing the usage rate with a preset usage rate control value, it also includes: setting an application process whitelist, wherein the application processes in the application process whitelist are not subject to hierarchical control of processor resources; if any of the application processes is in the application process whitelist, then no hierarchical control is performed on any of the application processes; if any of the application processes is not in the application process whitelist, then a comparison operation between the usage rate and the usage rate control value is performed.

[0013] In the second aspect, the present application provides a processor resource management and control system, the system comprising: an acquisition module for obtaining the processor usage of each application process, and obtaining the position information of each application process in a multi-level management and control list, the multi-level management and control list being used to hierarchically manage application processes whose usage exceeds the standard; a comparison module for comparing the usage with a preset usage control value for any application process; and a management and control module for performing hierarchical management of processor resources for any application process based on the comparison result and the position information.

[0014] In a third aspect, the present application provides a vehicle-mounted terminal, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the vehicle-mounted terminal implements the processor resource management method described in the first aspect.

[0015] As described above, the processor resource control method, system and vehicle-mounted terminal provided by the embodiments of the present application have the following beneficial effects:

[0016] First, the processor usage rate of each application process and the position information of each application process in the multi-level control list are obtained, wherein the multi-level control list is used to hierarchically control the application processes whose usage rate exceeds the standard. Then, for any application process, the usage rate is compared with the preset usage rate control value. Finally, according to the comparison result and the position information, the processor resources of any application process are hierarchically controlled. By setting a multi-level control list, combined with the result of whether the processor usage rate of each application process exceeds the standard and the position information of each application process in the multi-level control list, the application processes with excessive processor usage are subjected to multi-level control processing, so that the processor resource occupancy of each application process runs under this mechanism, so as to ensure that the processor usage rate of each application process in the system is within a reasonable range, thereby improving the system operation smoothness and improving the system operation performance.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0019] Figure 1 is a schematic diagram of an implementation environment of a processor resource control system shown in an exemplary embodiment of the present application;

[0020] Figure 2 is a flowchart of a processor resource control method shown in an exemplary embodiment of the present application;

[0021] Figure 3 is a schematic diagram of a vehicle system shown in an exemplary embodiment of the present application;

[0022] Figure 4 is a schematic diagram of a vehicle computer disk directory shown in an exemplary embodiment of the present application;

[0023] Figure 5 This is a flow chart of a vehicle system presetting whitelist process configuration file shown in an exemplary embodiment of the present application;

[0024] Figure 6 is a flowchart of a three-level processor resource control method shown in an exemplary embodiment of the present application;

[0025] Figure 7 is a flowchart of a specific processor resource control method shown in an exemplary embodiment of the present application;

[0026] Figure 8 is a block diagram of a processor resource management and control system shown in an exemplary embodiment of the present application;

[0027] Fig. 9 It is a structural schematic diagram of a vehicle-mounted terminal provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0028] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.

[0029] It should be noted that the illustrations provided in the following embodiments are only used to illustrate the basic concept of the present application in a schematic manner, and therefore the illustrations only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the form, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0030] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0031] First of all, it should be noted that efficient use of CPU resources is one of the key factors to ensure the smooth operation of the system, especially in devices with high requirements for high-performance computing capabilities and multi-tasking capabilities. The reasonable allocation and management of CPU resources is particularly important. If there is a lack of an effective CPU resource management mechanism, as the number of applications increases and the complexity increases, the CPU load may be too high, which in turn affects the response speed and stability of the system. When the CPU usage of certain applications is very high, if there is no appropriate mechanism to monitor and process it, the performance of the entire system may decline, causing the system to freeze, black screen, or even restart. Abnormal phenomena. However, the inventor of this application has found that the industry currently lacks a control mechanism for the problem of excessive CPU usage of each application in the system, which seriously affects the operating performance of the system.

[0032] Therefore, see Figure 1 , Figure 1 FIG. 1 is a schematic diagram of an implementation environment of a processor resource control system shown in an exemplary embodiment of the present application. Figure 1 As shown, the implementation environment includes a vehicle 110 and a processor resource management and control system 120, wherein the processor resource management and control system 120 is embedded in the vehicle 110 and is used to implement processor resource management of the system in the vehicle 110. The processor resource management and control system 120 includes but is not limited to a vehicle computer system, an on-board computer, etc. By setting a multi-level management and control list, combined with the result of whether the processor usage rate of each application process exceeds the standard and the position information of each application process in the multi-level management and control list, a multi-level management and control process is performed on the application process with a processor usage rate exceeding the standard, so that the processor resource occupancy of each application process is operated under this mechanism to ensure that the processor usage rate of each application process in the system is within a reasonable range, thereby improving the system operation smoothness and improving the system operation performance.

[0033] See also Figure 2 , Figure 2 is a flowchart of a processor resource control method shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown is a schematic diagram. It should be understood that the method may also be applicable to other exemplary implementation environments, and this embodiment does not limit the implementation environment to which the method is applicable.

[0034] In addition, in an embodiment of the present application, the processor resource management method can be applicable to the Android system, that is, it can be applied to mobile devices of the Android system, such as mobile phones, car computers, etc. For example, it is suitable for processor resource management in the car computer system, and performs multi-level management and processing on the processor usage of each Android application.

[0035] See also Figure 3 , Figure 3 is a schematic diagram of a vehicle system shown in an exemplary embodiment of the present application. The vehicle system may be a Qualcomm 8155 vehicle system. It should be understood that in the embodiment of the present application, the processor resource management method may be applicable to various vehicle systems. Figure 3As shown, the car system is a virtualized dual-system architecture, including the QNX operating system and the Android operating system. Through HyperVision (virtualization architecture), processor virtualization and memory virtualization are realized, so as to share hardware resources (memory resources and processor resources, etc.). The CPU resources of the car system are an important hardware resource. The CPU load often determines the smoothness of the car system. The CPU resources of the car system are shared by the QNX operating system and the Android operating system. For example, the total computing power of the 8155 car system is 105KDMIPS, with a total of 8 cores, of which cores 0 and 1 are allocated to the QNX operating system, and cores 2-7 are allocated to the Android operating system using VCPU (Virtual Central Processing Unit, virtual central processing unit), with a total computing power percentage of 600%. As the main system, the QNX operating system is mainly responsible for instrument applications, and as the slave system, the Android operating system is mainly responsible for central control entertainment information applications. In the Android operating system, there are various in-vehicle applications, such as vehicle settings, Bluetooth phones, multimedia, driving recorders, 360-degree surround view, air conditioning settings, voice, virtual images, etc. Each application will occupy CPU resources when running, and each application will compete for CPU resources. If the CPU resource load is too high, it will cause abnormal phenomena such as freezing, black screen, and even restart of the entire vehicle system. Through the processor resource management method provided by this application, a multi-level management list is set, and the results of whether the processor usage rate of each application process exceeds the standard and the position information of each application process in the multi-level management list are combined. The application process with excessive processor usage is subject to multi-level management and processing, so that the processor resource occupancy of each application process runs under this mechanism to ensure that the processor usage rate of each application process in the system is within a reasonable range, and to avoid the occurrence of abnormal phenomena such as freezing, black screen, and even restart of the vehicle system, thereby improving the smoothness of system operation and improving the system's operating performance.

[0036] like Figure 2 As shown, in an exemplary embodiment, the processor resource control method includes at least steps S210 to S230, which are described in detail as follows:

[0037] Step S210, obtaining the utilization rate of each application process on the processor, and obtaining the position information of each application process in the multi-level control list, the multi-level control list is used to hierarchically control the application processes with excessive utilization rates.

[0038] It should be noted that the multi-level control list includes multiple control sub-tables, each of which is a different control level and is used to control application processes with different degrees of processor usage exceeding the standard. The location information represents the specific location of the application process in the multi-level control list, that is, which control sub-table it is in. In addition, the processor usage of each application process is the real-time CPU usage of each application process.

[0039] In one embodiment, the method for calculating the utilization rate includes: based on a preset time interval, sampling the processor usage time of each application process and the system twice; calculating the time change of each application process and the total time change of the system under two samplings; calculating the time change and the total time change to obtain the utilization rate of each application process.

[0040] In this embodiment, by comparing the processor usage time of each application process and the system twice, the utilization rate of the processor resources of each application process in a specified time period can be accurately reflected. The time interval can be flexibly adjusted to meet different monitoring requirements.

[0041] See also Figure 4 , Figure 4 FIG. 1 is a schematic diagram of a vehicle disk directory shown in an exemplary embodiment of the present application. Figure 4 As shown, taking the car system as an example, in the car system, the system's CPU resource usage information is recorded in the Proc / stat file, and the application process's CPU resource usage information is recorded in the Proc / pid / stat file, where pid is the unique process number of each application process, such as 1428, 2689, etc., for the process number of each application process. After the car system is running, the CPU resource usage information of the system and each application process can be obtained.

[0042] In this embodiment, the processor usage time of the system and each application process is sampled twice to obtain the time slices of the system and each application process under the two samplings, and the usage rate of each application process is calculated based on the information in the time slices.

[0043] The time slice corresponding to the system, for example, "cpu 35938 1805 22620 356651 3257 2651 872 0 00", the corresponding CPU_Time = 35938 (user) + 1805 (nice) + 22620 (system) + 356651 (idle) + 3257 (iowait) + 2651 (irq) + 872 (softirq) + 0 (steal) + 0 (guest) + 0 (guest_nice). Based on the preset time interval, the two sampling points are named CPU_Time1 and CPU_Time2, CPU_Time1 = user1+nice1+system1+idle1+iowait1+irq1+softirq1+steal1+guest1+guest_nice1, CPU_Time2 = user2+nice2+system2+idle2+iowait2+irq2+softirq2+steal2+guest2+guest_nice2. The total CPU time change (i.e. the total time change mentioned above) is: Total_CPU_Time = CPU_Time2-CPU_Time1; CPU idle time: Idle_CPU_Time = idle2-idle1.

[0044] During the preset time interval, the system CPU usage is: Total_CPU_Ration = 100% * (Total_CPU_Time - Idle_CPU_Time) / Total_CPU_Time, and the system CPU idle rate is: Idle_CPU_Ration = 100% * Idle_CPU_Time / Total_CPU_Time. Taking the car system as an example, during the preset time interval, the system CPU usage is (6 cores): Total_CPU_Ration = 6 * 100% * (Total_CPU_Time - Idle_CPU_Time) / Total_CPU_Time, and the system CPU idle rate is (6 cores): Idle_CPU_Ration = 6 * 100% * Idle_CPU_Time / Total_CPU_Time.

[0045] The time slice corresponding to the application process, for example, "3113(.car.diagnostic)S 422 422 0 0 -11077936448 4272 0 0 0 1327 698 0 0 20 0 28 0 4728 16543162368 2634418446744073709551615 410536484864 410536510416 549004193392 0 0 0 4612 11073775864 0 0 0 17 3 0 0 0 0 0 410536519104 410536519104411262603264549004195213 549004195312 549004195312 549004197854 0", then the corresponding Process_CPU_Time=1327(utime)+698(stime)+0(cutime)+0(cstime). Based on the preset time interval, the two sampling points are named Process_CPU_Time1 and Process_CPU_Time2, Process_CPU_Time1=utime1+stime1+cutime1+cstime1, Process_CPU_Time2=utime2+stime2+cutime1+cstime2, and the CPU time change of the application process is (that is, the time change mentioned above): Process_CPU_Time2-Process_CPU_Time1.

[0046] Finally, within the preset time interval, the usage rate of each application process is: Process_CPU_Ration = 100% * (Process_CPU_Time2 - Process_CPU_Time1) / Total_CPU_Time. Taking the car system as an example, within the preset time interval, the usage rate of each application process is: Process_CPU_Ration = 6 * 100% * (Process_CPU_Time2 - Process_CPU_Time1) / Total_CPU_Time.

[0047] In a possible embodiment, the sampling time interval (ie, the preset time interval) of each application process may be set to different interval values ​​according to the workload of each application process.

[0048] As a possible implementation example, each application process calculates the utilization rate based on its own time interval sampling. For application processes with highly dynamic workloads or large workloads, the utilization rate can be more accurately reflected based on a shorter sampling interval. A shorter time interval is used to improve the accuracy of the utilization rate calculation, thereby performing multi-level management and control of processor utilization exceeding the standard, which can further improve the system's operating performance.

[0049] In one embodiment, before obtaining the location information of each application process in the multi-level control list, it also includes: dividing multiple control levels from low to high according to the number of consecutive usage rate exceeding the standard; configuring multiple control sub-tables from low to high according to the multiple control levels to generate a multi-level control list.

[0050] In this embodiment, the more times the usage rate exceeds the standard continuously, the more the application process is in a state of continuously exceeding the standard, and the higher the degree of control. Therefore, the number of times the usage rate exceeds the standard continuously in the multi-level control list is divided into multiple control levels from low to high, and then multiple control sub-tables are configured from low to high according to the multiple control levels. Through multiple control sub-tables, application processes with different continuous times of exceeding the standard usage rate are hierarchically controlled. If the usage rate of any application process exceeds the standard, the application process is controlled to different degrees according to the continuous number of times the usage rate exceeds the standard. In this way, multi-level control of processor resources is realized, which is conducive to ensuring the smoothness of system operation and improving the system operation performance.

[0051] In addition, this embodiment does not limit the number of control sub-tables divided from low to high according to the number of consecutive usage rate exceeding the standard. For example, it can be divided into three control sub-tables to form a three-level control of processor resources, and it can be divided into four control sub-tables to form a four-level control of internal processor resources, etc.

[0052] Step S220: for any application process, compare the usage rate with a preset usage rate control value.

[0053] It should be noted that each application process in the system is set with a usage control value, which is used to determine whether the processor usage of the application process exceeds the standard. The usage control value of each application process can be set according to its own business logic, so that the application process completes the business logic within a certain usage control value. The setting of the usage control value needs to consider factors such as its own business logic and the total system processor resources, and formulate a relatively accurate value within a certain range.

[0054] Specifically, for any application process, the usage rate is compared with the preset usage rate control value, including: obtaining the operating mode of any application process, the operating mode includes the foreground operating mode and the background operating mode; if any application process is in the foreground operating mode, the usage rate is compared with the preset foreground process control value; if any application process is in the background operating mode, the usage rate is compared with the preset background process control value.

[0055] It should be noted that the application process in the system may be in the foreground running state or in the background running state. Taking into account that the same application process occupies different processor resources in the foreground running state and the background running state, in this embodiment, the utilization control value of each application process includes a foreground process control value and a background process control value, so that the foreground process control value or the background process control value is selected as the judgment standard whether the utilization rate exceeds the standard according to the running state of each application process. In this way, different processor resources are allocated according to the actual running state of the application process, which can further ensure the control effect of the system processor resources.

[0056] In one embodiment, before comparing the usage rate with a preset usage rate control value, it also includes: obtaining the idle rate of the processor; comparing the idle rate with a preset idle rate threshold to determine whether the control conditions of the processor resources are met; when the control conditions are met, entering the comparison operation of the usage rate and the usage rate control value.

[0057] In this embodiment, the idle rate is compared with a preset idle rate threshold. If the idle rate is less than the idle rate threshold, it is determined that the conditions for controlling the processor resources are met. Further, multi-level control of the processor resources is performed based on the processor usage of each application process. In this way, when processor resources are relatively sufficient, the usage rate of the running application process is allowed to exceed the standard without affecting the overall performance of the system, which can avoid the problem of forcibly terminating the application process with excessive processor usage when processor resources are relatively sufficient.

[0058] In a possible embodiment, if any application process is in the foreground running mode, the idle rate is compared with a preset foreground process idle rate threshold; if any application process is in the background running mode, the idle rate is compared with a preset background process idle rate threshold.

[0059] In a possible embodiment, if any application process is in the foreground running mode, the usage rate is compared with the first foreground process control value and the second foreground process control value, wherein the first foreground process control value is greater than the second foreground process control value. When the usage rate is greater than the first foreground process control value, it is determined that the usage rate exceeds the standard. When the usage rate is less than or equal to the first foreground process control value and greater than the second foreground process control value, and when the idle rate is less than the foreground process idle rate threshold, it is determined that the usage rate exceeds the standard. If any application process is in the background running mode, the usage rate is compared with the background process control value. When the usage rate is greater than the background process control value and when the idle rate is less than the background process idle rate threshold, it is determined that the usage rate exceeds the standard.

[0060] For example, taking the car system as an example, the foreground process: when the CPU usage is greater than 300% or the CPU usage is greater than 200% and the system CPU idle rate is less than 100%, the application process is judged to have exceeded the CPU usage standard; the background process: when the CPU usage is greater than 80% and the system CPU idle rate is less than 200%, the application process is judged to have exceeded the CPU usage standard.

[0061] Specifically, when an application process is in the foreground running mode, it usually has a higher priority because the user is interacting with it, so a higher usage control value is set to ensure that the application obtains sufficient processor resources to maintain a good user experience. On the contrary, when the application process is in the background running mode, since it is not the current focus of the user, a lower usage control value can be set to limit the CPU usage of these processes, thereby freeing up more processor resources for other more important tasks. In this way, it can ensure that the foreground application has sufficient resource support, and prevent the background application from excessively occupying processor resources, thereby avoiding the risk of overall system performance degradation.

[0062] In one embodiment, before comparing the usage rate with a preset usage rate control value, it also includes: setting an application process whitelist, wherein the application processes in the application process whitelist are not subject to hierarchical control of processor resources; if any application process is in the application process whitelist, no hierarchical control is performed on any application process; if any application process is not in the application process whitelist, a comparison operation between the usage rate and the usage rate control value is performed.

[0063] It should be noted that, taking into account the various requirements of system operation, such as the special safety requirements of the car system, some application processes cannot be terminated even if the CPU usage exceeds the usage control value, such as 360-degree surround view, navigation and other application processes.

[0064] Therefore, in this embodiment, considering the life cycle of important application processes in the system, it is not appropriate to forcibly terminate them due to excessive processor usage, so a whitelist of application processes is set. The application processes in the list are not subject to processor resource control. In this way, the life cycle of important application processes is guaranteed through the whitelist mechanism. For whitelist processes, processor resource control is not performed, which avoids these important application processes from being forcibly terminated due to excessive processor usage, thereby ensuring customer experience.

[0065] It should also be noted that whether each application process is a whitelist process can be set according to specific needs.

[0066] See also Figure 5 , Figure 5 This is a flowchart of a vehicle system presetting whitelist process configuration file shown in an exemplary embodiment of the present application. Figure 5 As shown in the figure, the steps of compiling and packaging the whitelist process configuration file for the processor resource control of the vehicle system based on the continuous integration tool (such as Jenkins) are described in detail as follows: first, the compilation and packaging task is initiated through the continuous integration tool; then the system source code stage is entered, where the system source code is such as the source code of the whitelist process configuration file and the source code of the product configuration file, etc. The whitelist process configuration file is a configuration file used to define whether the vehicle application is subject to processor resource control, and the product configuration file is used to customize the compilation options and build parameters; then the continuous integration tool executes the compilation task, and packages the system source code and its configuration file together into an installable system flashing package; finally, the generated system flashing package is written into the vehicle system. After the writing is successful, the vehicle system contains the whitelist process configuration file. After the vehicle system is running, this file will be read and parsed to filter out the whitelist process so that it is not subject to processor resource control.

[0067] Step S230, performing hierarchical control of processor resources for any application process according to the comparison result and the location information.

[0068] In this embodiment, based on the comparison results and location information, hierarchical control of processor resources is performed on any application process, including a multi-level control and fallback mechanism for excessive CPU usage of each application process. The CPU usage of each application process is controlled under this mechanism, thus ensuring the smoothness of system operation.

[0069] Specifically, based on the comparison results and location information, hierarchical control of processor resources is performed on any application process, including: when the usage rate is greater than the usage rate control value, if any application process is not in the highest-level control subtable, then any application process is moved from the current control subtable to a higher-level control subtable for control; if any application process is in the highest-level control subtable, then any application process is terminated.

[0070] In this embodiment, when it is determined that the usage rate of any application process exceeds the standard, the processor resource control of any application process is carried out according to its position information in the multi-level control list. If any application process is not in the highest-level control sub-table, any application process is moved from the current control sub-table to a higher-level control sub-table for control. If any application process is in the highest-level control sub-table, any application process is terminated, that is, the usage rate exceeds the standard in the highest-level control sub-table, indicating that the arbitrary application process has reached the preset continuous exceeding times threshold, and its control level is the highest level. Its usage rate exceeds the standard situation is more serious, so any application process is terminated to ensure the smoothness of system operation. It should also be noted that if any application process is not in the multi-level control list, any application process is moved to the lowest-level control sub-table for control.

[0071] In this way, by moving the application process step by step into the highest-level control subtable when the usage rate exceeds the standard several times in a row, the degree of processor resource control over the application process can be gradually improved until any application process is terminated, thus achieving multi-level control of processor resources.

[0072] Specifically, based on the comparison results and location information, hierarchical control of processor resources is performed on any application process, which also includes: when the usage rate is less than or equal to the usage rate control value, if any application process is not in the lowest-level control subtable, then any application process is moved from the current control subtable to a lower-level control subtable for control; if any application process is in the lowest-level control subtable, then any application process is moved out of the multi-level control list.

[0073] In this embodiment, for application processes that are in the multi-level control column but whose current usage rate does not exceed the standard, the application processes whose usage rate does not exceed the standard are controlled by gradually moving them out of the multi-level control column according to the consecutive number of times the usage rate does not exceed the standard. In this way, a step-by-step fallback mechanism is used when the CPU usage rate of the application drops below the control value, which further guarantees the life cycle of the application process under reasonable CPU usage.

[0074] In a possible embodiment, when terminating an application process from the highest-level control sub-table of the multi-level control list, all application processes in the highest-level control sub-table whose usage still exceeds the standard will be terminated, or, based on the system processor usage (such as total resource consumption not exceeding a certain threshold), at least one of these application processes will be terminated according to a preset termination policy, wherein the termination policy is based on the importance level of the application process (application processes with higher levels will be terminated later), the running status (background application processes will be terminated first), or the CPU usage of the application process (application processes with higher CPU usage will be terminated first), etc.

[0075] In this way, the life cycle of each application process can be effectively protected while ensuring the system operation performance.

[0076] See also Figure 6 , Figure 6 FIG. 1 is a flowchart of a three-level processor resource control method shown in an exemplary embodiment of the present application. Figure 6 As shown, the multi-level control list includes three control sub-tables, which are the process marking list, abnormal process list and process list to be terminated, respectively, according to the number of consecutive usage exceeding the standard. This three-level control method of processor resources is suitable for vehicle-mounted systems.

[0077] First, preset the application process whitelist to the car system. After the car system is started, the car system starts to run. At this time, start monitoring the processor usage of the system and each application process. Monitor once every period of time, and each monitoring enters the same process. First filter the whitelist processes, and then judge the usage rate exceeding the standard according to the usage rate of each application process and the preset usage rate control value. Move the application process with excessive usage rate into the corresponding control list until the application process is killed. Move the application process whose usage rate drops below the usage rate control value into the lower-level control list until it is completely removed from the control list. Among them, the three-level control of CPU usage exceeding the standard of the application process includes: when the CPU usage of the application process is detected to be exceeding the standard, the application process will enter the process marking list in turn. If the CPU usage of the application process is still exceeding the standard next time, the application process will be moved to the abnormal process list, and so on, it will be moved to the list of processes to be terminated, until the next detection, there is still an application process with excessive CPU usage in the list of processes to be terminated, and the application process will be forcibly terminated; the fallback mechanism when the usage rate drops below the control value includes: when the CPU usage rate of the application process drops below the control value, the fallback mechanism will roll back the application process in the previous list of the corresponding process list, the application process in the list of processes to be terminated will be rolled back to the abnormal process list, the application process in the abnormal process list will be rolled back to the marked process list, and the application process in the marked process list will be removed from the monitoring, and the judgment of excessive usage will continue.

[0078] See also Figure 7 , Figure 7 FIG. 1 is a flowchart of a specific processor resource control method shown in an exemplary embodiment of the present application. Figure 7 As shown, the specific processor resource control method is applicable to the vehicle system, and the steps are detailed as follows:

[0079] 1. After the car system is started, start the ActivityManagerService service (that is, the system service responsible for system application life cycle management, process management and user interaction functions);

[0080] 2. Start PerfMonitor (i.e., performance monitor) and enable the processor usage monitoring and processing function of the application process. PerfMonitor is a newly added core module for monitoring and processing abnormal CPU usage of vehicle-mounted applications;

[0081] 3. PerfMonitor reads the whitelist process configuration file, parses the application package name, and determines the whitelist process;

[0082] 4. PerfMonitor samples the processor usage time of each application process and the system twice every preset time period (e.g., 20 seconds);

[0083] 5. Filter whitelist processes based on application package name;

[0084] 6. Calculate the usage rate of each application process and the processor idle rate based on the data of the processor usage time sampling of each application process and the system twice;

[0085] 7. Determine whether the usage rate of each application process exceeds the standard based on the usage rate or the usage rate and idle rate;

[0086] 8. If an application process is determined to be a process with excessive usage rate in this excessive usage rate detection, first check whether the list of processes to be terminated contains the application process. If so, terminate the application process; if the list of processes to be terminated does not contain the application process, continue to search the abnormal process list; if the abnormal process list contains the application process, move the application process to the list of processes to be terminated; if the abnormal process list does not contain the application process, continue to search the marked process list; if the marked process list contains the application process, move the application process to the abnormal process list; if the marked process list does not contain the application process, move the application process to the marked process list;

[0087] 9. If the usage rate of the application process does not exceed the standard in this usage rate exceeding standard detection, first check whether the list of processes to be terminated includes the application process. If so, roll back the application process to the abnormal process list; if the list of processes to be terminated does not include the application process, continue to query the abnormal process list; if the abnormal process list includes the application process, roll back the application process to the marked process list; if the abnormal process list does not include the application process, continue to search the marked process list; if the marked process list includes the application process, remove the application process from the marked process list.

[0088] The above-mentioned processor resource control method first obtains the processor usage rate of each application process and the position information of each application process in the multi-level control list, wherein the multi-level control list is used to hierarchically control the application processes whose usage rate exceeds the standard, and then for any application process, the usage rate is compared with the preset usage rate control value, and finally, according to the comparison result and the position information, the processor resources of any application process are hierarchically controlled. By setting a multi-level control list, combined with the result of whether the processor usage rate of each application process exceeds the standard and the position information of each application process in the multi-level control list, the application process with excessive processor usage is subjected to multi-level control processing, so that the processor resource occupancy of each application process runs under this mechanism to ensure that the processor usage rate of each application process in the system is within a reasonable range, thereby improving the system operation smoothness and improving the system operation performance.

[0089] See also Figure 8 , Figure 8 is a block diagram of a processor resource management system shown in an exemplary embodiment of the present application. The system can be applied to Figure 1 The implementation environment shown is a schematic diagram. It should be understood that the system may also be applicable to other exemplary implementation environments, and this embodiment does not limit the implementation environment to which the system is applicable.

[0090] like Figure 8 As shown, in an exemplary embodiment, the processor resource management and control system 800 includes at least an acquisition module 810, a comparison module 820 and a management and control module 830, which are described in detail as follows:

[0091] An acquisition module 810 is used to acquire the utilization rate of each application process on the processor, and to acquire the position information of each application process in a multi-level control list, where the multi-level control list is used to hierarchically control application processes with utilization rates exceeding the standard;

[0092] A comparison module 820, for comparing the usage rate with a preset usage rate control value for any application process;

[0093] The control module 830 is used to perform hierarchical control of processor resources for any application process based on the comparison result and the location information.

[0094] It should be noted that the processor resource management system provided in the above embodiment and the processor resource management method provided in the above embodiment belong to the same concept, wherein the contents of the operations performed by each module have been described in detail in the method embodiment and will not be repeated here.

[0095] See also Fig. 9 , Fig. 9 It is a structural schematic diagram of a vehicle-mounted terminal provided by an exemplary embodiment of the present application. Fig. 9The structure diagram of the computer system of the vehicle terminal suitable for implementing the embodiment of the present application is shown. It should be noted that: Fig. 9 The computer system 900 of the vehicle-mounted terminal shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0096] like Fig. 9 As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 902 or the program loaded from the storage part 908 to the random access memory (RAM) 903, such as executing the method in the above embodiment. In the RAM 903, various programs and data required for system operation are also stored. The CPU 901, ROM 902 and RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0097] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed so that a computer program read therefrom is installed into the storage section 908 as needed.

[0098] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 909, and / or installed from a removable medium 911. When the computer program is executed by a central processing unit (CPU) 901, various functions defined in the system of the present application are executed.

[0099] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession 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 or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0100] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0101] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A processor resource management method, characterized in that: The method comprises: Obtaining the utilization rate of each application process on the processor, and obtaining the position information of each application process in the multi-level control list, wherein the multi-level control list is used to hierarchically control the application processes whose utilization rates exceed the standard; For any application process, comparing the usage rate with a preset usage rate control value; According to the comparison result and the location information, the processor resources are hierarchically controlled for any of the application processes.

2. The processor resource management method according to claim 1, characterized in that: Before obtaining the location information of each application process in the multi-level control list, the method further includes: Divide the management and control levels into multiple levels according to the number of times the usage rate exceeds the standard continuously from low to high; According to the plurality of control levels, a plurality of control sub-tables are configured from low to high to generate the multi-level control list.

3. The processor resource management method according to claim 2, characterized in that: The step of performing hierarchical control of processor resources on any of the application processes according to the comparison result and the location information includes: When the usage rate is greater than the usage rate control value, if any of the application processes is not in the highest-level control sub-table, any of the application processes is moved from the current control sub-table to a higher-level control sub-table for control; If any of the application processes is in the highest-level control sub-table, terminate the application process.

4. The processor resource management method according to claim 2, characterized in that: The step of performing hierarchical control of processor resources on any of the application processes according to the comparison result and the location information further includes: When the usage rate is less than or equal to the usage rate control value, if any of the application processes is not in the lowest-level control subtable, any of the application processes is moved from the current control subtable to a lower-level control subtable for control; If any of the application processes is in the lowest-level control sub-list, any of the application processes will be removed from the multi-level control list.

5. The processor resource management method according to claim 1, characterized in that: The calculation method of the utilization rate includes: Based on a preset time interval, the processor usage time of each application process and the system is sampled twice; Under two sampling conditions, the time variation of each application process and the total time variation of the system are calculated; The time variation and the total time variation are calculated to obtain the usage rate of each application process.

6. The processor resource management method according to claim 1, characterized in that: For any application process, comparing the usage rate with a preset usage rate control value includes: Obtaining the running mode of any of the application processes, wherein the running mode includes a foreground running mode and a background running mode; If any of the application processes is in the foreground operation mode, the usage rate is compared with a preset foreground process control value; If any of the application processes is in the background running mode, the usage rate is compared with a preset background process control value.

7. The processor resource management method according to any one of claims 1 to 6, characterized in that: Before comparing the usage rate with a preset usage rate control value, the method further includes: Get the processor idle rate; Compare the idle rate with a preset idle rate threshold to determine whether the processor resource control condition is met; When the control condition is reached, the comparison operation between the usage rate and the usage rate control value is started.

8. The processor resource management method according to claim 7, characterized in that: Before comparing the usage rate with a preset usage rate control value, the method further includes: Setting an application process whitelist, wherein the application processes in the application process whitelist are not subject to hierarchical control of processor resources; If any of the application processes is in the application process whitelist, no hierarchical control will be performed on any of the application processes; If any of the application processes is not in the application process whitelist, a comparison operation is performed between the usage rate and the usage rate control value.

9. A processor resource management and control system, characterized in that: The system comprises: An acquisition module, used to acquire the utilization rate of each application process on the processor, and to acquire the position information of each application process in a multi-level control list, wherein the multi-level control list is used to hierarchically control application processes whose utilization rates exceed the standard; A comparison module, for comparing the usage rate with a preset usage rate control value for any application process; The control module is used to perform hierarchical control of processor resources on any of the application processes according to the comparison result and the location information.

10. A vehicle-mounted terminal, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the vehicle terminal to implement the processor resource management method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Load control method of application program

    CN101777009A

  • System resource allocation method and equipment

    CN102736953A

  • Process management method, vehicle-mounted equipment, vehicle and readable storage medium

    CN113268354A

  • Application monitoring method and device, electronic equipment and storage medium

    CN117033139A

  • Secure shell protocol SSH remote connection process management method and computing device

    CN117879886A