Task memory dynamic adjustment method and terminal

By monitoring the history and real-time execution data of tasks, the memory threshold of distributed tasks is dynamically adjusted, which solves the problem of static memory threshold limiting task processing speed and improves task processing speed and efficiency.

CN118535338AActive Publication Date: 2024-08-23FUJIAN TQ ONLINE INTERACTIVE INC
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202410686773.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-30
Publication Date
2024-08-23
Estimated Expiration
2044-05-30

AI Technical Summary

Technical Problem

Due to the static memory threshold set in existing distributed task processing, the task processing speed is limited and the overall efficiency is limited.

Method used

Calculate the average processing rate of subtasks by monitoring the historical execution data of the task, and dynamically adjust the memory threshold based on real-time execution data. If the subtask reaches a preset rate, set a fast task label or increase the memory threshold to optimize the task processing rate.

Benefits of technology

By dynamically adjusting the memory threshold, the task processing rate is identified and optimized to improve task processing speed and efficiency and avoid infinite amplification of the memory threshold.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535338A
    Figure CN118535338A
Patent Text Reader

Abstract

The invention discloses a dynamic adjustment method for a task memory and a terminal. The method comprises the following steps: monitoring and calculating an average task processing rate of each sub-task of a to-be-processed task under a historical condition; when real-time execution data of the to-be-processed task is obtained, if the to-be-processed task is not provided with a fast task label, judging whether the current to-be-processed task exceeds a preset proportion of subtasks and reaches an average task processing rate, and if yes, setting the fast task label for the to-be-processed task; and if the to-be-processed task is set with the fast task label, increasing the memory threshold of the to-be-processed task according to a preset proportion. In this way, through a method of comparing the real-time processing rate of one task with the historical average processing rate, the task of which the processing rate can be improved by expanding the memory can be identified, a proper memory threshold value is dynamically configured for the task, and the task processing speed and efficiency can be improved through dynamic adjustment of the task memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of memory adjustment, and in particular to a method and a terminal for dynamically adjusting task memory. Background Art

[0002] In today's Internet systems, there are various scheduled tasks. In order to support massive data processing, distributed task processing must be adopted.

[0003] At present, the common distributed task processing flow is: a task needs to process a large amount of data, which is usually split into multiple subtasks, and each subtask sets a fixed memory threshold for data processing. Usually, the amount of data processed by each task is different, and the internal processing logic of each task is also different, which leads to different task processing efficiency. However, the same memory threshold is set for the tasks.

[0004] Therefore, in current distributed tasks, since a static memory threshold is set for the task, its task processing speed is limited and the overall task processing efficiency is limited. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method and a terminal for dynamically adjusting task memory, which can improve the task processing speed and efficiency through the dynamic adjustment of task memory.

[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0007] A method for dynamically adjusting task memory includes the following steps:

[0008] Monitor the historical execution data of the task to be processed, and calculate the average task processing rate of each subtask in the task to be processed according to the historical execution data;

[0009] Acquire the real-time execution data of the task to be processed, and if the task to be processed is not set with a fast task tag, set a fast task tag for the task to be processed when more than a preset proportion of subtasks in the real-time execution data of the task to be processed reaches the average task processing rate;

[0010] If the task to be processed has been set with a fast task tag, the memory threshold of the task to be processed is increased according to a preset ratio.

[0011] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0012] A task memory dynamic adjustment terminal comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the above-mentioned task memory dynamic adjustment method is implemented.

[0013] The beneficial effects of the present invention are: monitoring and calculating the average task processing rate of each subtask of the pending task under historical circumstances; when obtaining the real-time execution data of the pending task, if the pending task has not been set with a fast task label, then judging whether the current pending task exceeds the preset proportion of subtasks to reach the average task processing rate, if so, setting a fast task label for the pending task; if the pending task has been set with a fast task label, then increasing the memory threshold of the pending task according to the preset proportion. In this way, by comparing the real-time processing rate of a task with the historical average processing rate, it is possible to identify tasks whose processing rate can be increased by expanding memory, and dynamically configure a suitable memory threshold for the task, and it is possible to improve the task processing speed and efficiency by dynamically adjusting the task memory. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A flowchart of a method for dynamically adjusting task memory according to an embodiment of the present invention;

[0015] Figure 2 A schematic diagram of a terminal for dynamically adjusting task memory according to an embodiment of the present invention;

[0016] Description of labels:

[0017] 1. A dynamic adjustment terminal for task memory; 2. Memory; 3. Processor. DETAILED DESCRIPTION

[0018] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0019] Please refer to Figure 1 , an embodiment of the present invention provides a method for dynamically adjusting task memory, comprising the steps of:

[0020] Monitor the historical execution data of the task to be processed, and calculate the average task processing rate of each subtask in the task to be processed according to the historical execution data;

[0021] Acquire the real-time execution data of the task to be processed, and if the task to be processed is not set with a fast task tag, set a fast task tag for the task to be processed when more than a preset proportion of subtasks in the real-time execution data of the task to be processed reaches the average task processing rate;

[0022] If the task to be processed has been set with a fast task tag, the memory threshold of the task to be processed is increased according to a preset ratio.

[0023] From the above description, it can be seen that the beneficial effects of the present invention are: monitoring and calculating the average task processing rate of each subtask of the task to be processed under historical circumstances; when obtaining the real-time execution data of the task to be processed, if the task to be processed has not been set with a fast task label, then judging whether the current task to be processed exceeds the preset proportion of subtasks to reach the average task processing rate, if so, setting a fast task label for the task to be processed; if the task to be processed has been set with a fast task label, then increasing the memory threshold of the task to be processed according to the preset proportion. In this way, by comparing the real-time processing rate of a task with the historical average processing rate, it is possible to identify tasks whose processing rate can be improved by expanding memory, and dynamically configure appropriate memory thresholds for tasks, and it is possible to improve the task processing speed and efficiency by dynamically adjusting the task memory.

[0024] Furthermore, the historical execution data includes the number of subtasks of the task to be processed, the total amount of processed data of each subtask and the processing time of each subtask;

[0025] Calculating the average task processing rate of each subtask in the task to be processed according to the historical execution data, including:

[0026] The total amount of processed data of each subtask of the task to be processed is divided by the processing time to obtain the task processing rate of each subtask, and the average task processing rate of each subtask is calculated.

[0027] From the above description, it can be known that by obtaining the task history execution data including the number of subtasks and subtask processing data, the history of the tasks to be processed can be understood, so as to facilitate the subsequent judgment of the fast tasks.

[0028] Further, the memory threshold of the task to be processed is increased according to a preset ratio, including:

[0029] Determine whether the memory threshold of the task to be processed reaches the preset maximum memory value. If not, increase the memory threshold of the task to be processed according to a preset ratio, and when the increased memory threshold exceeds the preset maximum memory value, modify the increased memory threshold to the preset maximum memory value.

[0030] From the above description, it can be seen that when the task to be processed is a fast task, the optimal memory threshold of the task to be processed can be confirmed through automatic step-by-step verification, and the memory threshold can be prevented from being infinitely enlarged, so as to ensure the rationality and reliability of memory adjustment.

[0031] Furthermore, if the memory threshold of the task to be processed reaches a preset memory maximum value, the number of subtasks of the task to be processed is increased.

[0032] From the above description, it can be seen that when the optimal memory value is reached, the number of subtasks begins to increase, so as to gradually and appropriately verify the number of subtasks, so as to further improve the task processing rate.

[0033] Further, the memory threshold of the task to be processed is increased according to a preset ratio, and then includes:

[0034] It is determined whether the task processing rate of the task to be processed after the memory threshold is increased is higher than the task processing rate of the task to be processed before the memory threshold is increased; if not, the fast task label of the task to be processed is removed.

[0035] From the above description, it can be seen that if the processing rate of the task does not increase after the memory threshold is dynamically adjusted, it means that this task is not a task whose execution efficiency can be improved by expanding the memory. It is necessary to remove the fast task label to avoid invalid expansion of memory.

[0036] Please refer to Figure 2 Another embodiment of the present invention provides a terminal for dynamically adjusting task memory, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements each step of the above-mentioned method for dynamically adjusting task memory when executing the computer program.

[0037] The above-mentioned method and terminal for dynamically adjusting task memory of the present invention are suitable for improving the task processing rate of distributed tasks, and are described below through specific implementation methods:

[0038] Embodiment 1

[0039] Please refer to Figure 1 , a method for dynamically adjusting task memory, comprising the steps of:

[0040] S1. Monitor the historical execution data of the task to be processed, and calculate the average task processing rate of each subtask in the task to be processed according to the historical execution data.

[0041] The historical execution data includes the number of subtasks of the task to be processed, the total amount of processed data of each subtask and the processing time of each subtask.

[0042] In this embodiment, for each task, its historical execution data needs to be monitored, mainly including the number of subtasks split from the task, the total amount of processed data of each subtask and the processing time of each subtask.

[0043] After monitoring the historical execution data of the task to be processed, the total amount of processing data of each subtask of the task to be processed is divided by the processing time to obtain the task processing rate of each subtask, and the average task processing rate of each subtask is calculated.

[0044] In this embodiment, for the statistical data of the subtasks in each task, the task processing rate is calculated based on the amount of data processed by each subtask divided by the processing time of the subtask. The amount of data is based on the amount of data transmitted to the subtask, including the amount of task processing data transmitted by the external system or obtained from the data source, and the unit is converted into kb; the processing time is based on seconds, so the amount of data processed by each subtask per second can be accurately calculated.

[0045] The average task processing rate is calculated based on the task processing rate of each subtask to obtain the average task processing rate.

[0046] S2. Acquire the real-time execution data of the task to be processed. If the task to be processed is not set with a fast task tag, a fast task tag is set for the task to be processed when more than a preset proportion of subtasks in the real-time execution data of the task to be processed reaches the average task processing rate.

[0047] In this embodiment, assuming that the average task processing rate calculated in step S1 is 500 kb / s, when at least half of the subtasks in a task reach this rate, the task is considered a fast task by default, and a fast task label is set for the task.

[0048] S3. If the task to be processed has been set with a fast task tag, the memory threshold of the task to be processed is increased according to a preset ratio.

[0049] Specifically, step S3 includes the following contents:

[0050] If the memory threshold of the pending task does not reach the preset maximum memory value, the memory threshold of the pending task is increased according to a preset ratio, and when the increased memory threshold exceeds the preset maximum memory value, the increased memory threshold is modified to the preset maximum memory value. Afterwards, if the task processing rate of the pending task after the memory threshold is increased is lower than or equal to the task processing rate of the pending task before the memory threshold is increased, the fast task label of the pending task is removed.

[0051] If the memory threshold of the task to be processed reaches the preset memory maximum value, the number of subtasks of the task to be processed is increased.

[0052] Specifically, when the task to be processed is executed again, the memory threshold of this task can be increased according to a certain ratio, and then observe whether the task execution time is improved compared with before. If it is improved, continue to adjust the memory threshold of the task memory in the manner of steps S1 to S3 until it is adjusted to a suitable threshold; if it is not improved, it means that this task is not a task whose task execution rate can be increased by expanding memory, and the fast task label of the task needs to be removed.

[0053] At the same time, there is a maximum value of the memory threshold. When the memory threshold reaches the maximum value, it will not continue to adjust to prevent the memory threshold from being infinitely enlarged. At this time, try to increase the number of subtasks and gradually verify how many subtasks are required to achieve the optimal execution rate of the task.

[0054] In this embodiment, if the subtasks less than or equal to the preset proportion in the adjusted real-time execution data of the task to be processed reach the average task processing rate, the fast task label is removed for the task to be processed.

[0055] Embodiment 2

[0056] Please refer to Figure 2 A task memory dynamic adjustment terminal 1 includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor 3 executes the computer program, each step of a task memory dynamic adjustment method of embodiment 1 is implemented.

[0057] In summary, the present invention provides a method and terminal for dynamically adjusting task memory, which monitors and calculates the average task processing rate of each subtask of a pending task under historical circumstances; when the real-time execution data of the pending task is obtained, if the pending task has not been set with a fast task label, it is determined whether the current pending task exceeds a preset proportion of subtasks to reach the average task processing rate, and if so, a fast task label is set for the pending task; if the pending task has been set with a fast task label, the memory threshold of the pending task is increased according to a preset proportion. In this way, it is possible to identify tasks whose processing rate can be increased by expanding memory through a method of comparing the real-time processing rate of a task with the historical average processing rate, and dynamically configure a suitable memory threshold for the task. That is, the speed-up of the subtask is achieved by dynamically adjusting the memory threshold of the subtask, and then the efficiency of the entire task can be improved.

[0058] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for dynamically adjusting task memory, characterized in that: Includes steps: Monitor the historical execution data of the task to be processed, and calculate the average task processing rate of each subtask in the task to be processed according to the historical execution data; Acquire the real-time execution data of the task to be processed, and if the task to be processed is not set with a fast task tag, set a fast task tag for the task to be processed when more than a preset proportion of subtasks in the real-time execution data of the task to be processed reaches the average task processing rate; If the task to be processed has been set with a fast task tag, the memory threshold of the task to be processed is increased according to a preset ratio.

2. The method for dynamically adjusting task memory according to claim 1, characterized in that: The historical execution data includes the number of subtasks of the task to be processed, the total amount of processed data of each subtask and the processing time of each subtask; Calculating the average task processing rate of each subtask in the task to be processed according to the historical execution data includes: The total amount of processed data of each subtask of the task to be processed is divided by the processing time to obtain the task processing rate of each subtask, and the average task processing rate of each subtask is calculated.

3. The method for dynamically adjusting task memory according to claim 1, characterized in that: The memory threshold of the task to be processed is increased according to a preset ratio, including: Determine whether the memory threshold of the task to be processed reaches the preset maximum memory value. If not, increase the memory threshold of the task to be processed according to a preset ratio, and when the increased memory threshold exceeds the preset maximum memory value, modify the increased memory threshold to the preset maximum memory value.

4. The method for dynamically adjusting task memory according to claim 3, characterized in that: If the memory threshold of the task to be processed reaches the preset memory maximum value, the number of subtasks of the task to be processed is increased.

5. The method for dynamically adjusting task memory according to claim 3, characterized in that: The memory threshold of the task to be processed is increased according to a preset ratio, and then includes: It is determined whether the task processing rate of the task to be processed after the memory threshold is increased is higher than the task processing rate of the task to be processed before the memory threshold is increased; if not, the fast task label of the task to be processed is removed.

6. A task memory dynamic adjustment terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the following steps are implemented: Monitor the historical execution data of the task to be processed, and calculate the average task processing rate of each subtask in the task to be processed according to the historical execution data; Acquire the real-time execution data of the task to be processed, and if the task to be processed is not set with a fast task tag, set a fast task tag for the task to be processed when more than a preset proportion of subtasks in the real-time execution data of the task to be processed reaches the average task processing rate; If the task to be processed has been set with a fast task tag, the memory threshold of the task to be processed is increased according to a preset ratio.

7. A task memory dynamic adjustment terminal according to claim 6, characterized in that: The historical execution data includes the number of subtasks of the task to be processed, the total amount of processed data of each subtask and the processing time of each subtask; Calculating the average task processing rate of each subtask in the task to be processed according to the historical execution data includes: The total amount of processed data of each subtask of the task to be processed is divided by the processing time to obtain the task processing rate of each subtask, and the average task processing rate of each subtask is calculated.

8. The terminal for dynamically adjusting task memory according to claim 6, characterized in that: The memory threshold of the task to be processed is increased according to a preset ratio, including: Determine whether the memory threshold of the task to be processed reaches the preset maximum memory value. If not, increase the memory threshold of the task to be processed according to a preset ratio, and when the increased memory threshold exceeds the preset maximum memory value, modify the increased memory threshold to the preset maximum memory value.

9. A task memory dynamic adjustment terminal according to claim 8, characterized in that: If the memory threshold of the task to be processed reaches the preset memory maximum value, the number of subtasks of the task to be processed is increased.

10. The terminal for dynamically adjusting task memory according to claim 8, characterized in that: The memory threshold of the task to be processed is increased according to a preset ratio, and then includes: It is determined whether the task processing rate of the task to be processed after the memory threshold is increased is higher than the task processing rate of the task to be processed before the memory threshold is increased; if not, the fast task label of the task to be processed is removed.

Citation Information

Patent Citations

  • Method and terminal for managing program memory footprint

    CN105824702A

  • Computing resource distributing method and apparatus

    CN106874100A

  • Task processing method and device, computer equipment and storage medium

    CN111737005A

  • Real-time data processing method and device

    CN112130995A

  • Thread pool parameter adjusting method and device, storage medium and electronic equipment

    CN116909744A