Reliable configuration method for regularly executing tasks
By obtaining and splicing resource request vectors for timed execution tasks, and assigning computing resources in combination with system resource situations, the resource shortage caused by timed execution tasks is solved, and the reliability of the system is improved.
Patent Information
- Application Number
- CN202510694143.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-05-28
AI Technical Summary
In distributed computer systems, the concurrent execution of a large number of timely execution of tasks may lead to insufficient system resources, affecting the timeliness of tasks and the reliability of the system.
By obtaining the resource request vectors for multiple timed tasks, splicing them into the maximum demand matrix, and combining the system's current allocation matrix and available resource vectors, the current demand matrix is determined, and then computing resources are allocated for the task process.
This method can complete a large number of timed execution tasks in the shortest possible time, improving the reliability of the computer system when facing a large number of timed execution tasks.
Smart Images

Figure CN120216209A_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: Obtain the resource request vectors corresponding to the task processes of multiple scheduled tasks; Concatenate the resource request vectors of each of the task processes to obtain a maximum demand matrix; Determine the current demand matrix according to the maximum demand matrix and the current allocation matrix of the system; Allocate computing resources to each of the task processes based on the available resource vector of the system and the current demand matrix.
[0005] In some embodiments, 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: 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; 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; If there is a first component of the column sum vector greater than the second component corresponding to the available resource vector, determine the target tasks from the scheduled tasks, and allocate the available resources of the system to each of the target tasks.
[0006] In some embodiments, when there is a first component of the column sum vector greater than the corresponding second component of the available resource vector, determining a target task from the timed execution tasks includes: When there is a first component of the column sum vector greater than the corresponding second component of 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 timed execution tasks according to the size 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; Determining 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 corresponding second component of 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 corresponding second component of the available resource vector.
[0007] In some embodiments, determining the timed execution tasks in the first N positions as the target tasks includes: Accumulating 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; Determining the timed execution tasks in the first N positions as the target tasks when any of the following is satisfied: the sum of the target elements of the first N + 1 positions is greater than or equal to the corresponding second component of the available resource vector, or the sum of the candidate elements of the first N + 1 positions is greater than or equal to the corresponding second component of the available resource vector.
[0008] In some embodiments, arranging the timed execution tasks according to the size of the target elements in the resource request vector includes: When there are equal target elements in the timed execution tasks, arranging 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.
[0009] In some embodiments, obtaining the resource request vector corresponding to the task processes of multiple timed execution tasks includes: Obtaining the historical resource requirement data of the timed execution tasks, and determining multiple historical demand time series with different lengths based on the historical resource requirement data; Predicting the resource requirements according to each historical demand time series to obtain at least one demand prediction result; Determining the resource request vector according to the demand prediction result.
[0010] In some embodiments, determining the resource request vector according to the demand prediction result includes: Determine the minimum value, the maximum value, and the likelihood estimation value in the demand prediction result according to the demand prediction result; Based on the following formula, calculate the target value 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, and Max represents the maximum value, , , respectively represent the first weight, the second weight, and the third weight; Use the target value as an item in the resource request vector to obtain the resource request vector.
[0011] In some embodiments, the method further includes: Calculate according to the following formula , , : ; ; ; 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.
[0012] 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, the reliable configuration method for timed execution tasks as described above is implemented.
[0013] 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, the reliable configuration method for timed execution tasks as described above is implemented.
[0014] The present application provides a reliable configuration method, device, and computer storage medium for scheduling tasks. The present application obtains resource request vectors corresponding to task processes of multiple scheduled tasks; splices the resource request vectors of each of the task processes to obtain a maximum demand matrix; determines a current demand matrix according to the maximum demand matrix and the current allocation matrix of the system; and allocates computing resources to each of the task processes 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, thereby improving the reliability of the computer system in the face of a large number of scheduled tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] To more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the accompanying drawings required for the description of the embodiments. Obviously, the accompanying drawings in the following description are some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on these drawings.
[0016] Figure 1 FIG. is a schematic flowchart of a reliable configuration method for scheduling tasks provided by an embodiment of the present application; Figure 2 FIG. is a schematic block diagram of a system of a reliable configuration method for scheduling tasks provided by an embodiment of the present application; Figure 3 FIG. is a schematic block diagram of the structure of a computer device related to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying 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.
[0018] The flowcharts shown in the accompanying drawings are only illustrative examples and do not necessarily include all the contents and operations / steps, nor do they necessarily need to be executed in the described order. For example, some operations / steps can also be decomposed, combined, or partially merged. Therefore, the actual execution order may change according to the actual situation.
[0019] The embodiments of the present application provide a reliable configuration method, device, and computer storage medium for scheduling tasks.
[0020] 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.
[0021] Please refer to Figure 1 , Figure 1 which is a schematic flowchart of a reliable configuration method for timed execution tasks provided for an embodiment of this application. This reliable configuration method for timed execution tasks 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 timed execution task according to a maximum demand matrix, improving the reliability of the computer system when facing a large number of timed execution tasks. 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), and big data and artificial intelligence platforms.
[0022] As Figure 1 shown, this reliable configuration method for timed execution tasks includes steps S101 to S104.
[0023] Step S101, obtain resource request vectors corresponding to the task processes of multiple timed execution tasks.
[0024] Exemplarily, running the task process of a timed execution task requires certain computer resources, and the execution cycles of different timed execution tasks are different. During the process of a large number of timed execution tasks executing in cycles according to their respective execution cycles, different timed execution tasks may be executed synchronously. And it can be understood that since the execution cycle of the same timed execution task is determined, it is possible to pre-determine which timed execution tasks will be executed synchronously according to the execution cycle. To avoid insufficient resources during the operation of the timed execution task and affect the normal progress of the task process, before running the timed execution task, it is possible to obtain the resource request vectors corresponding to the task processes of the timed execution tasks that will be executed synchronously. Among them, the resource request vector includes the requirements of the timed execution task for various computing resources, such as processor cores, memory, disk space, etc.
[0025] For example, assume that a task process of a certain timed execution task requires 1 processor core, 64 MB of memory, and 512 MB of disk space, then its corresponding resource request vector is (1, 64, 512).
[0026] In some embodiments, the obtaining resource request vectors corresponding to the task processes of multiple timed execution tasks includes: Obtain the historical resource requirement data of the scheduled execution task, and determine multiple historical demand time series of different lengths based on the historical resource requirement data; Predict the resource requirements according to each of the historical demand time series to obtain at least one demand prediction result; Determine the resource request vector according to the demand prediction result.
[0027] Exemplarily, the resource request vector can be set by the developer in advance according to the characteristics of the task. Since the scheduled execution task has the characteristic of periodic execution, it is also possible to predict the magnitudes of the elements in the resource request vector based on a prediction model according to the computing resources consumed by the scheduled execution task in the past. 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 herein.
[0028] It can be understood that the demand prediction result obtained by predicting based on the historical resource requirement data of the past 5 scheduled execution tasks is different from the demand prediction result obtained by predicting based on the historical resource requirement data of the past 10 scheduled execution tasks. The former uses the relatively new historical resource requirement 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 requirement data, and the prediction result may be more accurate. In order to improve the accuracy of the resource request vector, the resource requirements 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 requirement data included in multiple historical demand time series of different lengths can be 50, 51, 52..., and so on, which will not be elaborated herein.
[0029] Specifically, the demand prediction result can respectively include multiple processor core demand prediction results, multiple memory demand prediction results, and multiple disk space demand prediction results of the scheduled execution task, which is not limited herein.
[0030] In some embodiments, the determining the resource request vector according to the demand prediction result includes: Determine the minimum value, the maximum value, and the likelihood estimation value in the demand prediction result according to the demand prediction result; Based on the following formula, calculate the target value 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, and Max represents the maximum value, 、 、 respectively represent the first weight, the second weight, and the third weight; Use the target value as an item in the resource request vector to obtain the resource request vector.
[0031] Exemplarily, determine the minimum value, the maximum value, and the likelihood estimation value in a series of demand prediction results. Here, the likelihood estimation value can be the median, the average, or the mode of the demand prediction results, which is not limited herein. Specifically, determine 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, respectively.
[0032] Exemplarily, calculate the target value for the processor core demand, the memory demand, and the disk space demand respectively, and splice the target values corresponding to the processor core demand, the memory demand, and the disk space demand to obtain the resource request vector.
[0033] 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 needs. 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, increase the value of the first weight; considering the possibility that the target value is on the large side and it is necessary to calculate a relatively large target value, increase the value of the third weight.
[0034] Exemplarily, after calculating the target value, splice the target values 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, arrange the target values in the order of (processor core demand, memory demand, disk space demand) to obtain the resource request vector.
[0035] In some embodiments, the method further includes: Calculate according to the following formula 、 、 : ; ; ; 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.
[0036] Exemplarily, A is a preset value, and it can be understood that the value of A is related to The values are equal, and the magnitude 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 magnitude 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 magnitude of the likelihood estimation value when calculating the target value.
[0037] 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 directly proportional to the magnitude of σ / μ. It can be understood that in the case of greater fluctuation of the demand prediction result, it indicates that the likelihood estimation value is less accurate, and the weight of the likelihood estimation value is reduced; conversely, in the case of smaller fluctuation of the demand prediction result, it indicates that the likelihood estimation value is more accurate, and the weight of the likelihood estimation value is increased.
[0038] 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.
[0039] Step S102: Concatenate the resource request vectors of each of the task processes to obtain a maximum demand matrix.
[0040] 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:
[0041] Step S103: Determine the current demand matrix according to the maximum demand matrix and the current allocation matrix of the system.
[0042] Exemplarily, each timed execution task has not officially started execution yet, 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 still 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, and the current demand matrix is used to represent the magnitude of the resources still required for each timed execution task to run normally.
[0043] 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.
[0044] Exemplarily, the available resource vector is used to represent various 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.
[0045] 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: Calculate the column sum vector of the current demand matrix, and compare the first component of the column sum vector with the corresponding second component of the available resource vector; 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; If there is a first component of the column sum vector 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.
[0046] 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 of multiple scheduled tasks for this type of demand, such as 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 respectively the first components in the column sum vector.
[0047] 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), Exemplarily, compare the first component of the column sum vector with the second component of the available resource vector. Specifically, compare 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, compare A total with A0, compare B total with B0, and compare 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 various available resources 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 to make each scheduled task run simultaneously.
[0048] 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 the available resources of a certain item in the system are insufficient to meet the requirements for multiple timed execution tasks to execute simultaneously. Only a part of the target tasks can be determined from the timed execution tasks first, and the available resource requirements of this part of the target tasks are preferentially met.
[0049] In some embodiments, determining the target tasks from the timed execution tasks when 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, 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; Arrange the timed execution tasks according to the size 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; 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.
[0050] 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 number of processor cores required in the column sum vector is greater than the number of available processor cores in the available resource vector, it indicates that the processor cores are limited resources that need to be reasonably allocated. Then, determine the processor cores as the target elements and the elements other than the target elements as candidate elements.
[0051] 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 number of processor cores required, the memory requirement, and the disk space requirement, and the corresponding first elements of all three are greater than the second element. First, determine the number of processor cores required as the target element, and then determine the memory requirement as the target element. That is, the priority of the first component determined as the target element is processor core > memory > disk space.
[0052] Exemplarily, the scheduled execution tasks are arranged according to the size of the target elements in the resource request vector, with the scheduled execution task with the smallest target element ranked first and the scheduled execution task with the largest target element ranked last, and the first N scheduled 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 target tasks. At the same time, the first N scheduled execution tasks should also satisfy that the sum of candidate elements is also less than or equal to the corresponding second component in the available resource vector, ensuring that both the target elements and the candidate elements in the system's available resources can meet the needs of the target tasks.
[0053] Illustratively, through the reliable configuration method for scheduled execution tasks provided in the embodiments of the present application, as many scheduled execution tasks as possible with small requirements for target elements are preferentially determined as target tasks and the target tasks are preferentially executed, so that as many target tasks as possible among multiple scheduled execution tasks obtain execution results first, thereby ensuring the reliability of system task scheduling.
[0054] In some embodiments, determining the scheduled execution tasks arranged in the first N positions as the target tasks includes: Accumulate the target elements and candidate elements of the scheduled execution tasks that are arranged in the first N positions to obtain the sum of the target elements and the sum of the candidate elements; If any one of the following conditions is met, the scheduled execution task with the first N positions will be determined as the target task: the sum of the first N+1 target elements is greater than or equal to the second component corresponding to the available resource vector, and the sum of the first N+1 candidate elements is greater than or equal to the second component corresponding to the available resource vector.
[0055] Exemplarily, the target elements and candidate elements of the first N scheduled execution tasks in the arrangement order are accumulated until the accumulated result of the first N+1 scheduled execution tasks is greater than the second component corresponding to the target element or candidate element, and the first N scheduled execution tasks are determined as target tasks.
[0056] In some embodiments, the arranging the scheduled execution tasks according to the size of the target element in the resource request vector includes: If there are scheduled tasks with the same target elements, the scheduled tasks are arranged according to the task execution durations, wherein the scheduled tasks with shorter task execution durations are arranged at the front.
[0057] For example, if two or more scheduled execution tasks have the same target element, the scheduled execution tasks may be arranged according to the size of the candidate element, and the scheduled execution task with the smallest candidate element is arranged first.
[0058] Of course, it is not limited to this. The timed execution tasks can also be arranged according to the task execution duration, with the timed execution task having the minimum task execution duration ranked first. The timed execution task with a short task execution duration is preferentially determined as the target task, reducing the waiting time of other tasks.
[0059] 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.
[0060] Please refer to Figure 2 , Figure 2 which 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.
[0061] 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.
[0062] The requirement acquisition module 110 is used to acquire the resource request vectors corresponding to the task processes of multiple timed execution tasks; 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; 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; 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.
[0063] 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.
[0064] 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.
[0065] As Figure 3As shown, the computer device includes a processor, a memory, and a network interface connected via a system bus. Among them, the memory may include a storage medium and an internal memory.
[0066] The storage medium can store an operating system and computer programs. The computer programs include program instructions that, when executed, enable the processor to execute any reliable configuration method for timed tasks.
[0067] The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
[0068] 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 timed tasks.
[0069] 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 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.
[0070] 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.
[0071] Among them, in one embodiment, the processor is used to run the computer programs stored in the memory to implement the following steps: Obtain the resource request vectors corresponding to the task processes of multiple timed tasks; Concatenate the resource request vectors of each task process to obtain the maximum demand matrix; Determine the current demand matrix according to the maximum demand matrix and the current allocation matrix of the system; Allocate computing resources for each of the task processes based on the available resource vector of the system and the current demand matrix.
[0072] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps: 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; 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 of the timed execution tasks; 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.
[0073] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps: 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; Arrange the timed execution tasks according to the size 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; 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.
[0074] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps: 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; Under any of the following conditions, determine the timed execution tasks in the first N positions as the target tasks: 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.
[0075] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps: When the processor core requirements for the timed tasks are equal, the timed tasks are arranged according to the task execution duration, where the timed task with a smaller task execution duration is arranged in a more forward position.
[0076] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps: Obtain historical resource requirement data of the timed task, and determine multiple historical demand time series of different lengths based on the historical resource requirement data; Predict the resource requirements according to each of the historical demand time series to obtain at least one demand prediction result; Determine the resource request vector according to the demand prediction result.
[0077] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps: Determine the minimum value, the maximum value, and the likelihood estimation value in the demand prediction result according to the demand prediction result; Based on the following formula, calculate the target value 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, and Max represents the maximum value, , , respectively represent the first weight, the second weight, and the third weight; Use the target value as an item in the resource request vector to obtain the resource request vector.
[0078] In one embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps: Calculate according to the following formula , , : ; ; ; 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.
[0079] It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process of the above-described computer device can refer to the corresponding process in the foregoing embodiments of the reliable configuration method for scheduled tasks, and will not be elaborated herein.
[0080] An embodiment of the present application further 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 the various embodiments of the reliable configuration method for scheduled tasks of the present application.
[0081] Among them, the computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, 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 Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the computer device.
[0082] 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.
[0083] It should also be understood that the term "and / or" used in the specification of the present application and the appended claims 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 article, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including 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 "including a..." does not exclude the existence of additional identical elements in the process, method, article or system including the element.
[0084] The serial numbers of the embodiments of the present application above are only for description and do not represent the superiority or inferiority of the embodiments. As described above, 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 timed task execution, 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; Allocating computing resources to each of the task processes based on the available resource vector of the system and the current demand matrix.
2. The reliable configuration method for timed task execution according to claim 1, 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 of 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, determining target tasks from the periodically executed tasks, and allocating the available resources of the system to each of the target tasks.
3. The reliable configuration method for timing task execution according to claim 2, characterized in that 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 as 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, wherein 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.
4. The reliable configuration method for timed execution of tasks according to claim 3, 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.
5. The reliable configuration method for timed task execution according to claim 3, 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 durations, wherein the periodically executed task with a smaller task execution duration is arranged in a more forward position.
6. The reliable configuration method for timing task execution according to claim 1, wherein The obtaining resource request vectors corresponding to task processes of multiple periodically executed tasks includes: 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; Predict the resource requirements according to each of the historical demand time series to obtain at least one demand prediction result; Determine the resource request vector according to the demand prediction result.
7. The reliable configuration method for timing task execution according to claim 6, wherein The determining the resource request vector according to the demand prediction result includes: Determine the minimum value, the maximum value and the likelihood estimation value in the demand prediction result according to the demand prediction result; Based on the following formula, calculate the target value according to the minimum value, the maximum value and the likelihood estimation value: ; Wherein, 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. Use the target value as an item in the resource request vector to obtain the resource request vector.
8. The reliable configuration method for timed task execution according to claim 7, characterized in that, The method further includes: Calculate according to the following formula , , : ; ; ; 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.
9. 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 the scheduled execution task according to any one of claims 1 to 8 are implemented.
10. 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 the scheduled execution task according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Task resource dynamic allocation method and system
CN110968425A
Large-scale resource rapid allocation device based on improved branch limit method
CN112256427A
Resource allocation method and device, computer device and storage medium
CN112698943A
Quantitative processing method and device for network service requirements
CN116137630A
Deterministic network time delay scheduling method and device based on TSN and storage medium
CN119652840A