Dynamic memory adjustment method and system based on comprehensive task scheduling algorithm

Through the dynamic memory adjustment method based on the comprehensive task scheduling algorithm, the problem of unreasonable virtualized memory provisioning is solved, efficient memory use and performance improvement of virtualized system are achieved.

CN118963907APending Publication Date: 2024-11-15FAW CAR CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410918806.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-10
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In the prior art, the virtualized memory provisioning is unreasonable, resulting in reduced memory usage, abnormal functions and tasks, and the normal virtual machine operation cannot be performed.

Method used

Dynamic memory adjustment method based on comprehensive task scheduling algorithm is adopted to perform dynamic memory adjustments based on task priority, memory usage and free memory conditions to ensure efficient memory use and timely release memory after the task is completed.

Benefits of technology

It improves memory usage efficiency, improves the overall work efficiency and performance of the virtualized system, reduces memory invalid usage, and improves the efficiency of dynamic memory application.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963907A_ABST
    Figure CN118963907A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic memory adjustment method and system based on a comprehensive task scheduling algorithm, and belongs to the technical field of vehicle operating system virtualization, and the method comprises the steps: 1, obtaining the priority of a to-be-executed task and a virtual machine for executing the task; 2, judging whether the memory use condition of the virtual machine of the task reaches a threshold value or not; 3, the virtualization system judges whether the current idle memory is sufficient or not according to the memory requirement of the to-be-executed task; and 4, judging the priority of the to-be-executed task, and performing memory adjustment based on the priority. According to the method, appropriate memories are allocated in time for use according to different tasks, and the priorities, the memory adjustment opportunity, the memory size and the maintenance time of the tasks are judged based on a comprehensive task scheduling algorithm, so that the memory use efficiency is improved. And after the task is completed, timely releasing the memory for other virtual machines or other tasks of the current virtual machine. By means of the method, invalid memory occupation can be reduced, memory dynamic application efficiency is improved, virtualization dynamic management efficiency is improved, and therefore the purpose of improving virtualization performance is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of vehicle operating system virtualization, and in particular relates to a dynamic memory adjustment method and system based on a comprehensive task scheduling algorithm. Background Art

[0002] The role of virtualization technology in smart cockpits is increasing. In the field of smart cockpits, system virtualization technology can achieve efficient integration and intelligent control of various devices. Virtualization technology can make the in-vehicle operating system more efficient, safe and reliable. In virtualization technology, memory virtualization is a necessary condition to ensure the normal operation of each virtual machine and the functions on the virtual machine. Reasonable memory virtualization can ensure the normal operation of the functions on each virtual machine, improve the efficiency of the use of hardware physical memory, and fully release limited physical memory resources for more virtual machine tasks and functions, so as to maximize the use of hardware resources. If the virtualization memory is not allocated reasonably, it will lead to reduced memory utilization, abnormal functions and tasks, and inability to perform normal virtual machine operations. Summary of the invention

[0003] In view of the above defects existing in the prior art, the present invention provides a dynamic memory adjustment method and system based on a comprehensive task scheduling algorithm, which allocates appropriate memory for use in a timely manner according to different tasks, and judges the priority of the task, the timing of memory adjustment, the memory size and the maintenance time based on the comprehensive task scheduling algorithm, so as to improve the efficiency of memory use, and release the memory in time after the task is completed for use by other virtual machines or other tasks of the current virtual machine. This method can reduce the invalid memory occupation, improve the efficiency of dynamic memory application, and enhance the dynamic management efficiency of virtualization, thereby achieving the purpose of improving virtualization performance.

[0004] The present invention is achieved through the following technical solutions:

[0005] A dynamic memory adjustment method based on a comprehensive task scheduling algorithm specifically comprises the following steps:

[0006] Step 1: Obtain the priority of the task to be executed and the virtual machine that executes the task;

[0007] Step 2: Determine whether the memory usage of the virtual machine of the task reaches the threshold;

[0008] Step 3: The virtualization system determines whether the current free memory is sufficient based on the memory requirements of the task to be executed;

[0009] Step 4: Determine the priority of the task to be executed and adjust the memory based on the priority.

[0010] Furthermore, in step one, the priority of the task is obtained by referring to the task whitelist and priority classification.

[0011] Furthermore, in step 2, if the memory usage of the virtual machine does not reach the threshold and the memory consumption of the task is within a controllable range, there is no need to apply for dynamic adjustment to the virtual machine, and the virtual machine can complete the task execution by itself; if the memory usage of the virtual machine reaches the threshold, or after adding a task, the virtual machine memory reaches the threshold, the virtualization system will dynamically adjust the memory of the task to be executed.

[0012] Furthermore, in step three, if the current free memory is sufficient, dynamic memory of the specified capacity is allocated; if the current free memory is insufficient, and the priority of the task to be executed is lower than the priority of all current tasks, the task is suspended until the tasks of other virtual machines or the virtual machines of the task to be executed are completed and sufficient memory is released, and then allocation is made.

[0013] Furthermore, in step four, if the priority of the task to be executed is higher than the priority of all current tasks, or higher than the priority of some tasks, the memory of the low-priority tasks will be counted. If the low-priority memory capacity meets the needs of the task to be executed, and the low-priority task is about to be completed during the task scheduling and execution cycle, the task to be executed waits for this memory to be allocated.

[0014] Furthermore, if the duration of the low-priority task and the task to be executed is the same within the execution cycle, the two tasks share the memory for polling; if the duration of the low-priority task within the execution cycle is longer than that of the task to be executed, memory is dynamically allocated by comparing the occupancy of the task to be executed or the parent task of the task to be executed.

[0015] Furthermore, the method also includes: during the task execution, the virtual machine dynamically releases memory in stages according to the task execution status and memory usage expectations, so as to further improve the memory utilization rate.

[0016] Furthermore, the method also includes: after the task is executed, since the virtual machine has sufficient memory, the dynamic memory can be released to the virtualization system for use by other virtual machines.

[0017] On the other hand, the present invention also provides a dynamic memory adjustment system based on a comprehensive task scheduling algorithm, which is used to implement the above method, including:

[0018] An acquisition module is used to obtain the priority of the task to be executed and the virtual machine that executes the task;

[0019] A first judgment module is used to judge whether the memory usage of the virtual machine of the task reaches a threshold;

[0020] The second judgment module is used to judge whether the current free memory is sufficient according to the memory requirement of the task to be executed;

[0021] The third judgment module is used to judge the priority of the task to be executed and adjust the memory based on the priority.

[0022] Compared with the prior art, the advantages of the present invention are as follows:

[0023] The present invention provides a dynamic memory adjustment method and system based on a comprehensive task scheduling algorithm, which can realize dynamic and effective memory allocation, release memory in time after the task is completed, improve memory utilization, and improve the overall work efficiency of virtualization. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the following is a brief introduction to the drawings required for the specific embodiments or the description of the prior art. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn according to the actual scale.

[0025] Figure 1 The present invention is a flowchart of a dynamic memory adjustment method based on a comprehensive task scheduling algorithm. DETAILED DESCRIPTION

[0026] In order to clearly and completely describe the technical solution and its specific working process of the present invention, the specific implementation methods of the present invention are as follows in conjunction with the accompanying drawings of the specification:

[0027] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0028] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.

[0029] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0030] Example 1

[0031] like Figure 1 As shown, this embodiment provides a dynamic memory adjustment method based on a comprehensive task scheduling algorithm, the method including user-specified memory and dynamic memory adjustment according to tasks;

[0032] Among them, user-specified memory refers to virtualized dynamic memory that users can specify through memory configuration. The innovation here compared with previous technologies is that it provides a mechanism for users to specify memory. When users set up a virtual machine, they will know the main tasks running on the virtual machine. Allocating a certain amount of fixed memory to the main tasks will help the virtual machine run stably. This part will be used as the minimum memory requirement for task processing.

[0033] The dynamic memory adjustment method according to the task specifically refers to that in addition to the user-specified memory, the virtualization system determines the task priority according to the task scheduling, task priority, task duration, etc. of each virtual machine, and then adjusts the corresponding dynamic memory for the specified virtual machine executing the task according to the specific situation of the task; specifically, it includes the following steps:

[0034] Step 1: Obtain the priority of the task to be executed and the virtual machine that executes the task;

[0035] Step 2: Determine whether the memory usage of the virtual machine of the task reaches the threshold;

[0036] If the memory usage of the virtual machine does not reach the threshold and the memory consumption of the task is within the controllable range, there is no need to apply for dynamic memory adjustment to the virtual machine, and the virtual machine can complete the task execution on its own; if the memory usage of the virtual machine reaches the threshold, or the virtual machine memory reaches the threshold after the task is added, the virtualization system will dynamically adjust the memory of the task.

[0037] Step 3: The virtualization system determines whether the current free memory is sufficient based on the memory requirements of the task to be executed;

[0038] If sufficient, dynamic memory of the specified capacity is allocated; if insufficient, and the priority of the task is lower than the priority of all current tasks, the task is suspended until other virtual machines or the tasks of the virtual machine are completed and sufficient memory is released, and then allocation is made;

[0039] Step 4: Determine the priority of the task to be executed and adjust the memory based on the priority.

[0040] If the priority of the task is higher than the priority of all current tasks, or higher than the priority of some tasks, the memory of the low-priority task will be counted. If the memory capacity of the low-priority task meets the needs of the new task, and the low-priority task is about to be completed during the task scheduling and execution cycle, the new task will wait for this memory to be allocated; if the low-priority task and the new task have the same duration during the execution cycle, the two tasks will share the memory for polling; if the duration of the low-priority task during the execution cycle is longer than that of the new task, the memory will be dynamically allocated by comparing the occupancy of the polling task or the task of the previous level of the task. If the memory requirements of the new task cannot be met by calling existing tasks (for example, the new task has a high priority, a long cycle, and no existing memory resources are available), the execution of the task is achieved by suspending some tasks for polling execution. The task to be polled is set according to the memory capacity required by the new task. The priority of the suspended task is lower than that of the task to be executed. After the task in the execution state is suspended, the polling time for the next execution should not exceed the total duration of the polling task / the number of tasks to be suspended, so as to ensure the smoothness of the system function.

[0041] Dynamic memory release can be performed during and after task execution. Usually, after the task is completed, since the virtual machine has sufficient memory, dynamic memory can be released to the virtualization system for use by other virtual machines; in particular, during task execution, the virtual machine is allowed to dynamically release memory in stages according to the task execution status and memory usage expectations, so as to further improve memory utilization. For example, according to the memory usage and expectations during task execution, memory can be dynamically released. For example, if the memory demand during task execution is 200M, 80M, and 120M, after the 200M stage, 40M of memory is released in time for use by other virtual machines or tasks. At the same time, when the 120M demand arrives, memory is dynamically applied again to improve memory utilization.

[0042] Example 2

[0043] This embodiment provides a dynamic memory adjustment system based on a comprehensive task scheduling algorithm, which is used to implement the method described in Embodiment 1, including:

[0044] An acquisition module is used to obtain the priority of the task to be executed and the virtual machine that executes the task;

[0045] A first judgment module is used to judge whether the memory usage of the virtual machine of the task reaches a threshold;

[0046] The second judgment module is used to judge whether the current free memory is sufficient according to the memory requirement of the task to be executed;

[0047] The third judgment module is used to judge the priority of the task to be executed and adjust the memory based on the priority.

[0048] The preferred embodiments of the present invention are described in detail above in conjunction with the accompanying drawings. However, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, a variety of simple modifications can be made to the technical solution of the present invention, and these simple modifications all belong to the protection scope of the present invention.

[0049] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not further describe various possible combinations.

[0050] In addition, various embodiments of the present invention may be arbitrarily combined, and as long as they do not violate the concept of the present invention, they should also be regarded as the contents disclosed by the present invention.

Claims

1. A dynamic memory adjustment method based on a comprehensive task scheduling algorithm, characterized in that: The specific steps include: Step 1: Obtain the priority of the task to be executed and the virtual machine that executes the task; Step 2: Determine whether the memory usage of the virtual machine of the task reaches the threshold; Step 3: The virtualization system determines whether the current free memory is sufficient based on the memory requirements of the task to be executed; Step 4: Determine the priority of the task to be executed and adjust the memory based on the priority.

2. A dynamic memory adjustment method based on a comprehensive task scheduling algorithm as claimed in claim 1, characterized in that: In step 1, the priority of the task is obtained by referring to the task whitelist and priority classification.

3. A dynamic memory adjustment method based on a comprehensive task scheduling algorithm as claimed in claim 1, characterized in that: In step 2, if the memory usage of the virtual machine does not reach the threshold and the memory consumption of the task is within a controllable range, there is no need to apply for dynamic adjustment to the virtual machine, and the virtual machine can complete the task execution by itself; If the virtual machine memory usage reaches the threshold, or after a new task is added, the virtual machine memory reaches the threshold, the virtualization system will dynamically adjust the memory for the task to be executed.

4. A dynamic memory adjustment method based on a comprehensive task scheduling algorithm as claimed in claim 1, characterized in that: In step three, if the current free memory is sufficient, dynamic memory of the specified capacity is allocated; if the current free memory is insufficient and the priority of the task to be executed is lower than the priority of all current tasks, the task is suspended until the tasks of other virtual machines or the virtual machines of the task to be executed are completed and sufficient memory is released, and then allocation is made.

5. The dynamic memory adjustment method based on the comprehensive task scheduling algorithm as claimed in claim 1, characterized in that: In step 4, if the priority of the task to be executed is higher than the priority of all current tasks, or higher than the priority of some tasks, the memory of the low-priority task will be counted. If the low-priority memory capacity meets the needs of the task to be executed, and the low-priority task is about to be completed during the task scheduling and execution cycle, the task to be executed waits for this memory to be allocated.

6. A dynamic memory adjustment method based on a comprehensive task scheduling algorithm as claimed in claim 5, characterized in that: If the duration of the low-priority task and the task to be executed is the same during the execution cycle, the two tasks share the memory in a round-robin manner; if the duration of the low-priority task is longer than that of the task to be executed during the execution cycle, memory is dynamically allocated by comparing the occupancy of the task to be executed or the parent task of the task to be executed.

7. A dynamic memory adjustment method based on a comprehensive task scheduling algorithm as claimed in claim 1, characterized in that: The method also includes: during the task execution, the virtual machine dynamically releases memory in stages according to the task execution status and memory usage expectations, so as to further improve the memory utilization rate.

8. The dynamic memory adjustment method based on the comprehensive task scheduling algorithm as claimed in claim 1, characterized in that: The method further includes: after the task is executed, since the virtual machine has sufficient memory, the dynamic memory can be released to the virtualization system for use by other virtual machines.

9. A dynamic memory adjustment system based on a comprehensive task scheduling algorithm, used to implement the method according to any one of claims 1 to 8, characterized in that: include: An acquisition module is used to obtain the priority of the task to be executed and the virtual machine that executes the task; A first judgment module is used to judge whether the memory usage of the virtual machine of the task reaches a threshold; The second judgment module is used to judge whether the current free memory is sufficient according to the memory requirement of the task to be executed; The third judgment module is used to judge the priority of the task to be executed and adjust the memory based on the priority.

Citation Information

Cited By

  • Memory allocation method, device and system of battery management system, medium and product

    CN119847768A