A reliable configuration method for executing tasks at a scheduled time
By obtaining and splicing resource request vectors for timed execution of tasks, combining the system resource status, priority allocation of computing resources is solved, and the problem of insufficient resources in distributed computer systems is improved, and the reliability of the system and task execution efficiency are improved.
Patent Information
- Application Number
- CN202510694143.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-05-28
AI Technical Summary
In a distributed computer system, concurrent generation of multiple timing tasks results in insufficient system resources, affecting the reliability of the computer system.
By obtaining the resource request vector for timed execution of tasks, splicing it into a maximum demand matrix, combining the system's current allocation matrix and available resource vectors, computing resources are allocated first to ensure the execution of the target task.
Improves the reliability of computer systems when executing tasks in a large number of timed tasks, ensures that as many target tasks as possible are executed, and reduces the waiting time for other tasks.
Smart Images

Figure CN120216209B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of task scheduling, and particularly to a reliable configuration method for scheduled tasks. Background Art
[0002] In a computer system, especially in a distributed computer system, there may be a large number of scheduled tasks. Scheduled tasks usually have strong timeliness and need to obtain execution results within a limited time. However, the execution cycles of different scheduled tasks are different, and there may be a situation where a large number of scheduled tasks are generated concurrently, resulting in insufficient system resources. How to allocate limited resources to multiple scheduled tasks and complete a large number of scheduled tasks in the shortest possible time, thereby improving the reliability of the computer system, has become an urgent problem to be solved. Summary of the Invention
[0003] The main purpose of this application is to provide a reliable configuration method, device, and computer storage medium for scheduled tasks, aiming to improve the reliability of the computer system when facing a large number of scheduled tasks.
[0004] In a first aspect, this application provides a reliable configuration method for scheduled tasks. The reliable configuration method for scheduled tasks includes the following steps:
[0005] Obtain the resource request vectors corresponding to the task processes of multiple scheduled tasks;
[0006] Concatenate the resource request vectors of each task process to obtain a maximum demand matrix;
[0007] Determine the current demand matrix according to the maximum demand matrix and the current allocation matrix of the system;
[0008] Allocate computing resources to each task process based on the available resource vector of the system and the current demand matrix.
[0009] In some embodiments, the step of allocating computing resources to each task process based on the available resource vector of the system and the current demand matrix includes:
[0010] Calculate the column sum vector of the current demand matrix, and compare the first component of the column sum vector with the second component corresponding to the available resource vector;
[0011] If each first component of the column sum vector is less than or equal to the second component corresponding to the available resource vector, allocate the available resources of the system to each scheduled task;
[0012] If the first component of the column sum vector is greater than the second component corresponding to the available resource vector, determine a target task from the timed execution tasks, and allocate the available resources of the system to each of the target tasks.
[0013] In some embodiments, the determining a target task from the timed execution tasks if the first component of the column sum vector is greater than the second component corresponding to the available resource vector includes:
[0014] If the first component of the column sum vector is greater than the second component corresponding to the available resource vector, determine the column where the first component is located as the target element in the resource request vector, and the elements in the resource request vector other than the target element are candidate elements;
[0015] Arrange the timed execution tasks according to the magnitude of the target elements in the resource request vector, where the timed execution task with a smaller target element is arranged in a more forward position;
[0016] Determine the timed execution tasks in the first N positions as the target tasks, where the sum of the target elements of the timed execution tasks in the first N positions is less than or equal to the second component corresponding to the available resource vector, and the sum of the candidate elements of the timed execution tasks in the first N positions is less than or equal to the second component corresponding to the available resource vector.
[0017] In some embodiments, the determining the timed execution tasks in the first N positions as the target tasks includes:
[0018] Accumulate the target elements and candidate elements of the timed execution tasks in the first N positions to obtain the sum of the target elements and the sum of the candidate elements;
[0019] Determine the timed execution tasks in the first N positions as the target tasks when any of the following conditions is met: the sum of the target elements in the first N + 1 positions is greater than or equal to the second component corresponding to the available resource vector, or the sum of the candidate elements in the first N + 1 positions is greater than or equal to the second component corresponding to the available resource vector.
[0020] In some embodiments, the arranging the timed execution tasks according to the magnitude of the target elements in the resource request vector includes:
[0021] If there are equal target elements in the timed execution tasks, arrange the timed execution tasks according to the task execution duration, where the timed execution task with a smaller task execution duration is arranged in a more forward position.
[0022] In some embodiments, the obtaining the resource request vector corresponding to the task processes of multiple timed execution tasks includes:
[0023] Obtain the historical resource requirement data of the scheduled execution task, and determine multiple historical demand time series with different lengths based on the historical resource requirement data;
[0024] Predict the resource requirements according to each of the historical demand time series to obtain at least one demand prediction result;
[0025] Determine the resource request vector according to the demand prediction result.
[0026] In some embodiments, the determining the resource request vector according to the demand prediction result includes:
[0027] Determine the minimum value, the maximum value and the likelihood estimation value in the demand prediction result according to the demand prediction result;
[0028] Based on the following formula, calculate the target value according to the minimum value, the maximum value and the likelihood estimation value:
[0029] ;
[0030] where Min represents the minimum value, L represents the likelihood estimation value, Max represents the maximum value, , , respectively represent the first weight, the second weight, and the third weight;
[0031] Take the target value as an item in the resource request vector to obtain the resource request vector.
[0032] In some embodiments, the method further includes:
[0033] Calculate according to the following formula , , :
[0034] ;
[0035] ;
[0036] ;
[0037] where A is a preset value, σ is the standard deviation of the demand prediction result, and μ is the average value of the demand prediction result.
[0038] In a second aspect, the present application further provides a computer device, which includes a processor, a memory, and a computer program stored on the memory and executable by the processor. When the computer program is executed by the processor, it implements the reliable configuration method for scheduled task execution as described above.
[0039] In a third aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the reliable configuration method for scheduled task execution as described above.
[0040] The present application provides a reliable configuration method, device, and computer storage medium for scheduled task execution. The present application obtains resource request vectors corresponding to the task processes of multiple scheduled tasks; splices the resource request vectors of each task process to obtain a maximum demand matrix; determines the current demand matrix according to the maximum demand matrix and the current allocation matrix of the system; and allocates computing resources to each task process based on the available resource vector of the system and the current demand matrix. By accurately calculating the resource request vectors, computing resources are allocated to the task processes of each scheduled task according to the maximum demand matrix, improving the reliability of the computer system in the face of a large number of scheduled tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0042] Figure 1 It is a flowchart showing a reliable configuration method for scheduled task execution provided by an embodiment of the present application;
[0043] Figure 2 It is a schematic block diagram of a system of a reliable configuration method for scheduled task execution provided by an embodiment of the present application;
[0044] Figure 3 It is a schematic block diagram of the structure of a computer device involved in an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0045] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts fall within the scope of protection of the present application.
[0046] The flowcharts shown in the accompanying drawings are only illustrative examples and do not necessarily include all content and operations / steps, nor do they have to be executed in the described order. For example, some operations / steps can be decomposed, combined, or partially merged, so the actual execution order may change according to the actual situation.
[0047] The embodiments of the present application provide a reliable configuration method, device, and computer storage medium for executing tasks at regular intervals.
[0048] The following will describe in detail some embodiments of the present application with reference to the accompanying drawings. Without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0049] Please refer to Figure 1 , Figure 1 , which is a schematic flowchart of a reliable configuration method for executing tasks at regular intervals provided for the embodiments of the present application. This reliable configuration method for executing tasks at regular intervals can be used in a terminal or a server to accurately calculate a resource request vector, so as to allocate computing resources to the task processes of each task executed at regular intervals according to the maximum demand matrix, improving the reliability of the computer system when facing a large number of tasks executed at regular intervals. Among them, the terminal can be an electronic device such as a mobile phone, a tablet computer, a laptop computer, a desktop computer, a personal digital assistant, and a wearable device; the server can be an independent server, a server cluster, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), as well as big data and artificial intelligence platforms.
[0050] As Figure 1 shown, this reliable configuration method for executing tasks at regular intervals includes steps S101 to S104.
[0051] Step S101: Obtain the resource request vectors corresponding to the task processes of multiple tasks executed at regular intervals.
[0052] Exemplarily, a task process for running a scheduled task requires certain computer resources, and the execution cycles of different scheduled tasks are different. During the process of a large number of scheduled tasks executing cyclically according to their respective execution cycles, different scheduled tasks may execute synchronously. And it can be understood that since the execution cycle of the same scheduled task is determined, it is possible to pre-determine which scheduled tasks will execute synchronously according to the execution cycle. In order to avoid insufficient resources during the execution of scheduled tasks and affect the normal progress of the task process, before running the scheduled task, it is possible to obtain the resource request vector corresponding to the task process of the scheduled tasks that will execute synchronously. Among them, the resource request vector includes the requirements of the scheduled task for various computing resources, such as processor cores, memory, disk space, etc.
[0053] For example, assume that the number of processor cores required by the task process of a certain scheduled task is 1, the required memory size is 64 MB, and the required disk space size is 512 MB. Then its corresponding resource request vector is (1, 64, 512).
[0054] In some embodiments, the obtaining of the resource request vectors corresponding to the task processes of multiple scheduled tasks includes:
[0055] Obtain the historical resource requirement data of the scheduled task, and determine multiple historical demand time series with different lengths based on the historical resource requirement data;
[0056] Predict the resource requirements according to each of the historical demand time series to obtain at least one demand prediction result;
[0057] Determine the resource request vector according to the demand prediction result.
[0058] Exemplarily, the resource request vector can be set in advance by the developer according to the characteristics of the task. Since the scheduled task has the characteristic of periodic execution, it is also possible to predict the size of each element in the resource request vector based on a prediction model according to the computing resources consumed by the scheduled task in the past execution. Among them, the prediction model can be implemented based on an autoregressive model, a long short-term memory network model, a time series model, etc., which is not limited here.
[0059] It is understandable that the demand prediction results obtained by predicting based on the historical resource demand data of the past 5 times of scheduled tasks are different from the demand prediction results obtained by predicting based on the historical resource demand data of the past 10 times of scheduled tasks. The former uses the relatively new historical resource demand data, and the prediction result may be more in line with the demand situation in the short term; while the latter uses more historical resource demand data, and the prediction result may be more accurate. In order to improve the accuracy of the resource request vector, the resource demand can be predicted based on multiple historical demand time series of different lengths to obtain corresponding multiple demand prediction results. For example, the number of historical resource demand data included in multiple historical demand time series of different lengths can be 50, 51, 52... and so on, which will not be elaborated here.
[0060] Specifically, the demand prediction results may respectively include multiple processor core demand prediction results, multiple memory demand prediction results, and multiple disk space demand prediction results of the scheduled task, which are not limited here.
[0061] In some embodiments, determining the resource request vector according to the demand prediction result includes:
[0062] Determining the minimum value, the maximum value, and the likelihood estimation value in the demand prediction result according to the demand prediction result;
[0063] Based on the following formula, calculating the target value according to the minimum value, the maximum value, and the likelihood estimation value:
[0064] ;
[0065] where Min represents the minimum value, L represents the likelihood estimation value, and Max represents the maximum value, , , respectively represent the first weight, the second weight, and the third weight;
[0066] Taking the target value as an item in the resource request vector to obtain the resource request vector.
[0067] Exemplarily, determining the minimum value, the maximum value, and the likelihood estimation value in a series of demand prediction results, where the likelihood estimation value can be the median, the average, or the mode in the demand prediction results, which is not limited here. Specifically, respectively determining the minimum value, the maximum value, and the likelihood estimation value corresponding to the processor core demand prediction result, the minimum value, the maximum value, and the likelihood estimation value corresponding to the memory demand prediction result, and the minimum value, the maximum value, and the likelihood estimation value corresponding to the disk space demand prediction result.
[0068] Exemplarily, target values are calculated respectively for the processor core requirements, memory requirements, and disk space requirements, and the target values corresponding to the processor core requirements, memory requirements, and disk space requirements are concatenated to obtain the resource request vector.
[0069] Among them, , , respectively represent the first weight, the second weight, and the third weight corresponding to the minimum value, the maximum value, and the likelihood estimation value. The specific values of the first weight, the second weight, and the third weight can be determined according to actual requirements. For example, considering the possibility that the target value is on the small side and it is necessary to calculate a relatively small target value, the size of the first weight is increased; considering the possibility that the target value is on the large side and it is necessary to calculate a relatively large target value, the size of the third weight is increased.
[0070] Exemplarily, after calculating the target values, the target values are concatenated according to the positions of the items corresponding to the respective target values in the resource request vector to obtain the resource request vector. For example, the target values are arranged in the order of (processor core requirements, memory requirements, disk space requirements) to obtain the resource request vector.
[0071] In some embodiments, the method further includes:
[0072] Calculate according to the following formula , , :
[0073] ;
[0074] ;
[0075] ;
[0076] where A is a preset value, σ is the standard deviation of the demand prediction result, and μ is the average value of the demand prediction result.
[0077] Exemplarily, A is a preset value, and it can be understood that the value of A is equal to The value of A can be determined according to actual requirements. In actual operation, A can be 6. σ / μ reflects the degree of fluctuation of the demand prediction result. The larger the value of σ / μ, the greater the fluctuation of the demand prediction result. Since the value of σ / μ is usually between 0.05 - 0.15, the larger the value of A, the greater the weight of the likelihood estimation value, indicating that more consideration is given to the size of the likelihood estimation value when calculating the target value.
[0078] Exemplarily, the magnitude of the second weight calculated by the above method is inversely proportional to the magnitude of σ / μ, and the magnitude of the first weight is proportional to the magnitude of σ / μ. It can be understood that the greater the fluctuation of the demand prediction result, the less accurate the likelihood estimation value, and the weight of the likelihood estimation value is reduced; on the contrary, the smaller the fluctuation of the demand prediction result, the more accurate the likelihood estimation value, and the weight of the likelihood estimation value is increased.
[0079] Exemplarily, in order to avoid the situation of insufficient resources, it is necessary to calculate a relatively large target value. Therefore, the magnitude of the third weight is increased.
[0080] Step S102: Concatenate the resource request vectors of each of the task processes to obtain a maximum demand matrix.
[0081] Exemplarily, the resource request vectors of multiple task processes are concatenated to obtain a maximum demand matrix composed of the resource request vectors of multiple timed execution tasks. For example, assume that the first resource request vector of the first task process is (A1, B1, C1), the second resource request vector of the second task process is (A2, B2, C2), and the third resource request vector of the third task process is (A3, B3, C3). Then the maximum demand matrix composed of the first resource request vector, the second resource request vector, and the third resource request vector is:
[0082]
[0083] Step S103: Determine the current demand matrix according to the maximum demand matrix and the current allocation matrix of the system.
[0084] Exemplarily, each timed execution task has not officially started to execute, but the task processes corresponding to each timed execution task already exist in the system. At this time, although the resources occupied by the task processes corresponding to the timed execution tasks are less than the magnitude indicated by the resource request vector, they also need to occupy a certain amount of resources. Therefore, the resources already occupied by each timed execution task can be represented by the current allocation matrix. The current demand matrix is obtained by subtracting the current allocation matrix from the maximum demand matrix. The current demand matrix is used to represent the magnitude of the resources still required for each timed execution task to run normally.
[0085] Step S104: Allocate computing resources to each of the task processes based on the available resource vector of the system and the current demand matrix.
[0086] Exemplarily, the available resource vector is used to represent the available resources of the system. For example, it can be (the number of available processor cores, available memory, available disk space). According to the current demand matrix, it can be determined whether the available resources of the system can meet the requirements of each scheduled task, and based on this, computing resources are allocated to the task processes of each scheduled task.
[0087] In some embodiments, allocating computing resources to each of the task processes based on the available resource vector of the system and the current demand matrix includes:
[0088] Calculating the column sum vector of the current demand matrix, and comparing the first component of the column sum vector with the corresponding second component of the available resource vector;
[0089] If each first component of the column sum vector is less than or equal to the corresponding second component of the available resource vector, allocate the available resources of the system to each scheduled task;
[0090] If there is a first component of the column sum vector that is greater than the corresponding second component of the available resource vector, determine the target task from the scheduled tasks, and allocate the available resources of the system to each of the target tasks.
[0091] Exemplarily, since each column of the current demand matrix respectively represents the demand for a type of resource, therefore, summing the items in the same column represents the total demand for this type of resource by multiple scheduled tasks. For example, the total demand for processor cores, the total demand for memory, and the total demand for disk space. Specifically, the column sum vector can be expressed as (A1 + A2 + A3, B1 + B2 + B3, C1 + C2 + C3) = (A total, B total, C total), where A total, B total, and C total are the respective first components in the column sum vector.
[0092] Exemplarily, the available resource vector is used to represent the available values of various resources of the system. The available resource vector can be expressed as (A0, B0, C0),
[0093] Exemplarily, comparing the first component of the column sum vector with the second component of the available resource vector. Specifically, comparing the first item of the column sum vector with the first item of the available resource vector, the second item of the column sum vector with the second item of the available resource vector, and so on. For example, comparing A total with A0, B total with B0, and C total with C0. If each first component of the column sum vector is less than or equal to the corresponding second component of the available resource vector, it means that the available resources of each type in the system can meet the requirements for multiple scheduled tasks to execute simultaneously, then directly allocate the available resources of the system to each scheduled task so that each scheduled task runs simultaneously.
[0094] Conversely, if any first component in the column sum vector is greater than the second component corresponding to the available resource vector, it indicates that a certain available resource of the system is insufficient to meet the requirements for multiple timed tasks to execute simultaneously. Only a part of the target tasks can be determined from the timed tasks first, and the available resource requirements of this part of the target tasks are preferentially met.
[0095] In some embodiments, when there is a first component of the column sum vector greater than the second component corresponding to the available resource vector, determining target tasks from the timed tasks includes:
[0096] If there is a first component of the column sum vector greater than the second component corresponding to the available resource vector, determine the column where the first component is located as the target element in the resource request vector, and the elements in the resource request vector other than the target element are candidate elements;
[0097] Arrange the timed tasks according to the size of the target elements in the resource request vector, where the timed task with a smaller target element is arranged in a more forward position;
[0098] Determine the timed tasks with the first N arrangement positions as the target tasks, where the sum of the target elements of the timed tasks with the first N arrangement positions is less than or equal to the second component corresponding to the available resource vector, and the sum of the candidate elements of the timed tasks with the first N arrangement positions is less than or equal to the second component corresponding to the available resource vector.
[0099] Exemplarily, determine the first component in the column sum vector that is greater than the corresponding second component as the target element. For example, if the required number of processor cores in the column sum vector is greater than the available number of processor cores in the available resource vector, it indicates that the processor core is a limited resource that needs to be reasonably allocated. Then, determine the processor core as the target element, and determine the elements other than the target element as candidate elements.
[0100] Exemplarily, if there are multiple first elements greater than the second element, randomly determine the target element from the multiple first elements greater than the second element. In particular, since the number of processor cores is the most limited resource in the system, assume that the first element includes the required number of processor cores, the required amount of memory, and the required amount of disk space, and the corresponding first elements of all three are greater than the second element. First, determine the required number of processor cores as the target element, and then determine the required amount of memory as the target element. That is, the priority of the first component determined as the target element is processor core > memory > disk space.
[0101] Exemplarily, the timed execution tasks are arranged according to the magnitudes of the target elements in the resource request vector. The timed execution task with the smallest target element is ranked first, and the timed execution task with the largest target element is ranked last. The first N timed execution tasks whose sum of target elements is less than or equal to the second component corresponding to the available resource vector are determined as the target tasks. At the same time, the sum of candidate elements of the first N timed execution tasks should also be less than or equal to the corresponding second component in the available resource vector, ensuring that both the target elements and candidate elements in the system's available resources can meet the requirements of the target tasks.
[0102] Exemplarily, through the reliable configuration method for timed execution tasks provided by the embodiments of the present application, as many timed execution tasks with small requirements for target elements as possible are preferentially determined as target tasks and the target tasks are preferentially executed, so that as many target tasks as possible among the multiple timed execution tasks obtain execution results first, ensuring the reliability of the system task scheduling.
[0103] In some embodiments, determining the timed execution tasks at the first N positions as the target tasks includes:
[0104] Accumulate the target elements and candidate elements of the timed execution tasks at the first N positions to obtain the sum of target elements and the sum of candidate elements;
[0105] Under any of the following conditions, determine the timed execution tasks at the first N positions as the target tasks: the sum of the first N + 1 target elements is greater than or equal to the second component corresponding to the available resource vector, or the sum of the first N + 1 candidate elements is greater than or equal to the second component corresponding to the available resource vector.
[0106] Exemplarily, accumulate the target elements and candidate elements of the first N timed execution tasks in the arrangement order until the accumulated result of the first N + 1 timed execution tasks is greater than the second component corresponding to the target element or candidate element, and determine the first N timed execution tasks as the target tasks.
[0107] In some embodiments, arranging the timed execution tasks according to the magnitudes of the target elements in the resource request vector includes:
[0108] If there are cases where the target elements of the timed execution tasks are equal, arrange the timed execution tasks according to the task execution duration, where the timed execution task with a smaller task execution duration is ranked more forward.
[0109] Exemplarily, if there are two or more timed execution tasks with equal target elements, the timed execution tasks can be arranged according to the magnitudes of the candidate elements, and the timed execution task with the smallest candidate element is ranked first.
[0110] Of course, it is not limited to this. The timed execution tasks can also be arranged according to the task execution duration, and the timed execution task with the minimum task execution duration can be ranked first. The timed execution task with a short task execution duration is preferentially determined as the target task to reduce the waiting time of other tasks.
[0111] Exemplarily, after the target task is executed, the computing resources released by the target task are allocated to the timed execution tasks that do not belong to the target task. Through the reliable configuration method of the timed execution task provided by the embodiments of the present application, the number of target tasks is increased, so that as many target tasks as possible can be preferentially executed, and the waiting time of other timed execution tasks is reduced, improving the efficiency of executing multiple timed execution tasks when system resources are limited.
[0112] Please refer to Figure 2 , Figure 2 FIG. is a schematic diagram of a reliable configuration device for a timed execution task provided by an embodiment of the present application. The reliable configuration device for the timed execution task can be configured in a server or a terminal and is used to execute the reliable configuration method of the timed execution task described above.
[0113] As Figure 2 shown, the reliable configuration device for the timed execution task includes: a requirement acquisition module 110, a matrix splicing module 120, a requirement determination module 130, and a resource allocation module 140.
[0114] The requirement acquisition module 110 is used to acquire the resource request vectors corresponding to the task processes of multiple timed execution tasks;
[0115] The matrix splicing module 120 is used to splice the resource request vectors of each of the task processes to obtain a maximum requirement matrix;
[0116] The requirement determination module 130 is used to determine the current requirement matrix according to the maximum requirement matrix and the current allocation matrix of the system;
[0117] The resource allocation module 140 is used to allocate computing resources to each of the task processes based on the available resource vector of the system and the current requirement matrix.
[0118] Exemplarily, the above method can be implemented in the form of a computer program, and the computer program can run on a computer device as Figure 3 shown.
[0119] Please refer to Figure 3 , Figure 3 which is a schematic block diagram of the structure of a computer device provided by an embodiment of the present application. The computer device can be a server or a terminal.
[0120] AsFigure 3 As shown in the figure, the computer device includes a processor, a memory, and a network interface connected by a system bus. Among them, the memory may include a storage medium and an internal memory.
[0121] The storage medium can store an operating system and computer programs. The computer programs include program instructions, which when executed, can cause the processor to execute any reliable configuration method for timing execution tasks.
[0122] The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
[0123] The internal memory provides an environment for the operation of the computer programs in the storage medium. When the computer programs are executed by the processor, the processor can execute any reliable configuration method for timing execution tasks.
[0124] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that Figure 3 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.
[0125] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0126] Among them, in one embodiment, the processor is used to run the computer programs stored in the memory to implement the following steps:
[0127] Obtain the resource request vectors corresponding to the task processes of multiple timing execution tasks;
[0128] Concatenate the resource request vectors of each of the task processes to obtain a maximum demand matrix;
[0129] Determine the current demand matrix according to the maximum demand matrix and the current allocation matrix of the system;
[0130] Allocate computing resources to each of the task processes based on the available resource vector of the system and the current demand matrix.
[0131] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps:
[0132] Calculate the column sum vector of the current demand matrix, and compare the first component of the column sum vector with the second component corresponding to the available resource vector;
[0133] If each first component of the column sum vector is less than or equal to the second component corresponding to the available resource vector, allocate the available resources of the system to each timed execution task;
[0134] If there exists a first component of the column sum vector that is greater than the second component corresponding to the available resource vector, determine a target task from the timed execution tasks, and allocate the available resources of the system to each of the target tasks.
[0135] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps:
[0136] If there exists a first component of the column sum vector that is greater than the second component corresponding to the available resource vector, determine the column where the first component is located as the target element in the resource request vector, and the elements in the resource request vector other than the target element are candidate elements;
[0137] Arrange the timed execution tasks according to the size of the target elements in the resource request vector, wherein the timed execution task with a smaller target element is arranged in a more forward position;
[0138] Determine the timed execution tasks in the first N positions as the target tasks, wherein the sum of the target elements of the timed execution tasks in the first N positions is less than or equal to the second component corresponding to the available resource vector, and the sum of the candidate elements of the timed execution tasks in the first N positions is less than or equal to the second component corresponding to the available resource vector.
[0139] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps:
[0140] Accumulate the target elements and candidate elements of the timed execution tasks in the first N positions to obtain the sum of the target elements and the sum of the candidate elements;
[0141] When any of the following conditions is met, the timed execution tasks with the top N arrangement positions are determined as the target tasks: the sum of the top N + 1 target elements is greater than or equal to the second component corresponding to the available resource vector, or the sum of the top N + 1 candidate elements is greater than or equal to the second component corresponding to the available resource vector.
[0142] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps:
[0143] If there are timed execution tasks with equal processor core requirements, arrange the timed execution tasks according to the task execution duration, where the timed execution task with a smaller task execution duration has a more forward arrangement position.
[0144] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps:
[0145] Obtain the historical resource requirement data of the timed execution tasks, and determine multiple historical demand time series with different lengths based on the historical resource requirement data;
[0146] Predict the resource requirements according to each of the historical demand time series to obtain at least one demand prediction result;
[0147] Determine the resource request vector according to the demand prediction result.
[0148] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps:
[0149] Determine the minimum value, the maximum value, and the likelihood estimation value in the demand prediction result according to the demand prediction result;
[0150] Based on the following formula, calculate the target value according to the minimum value, the maximum value, and the likelihood estimation value:
[0151] ;
[0152] where Min represents the minimum value, L represents the likelihood estimation value, and Max represents the maximum value, , , respectively represent the first weight, the second weight, and the third weight;
[0153] Use the target value as an item in the resource request vector to obtain the resource request vector.
[0154] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps:
[0155] Calculate according to the following formula , , :
[0156] ;
[0157] ;
[0158] ;
[0159] Wherein, A is a preset value, σ is the standard deviation of the demand prediction result, and μ is the average value of the demand prediction result.
[0160] It should be noted that those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described computer device can refer to the corresponding process in the embodiment of the reliable configuration method for scheduled execution of tasks described above, and will not be elaborated here.
[0161] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. The computer program includes program instructions, and the method implemented when the program instructions are executed can refer to each embodiment of the reliable configuration method for scheduled execution of tasks of the present application.
[0162] Wherein, the computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a SmartMedia Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the computer device.
[0163] It should be understood that the terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of the present application and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms.
[0164] It should also be understood that the term "and / or" used in the specification and appended claims of this application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations. It should be noted that, in this text, the term "comprises", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article or system comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or system. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or system comprising the element.
[0165] The serial numbers of the embodiments of the present application above are for description only and do not represent the superiority or inferiority of the embodiments. The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A reliable configuration method for executing tasks at a scheduled time, characterized in that, The method includes: Obtaining resource request vectors corresponding to task processes of multiple periodically executed tasks; Concatenating the resource request vectors of each of the task processes to obtain a maximum demand matrix; Determining a current demand matrix according to the maximum demand matrix and the current allocation matrix of the system, where the current demand matrix is obtained by subtracting the current allocation matrix from the maximum demand matrix; Allocating computing resources to each of the task processes based on the available resource vector of the system and the current demand matrix; Wherein, the allocating computing resources to each of the task processes based on the available resource vector of the system and the current demand matrix includes: Calculating the column sum vector of the current demand matrix, and comparing the first component of the column sum vector with the second component corresponding to the available resource vector; If each first component of the column sum vector is less than or equal to the second component corresponding to the available resource vector, allocating the available resources of the system to each periodically executed task; If there is a first component of the column sum vector greater than the second component corresponding to the available resource vector, determining target tasks from the periodically executed tasks, and allocating the available resources of the system to each of the target tasks; The determining target tasks from the periodically executed tasks if there is a first component of the column sum vector greater than the second component corresponding to the available resource vector includes: If there is a first component of the column sum vector greater than the second component corresponding to the available resource vector, determining the column where the first component is located as the target element in the resource request vector, and the elements in the resource request vector other than the target element are candidate elements; Arranging the periodically executed tasks according to the magnitudes of the target elements in the resource request vector, wherein the periodically executed task with a smaller target element is arranged in a more forward position; Determining the periodically executed tasks in the first N positions as the target tasks, where the sum of the target elements of the periodically executed tasks in the first N positions is less than or equal to the second component corresponding to the available resource vector, and the sum of the candidate elements of the periodically executed tasks in the first N positions is less than or equal to the second component corresponding to the available resource vector.
2. The reliable configuration method for timing task execution according to claim 1, wherein The determining the periodically executed tasks in the first N positions as the target tasks includes: Accumulating the target elements and candidate elements of the periodically executed tasks in the first N positions to obtain the sum of the target elements and the sum of the candidate elements; Determining the periodically executed tasks in the first N positions as the target tasks when any of the following conditions is satisfied: the sum of the target elements of the first N + 1 positions is greater than or equal to the second component corresponding to the available resource vector, the sum of the candidate elements of the first N + 1 positions is greater than or equal to the second component corresponding to the available resource vector.
3. The reliable configuration method for timed execution of tasks according to claim 1, characterized in that The arranging the periodically executed tasks according to the magnitudes of the target elements in the resource request vector includes: If there are periodically executed tasks with equal target elements, arranging the periodically executed tasks according to the task execution duration, wherein the periodically executed task with a smaller task execution duration is arranged in a more forward position.
4. The reliable configuration method for timing task execution according to claim 1, characterized in that, Obtaining a resource request vector corresponding to a task process for multiple scheduled execution tasks includes: Obtaining historical resource requirement data for the scheduled execution tasks, and determining multiple historical requirement time series with different lengths based on the historical resource requirement data; Predicting the resource requirements according to each of the historical requirement time series to obtain at least one requirement prediction result; Determining the resource request vector according to the requirement prediction result.
5. The reliable configuration method for timed execution of tasks according to claim 4, wherein The determining the resource request vector according to the requirement prediction result includes: Determining the minimum value, the maximum value and the likelihood estimation value in the requirement prediction result according to the requirement prediction result; Calculating a target value based on the following formula according to the minimum value, the maximum value and the likelihood estimation value: where Min represents the minimum value, L represents the likelihood estimation value, Max represents the maximum value, and λ1, λ2, and λ3 respectively represent the first weight, the second weight, and the third weight; Taking the target value as an item in the resource request vector to obtain the resource request vector.
6. The reliable configuration method for timed task execution according to claim 5, characterized in that The method further includes: Calculating λ1, λ2, and λ3 according to the following formula: where A is a preset value, σ is the standard deviation of the requirement prediction result, and μ is the average value of the requirement prediction result.
7. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored on the memory and executable by the processor. When the computer program is executed by the processor, the steps of the reliable configuration method for scheduled execution tasks according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the reliable configuration method for scheduled execution tasks according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Quantitative processing method and device for network service requirements
CN116137630A