Task Scheduling Method and Device Based on Resource Prediction Model

Through the task scheduling method based on the resource prediction model, the problem of inaccurate resource occupation prediction in task scheduling is solved, and more efficient task scheduling is achieved.

CN114416313BActive Publication Date: 2025-06-13TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210009635.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-05
Publication Date
2025-06-13
Estimated Expiration
2042-01-05

AI Technical Summary

Technical Problem

During the task scheduling process, the resource occupation prediction is not accurate enough, resulting in inefficient task scheduling.

Method used

The task scheduling method based on the resource prediction model is adopted. By obtaining the task scheduling historical information and resource occupation status information, the target training sample set is determined, and the resource prediction model is trained to obtain the predicted resource occupation status.

Benefits of technology

It improves the accuracy of resource occupancy prediction of task scheduling and enhances the efficiency of task scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114416313B_ABST
    Figure CN114416313B_ABST
Patent Text Reader

Abstract

This application discloses a task scheduling method and device based on a resource prediction model. Among them, the method includes: obtaining first task scheduling historical information and first resource occupancy status information, determining a target training sample set according to the first task scheduling historical information and the first resource occupancy status information, each training sample including scheduling characteristics and resource occupancy status labels of a task at a time period in a historical cycle, scheduling characteristics and resource occupancy status labels of the parent task of a task at the previous time period in a historical cycle, and scheduling characteristics and resource occupancy status labels of the child task of a task at the next time period in a previous historical cycle of a historical cycle, and training the resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model. This application solves the technical problem of inaccurate prediction of resource occupancy in task scheduling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular, to a task scheduling method and device based on a resource prediction model. Background Art

[0002] Currently, for the resource occupancy prediction of task scheduling, the resource occupancy of each task is mainly predicted separately using past historical data.

[0003] However, during the task scheduling process, since there are tasks that are dependent on each other up and down, that is, the operation of the current task is affected by the operation of the previous task, and the operation state (set start time, etc.) of the next task also affects the resource occupancy of the current task. Since the current task can only be started after the previous task is completed during the task scheduling process, and the operation of the current task in turn affects the task scheduling of the next period. Therefore, there is a technical problem in the related art that the resource occupancy prediction of task scheduling is not accurate enough.

[0004] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention

[0005] Embodiments of the present application provide a task scheduling method and device based on a resource prediction model to at least solve the technical problem that the resource occupancy prediction of task scheduling is not accurate enough.

[0006] According to one aspect of the embodiments of the present application, a task scheduling method based on a resource prediction model is provided, including: obtaining first task scheduling historical information and first resource occupancy status information, where the first task scheduling historical information includes scheduling characteristics of tasks scheduled in N historical periods, each historical period includes multiple time periods, N is an integer greater than or equal to 1, the first resource occupancy status information includes resource occupancy status labels of the scheduled tasks, and the resource occupancy status labels are used to represent the resource occupancy status of the scheduled tasks; determining a target training sample set according to the first task scheduling historical information and the first resource occupancy status information, where each training sample in the target training sample set includes the scheduling characteristics and resource occupancy status labels of a task in a time period of a historical period, the scheduling characteristics and resource occupancy status labels of the parent task of the task in the previous time period of the time period of the historical period, and the scheduling characteristics and resource occupancy status labels of the child task of the task in the next time period of the time period of the previous historical period among the N historical periods, the N historical periods include the historical period and the previous historical period, and the scheduled tasks include the task, the parent task, and the child task; training a resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model, where the resource prediction model to be trained is used to determine the predicted resource occupancy status in each of the multiple time periods according to each training sample in the target training sample set.

[0007] According to another aspect of the embodiments of the present application, a task scheduling device based on a resource prediction model is further provided, including:

[0008] An obtaining module, configured to obtain first task scheduling historical information and first resource occupancy status information, where the first task scheduling historical information includes scheduling characteristics of tasks scheduled in N historical periods, each historical period includes multiple time periods, N is an integer greater than or equal to 1, the first resource occupancy status information includes resource occupancy status labels of the scheduled tasks, and the resource occupancy status labels are used to represent the resource occupancy status of the scheduled tasks;

[0009] A determination module, configured to determine a target training sample set according to the first task scheduling historical information and the first resource occupancy status information, wherein each training sample in the target training sample set includes scheduling features and resource occupancy status labels of a task in a time period of a historical cycle, scheduling features and resource occupancy status labels of the parent task of the task in the previous time period of the time period in the historical cycle, and scheduling features and resource occupancy status labels of the child task of the task in the next time period of the time period in the previous historical cycle of the historical cycle, the N historical cycles include the historical cycle and the previous historical cycle, and the scheduled tasks include the task, the parent task, and the child task;

[0010] A training module, configured to train a resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model, wherein the resource prediction model to be trained is used to determine the predicted resource occupancy status of each of the multiple time periods according to each training sample in the target training sample set.

[0011] Optionally, the device is configured to train a resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model in the following manner: sequentially input each training sample in the target training sample set into the resource prediction model to be trained until the loss value between the predicted resource occupancy status at each of the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each of the multiple time periods meets a preset loss condition. Wherein, when the loss value between the predicted resource occupancy status at each of the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each of the multiple time periods does not meet the preset loss condition, the parameters in the resource prediction model to be trained are adjusted. The actual resource occupancy status at each of the multiple time periods is the resource occupancy status determined according to the scheduling characteristics and resource occupancy status labels of the one task in the one time period of the one historical cycle in each training sample. Wherein, the resource prediction model to be trained is configured to determine the predicted resource occupancy status of the one task in the one time period of the one historical cycle according to the scheduling characteristics and resource occupancy status labels of the parent task of the one task in the previous time period of the one time period in the one historical cycle and the scheduling characteristics and resource occupancy status labels of the child task of the one task in the next time period of the one time period in the previous historical cycle, and determine the predicted resource occupancy status at each of the multiple time periods according to the predicted resource occupancy status of the tasks at each of the multiple time periods determined.

[0012] Optionally, the device is configured to sequentially input each training sample in the target training sample set into the resource prediction model to be trained until the loss value between the predicted resource occupancy status at each time period among the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each time period among the multiple time periods meets a preset loss condition: repeat the following steps until the loss value between the predicted resource occupancy status at each time period among the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each time period among the multiple time periods meets the preset loss condition: select a current training sample from the target training sample set and input the current training sample into the BERT model to be trained, where the resource prediction model to be trained is the BERT model to be trained; in the BERT model to be trained, determine the predicted resource occupancy status of the one task at the one time period in the one historical period according to the scheduling feature and resource occupancy status label of the parent task of the one task at the previous time period of the one time period in the one historical period and the scheduling feature and resource occupancy status label of the sub-task of the one task at the next time period of the one time period in the previous historical period of the one historical period, and determine the predicted resource occupancy status at each time period among the multiple time periods according to the predicted resource occupancy status of the tasks at each time period among the determined multiple time periods; determine whether the loss value between the predicted resource occupancy status at each time period among the multiple time periods and the actual resource occupancy status at each time period among the multiple time periods meets the preset loss condition; in the case where the loss value between the predicted resource occupancy status at each time period among the multiple time periods output by the BERT model to be trained and the actual resource occupancy status at each time period among the multiple time periods does not meet the preset loss condition, adjust the parameters in the BERT model to be trained.

[0013] Optionally, the device is further configured to: after training a resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model, acquire a target task set scheduled in a target future period and a set of scheduled time periods, where each scheduled time period in the set of scheduled time periods is a scheduling time period of a task in the target task set in the target future period; acquire the predicted resource occupancy status at each target scheduling time period in the target scheduling time period set, and acquire the average number of scheduled tasks at the target scheduling time period, where the predicted resource occupancy status at each target scheduling time period is a resource occupancy status determined according to the target resource prediction model; and adjust the number of tasks scheduled at each scheduled time period in the target future period according to the set of scheduled time periods, the predicted resource occupancy status at each target scheduling time period, and the average number of scheduled tasks.

[0014] Optionally, the device is further configured to: acquire second task scheduling historical information and second resource occupancy status information, where the second task scheduling historical information includes scheduling characteristics of tasks scheduled in M historical periods before the target future period, each of the M historical periods includes the plurality of time periods, M is an integer greater than or equal to 1, and the second resource occupancy status information includes resource occupancy status labels of tasks scheduled in the M historical periods; determine a target test sample set according to the second task scheduling historical information and the second resource occupancy status information, where each test sample in the target test sample set includes scheduling characteristics and resource occupancy status labels of a task in a time period in a historical period, scheduling characteristics and resource occupancy status labels of the parent task of the task in the previous time period in the historical period, and scheduling characteristics and resource occupancy status labels of the child task of the task in the next time period in the previous historical period of the historical period, the M historical periods include the historical period and the previous historical period, and the scheduled tasks include the task, the parent task, and the child task; input the target test sample set into the target resource prediction model to obtain the predicted resource occupancy status at each of the plurality of time periods, where the target resource prediction model is configured to determine the predicted resource occupancy status at each of the plurality of time periods according to each test sample in the target test sample set, the target scheduling time period set is the plurality of time periods, and the predicted resource occupancy status at each target scheduling time period in the target scheduling time period set is the predicted resource occupancy status at each of the plurality of time periods.

[0015] Optionally, the device is configured to input the target test sample set into the target resource prediction model in the following manner to obtain the predicted resource occupancy status for each time period among the multiple time periods: sequentially input each test sample in the target test sample set into the target resource prediction model; in the target resource prediction model, based on the scheduling characteristics and resource occupancy status labels of the parent task of the one task in the previous time period of the one time period in the one historical cycle and the scheduling characteristics and resource occupancy status labels of the sub - tasks of the one task in the next time period of the one time period in the previous historical cycle of the one historical cycle, determine the predicted resource occupancy status of the one task in the one time period in the one historical cycle, and based on the predicted resource occupancy status of the tasks in each time period among the determined multiple time periods, determine the predicted resource occupancy status for each time period among the multiple time periods.

[0016] Optionally, the device is configured to obtain the average number of scheduled tasks in the target scheduling time period in the following manner: when the target scheduling time period set is the multiple time periods and the multiple time periods are P time periods, obtain the total number of tasks scheduled in 1 historical cycle before the target future cycle, where P is an integer greater than or equal to 2; determine the average number of scheduled tasks to be equal to the value obtained by dividing the total number by P; or when the target scheduling time period set is the multiple time periods and the multiple time periods are P time periods, obtain the total number of tasks scheduled in each of the Q historical cycles before the target future cycle, obtaining Q total numbers, where P is an integer greater than or equal to 2 and Q is an integer greater than or equal to 2; divide each of the Q total numbers by P to obtain Q values; determine the average number of scheduled tasks to be equal to the average of the Q values, or equal to the weighted sum of the Q values.

[0017] Optionally, the device is configured to adjust the number of tasks scheduled in advance for each scheduled reservation period in the target future period according to the set of scheduled reservation periods, the predicted resource occupancy status for each target scheduling period, and the average number of scheduling tasks, in the following manner: for each scheduled reservation period in the set of scheduled reservation periods, perform the following operations, where when performing the following operations, each scheduled reservation period is the current scheduled reservation period: obtain the number of tasks scheduled in advance for the current scheduled reservation period in the target task set; when the number of tasks scheduled in advance is less than or equal to the average number of scheduling tasks, keep the number of tasks scheduled in advance for the current scheduled reservation period unchanged; when the number of tasks scheduled in advance is greater than the average number of scheduling tasks, determine a target number of tasks among the tasks scheduled in advance for the current scheduled reservation period, where the target number is equal to the difference between the number of tasks scheduled in advance and the average number of scheduling tasks; according to the predicted resource occupancy status for the target scheduling period after the current scheduled reservation period, adjust the scheduled reservation period for the target number of tasks to one or more scheduled reservation periods after the current scheduled reservation period.

[0018] Optionally, the device is used to adjust the reservation scheduling period of the target number of tasks to one or more reservation scheduling periods after the current reservation scheduling period according to the predicted resource occupancy status on the target scheduling period after the current reservation scheduling period in the following manner: find the first reservation scheduling period that meets the first preset condition after the current reservation scheduling period, where the first preset condition includes: the predicted resource occupancy status on the target scheduling period that is the same as the first reservation scheduling period indicates that the predicted resource utilization rate on the target scheduling period is less than a preset threshold, and the sum of the number of tasks scheduled for reservation on the first reservation scheduling period and the target number is less than or equal to the average number of scheduled tasks; in the case where the first reservation scheduling period that meets the first preset condition is found, adjust the reservation scheduling period of the target number of tasks to the first reservation scheduling period that meets the first preset condition; or find the first set of reservation scheduling periods that meet the second preset condition after the current reservation scheduling period, where the second preset condition includes: the predicted resource occupancy status on the target scheduling period that is the same as each reservation scheduling period in the first set of reservation scheduling periods indicates that the predicted resource utilization rate on the target scheduling period is less than a preset threshold, the number of tasks scheduled for reservation on each reservation scheduling period in the first set of reservation scheduling periods is less than the average number of scheduled tasks, and the sum of the differences between the number of tasks scheduled for reservation on each reservation scheduling period and the average number of scheduled tasks is greater than or equal to the target number; in the case where the first set of reservation scheduling periods that meet the second preset condition is found, adjust the reservation scheduling period of each task in the target number of tasks to the corresponding reservation scheduling period in the first set of reservation scheduling periods, where the number of tasks scheduled for reservation on each reservation scheduling period in the first set of reservation scheduling periods after adjustment is less than or equal to the average number of scheduled tasks.

[0019] Optionally, the device is further used to: after adjusting the number of tasks scheduled for reservation on each reservation scheduling period in the target future period, detect whether all the tasks scheduled for reservation on the current reservation scheduling period in the target future period have been completed; in the case where it is detected that all the tasks scheduled for reservation on the current reservation scheduling period have been completed and there are still remaining resources on the current reservation scheduling period, determine one or more tasks from the tasks scheduled for reservation on the reservation scheduling periods after the current reservation scheduling period; schedule the one or more tasks on the current reservation scheduling period.

[0020] Optionally, the device is configured to determine one or more tasks from the tasks scheduled in the scheduling period after the current scheduled period by: finding the first scheduled period after the current scheduled period that meets the third preset condition, where the third preset condition includes: the predicted resource occupancy status on the target scheduling period that is the same as the first scheduled period indicates that the predicted resource utilization rate on the target scheduling period is greater than or equal to a preset threshold; in the case where the first scheduled period that meets the third preset condition is found, determine the one or more tasks in the first scheduled period that meets the third preset condition.

[0021] Optionally, the device is further configured to: after adjusting the number of tasks scheduled in each scheduling period in the target future period, detect, in the current scheduling period in the target future period, whether the resources in the current scheduling period are less than the resources required for the tasks scheduled in the current scheduling period to run; when it is detected that the resources in the current scheduling period are less than the resources required for the tasks scheduled in the current scheduling period to run, determine one or more tasks from the tasks scheduled in the current scheduling period; and adjust the scheduling period of the one or more tasks from the current scheduling period to the scheduling period after the current scheduling period.

[0022] Optionally, the device is configured to adjust the scheduling period of the one or more tasks from the current scheduling period to the scheduling period after the current scheduling period by: finding the first scheduling period after the current scheduling period that meets the fourth preset condition, where the fourth preset condition includes: the predicted resource occupancy status on the target scheduling period that is the same as the first scheduling period indicates that the predicted resource utilization rate on the target scheduling period is less than a preset threshold; in the case where the first scheduling period that meets the fourth preset condition is found, adjust the scheduling period of the one or more tasks from the current scheduling period to the first scheduling period that meets the fourth preset condition.

[0023] According to another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium storing a computer program, where the computer program is configured to execute the above task scheduling method based on a resource prediction model when running.

[0024] According to another aspect of the embodiments of the present application, a computer program product or a computer program is provided. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the task scheduling method based on the resource prediction model as described above.

[0025] According to another aspect of the embodiments of the present application, an electronic device is further provided, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to execute the above-mentioned task scheduling method based on the resource prediction model through the computer program.

[0026] In the embodiments of the present application, first task scheduling historical information and first resource occupancy status information are obtained. The first task scheduling historical information includes the scheduling characteristics of the tasks scheduled in N historical periods, each historical period includes multiple time periods, and N is an integer greater than or equal to 1. The first resource occupancy status information includes the resource occupancy status labels of the scheduled tasks, and the resource occupancy status labels are used to represent the resource occupancy status of the scheduled tasks. According to the first task scheduling historical information and the first resource occupancy status information, a target training sample set is determined. Each training sample in the target training sample set includes the scheduling characteristics and resource occupancy status labels of a task in a time period of a historical period, the scheduling characteristics and resource occupancy status labels of the parent task of a task in the previous time period of a historical period, and the scheduling characteristics and resource occupancy status labels of the child task of a task in the next time period of a historical period in the previous historical period. The N historical periods include a historical period and the previous historical period. The scheduled tasks include a task, a parent task, and a child task. According to the target training sample set, the resource prediction model to be trained is trained to obtain a target resource prediction model. The resource prediction model to be trained is used to determine the predicted resource occupancy status of each time period in multiple time periods according to each training sample in the target training sample set. By using tasks with an upper and lower dependency relationship for resource occupancy status prediction, according to the time sequence characteristics and labels of the scheduled tasks, the purpose of being able to determine the resource occupancy prediction status of tasks with an upper and lower dependency relationship in multiple time periods is achieved, thereby realizing the technical effect of improving the accuracy of resource occupancy prediction for task scheduling, and further solving the technical problem of inaccurate resource occupancy prediction for task scheduling. Description of the Drawings

[0027] The accompanying drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:

[0028] Figure 1 is a schematic diagram of an application environment of an optional task scheduling method based on a resource prediction model according to an embodiment of the present application;

[0029] Figure 2 is a schematic flowchart of an optional task scheduling method based on a resource prediction model according to an embodiment of the present application;

[0030] Figure 3 is an optional structural schematic diagram of a distributed system 100 applied to a blockchain system provided by an embodiment of the present application;

[0031] Figure 4 is an optional schematic diagram of a block structure provided by an embodiment of the present application;

[0032] Figure 5 is a schematic diagram of another optional task scheduling method based on a resource prediction model according to an embodiment of the present application;

[0033] Figure 6 is a schematic diagram of another optional task scheduling method based on a resource prediction model according to an embodiment of the present application;

[0034] Figure 7 is a schematic diagram of another optional task scheduling method based on a resource prediction model according to an embodiment of the present application;

[0035] Figure 8 is a schematic diagram of another optional task scheduling method based on a resource prediction model according to an embodiment of the present application;

[0036] Figure 9 is a structural schematic diagram of an optional task scheduling device based on a resource prediction model according to an embodiment of the present application;

[0037] Figure 10 is a structural schematic diagram of an optional task scheduling product based on a resource prediction model according to an embodiment of the present application;

[0038] Figure 11 is a structural schematic diagram of an optional electronic device according to an embodiment of the present application. Detailed implementation manners

[0039] To enable those skilled in the art to better understand the solution of this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of this application. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.

[0040] It should be noted that the terms "first", "second", etc. in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances, so that the embodiments of this application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products, or devices.

[0041] First, some nouns or terms that appear during the description of the embodiments of this application are applicable to the following explanations:

[0042] Task scheduling: The process in which the system automatically executes a specific task at a pre-agreed specific moment in order to automatically complete a specific task. Through task scheduling, more manpower can be liberated and the system can automatically execute tasks.

[0043] Recurrent neural network (RNN): A class of recursive neural networks that take sequence data as input, perform recursion in the evolution direction of the sequence, and all nodes (recurrent units) are connected in a chain. Its purpose is to process time series data.

[0044] BERT algorithm: That is, the Encoder of the bidirectional Transformer. The model mainly uses two methods, Masked LM and NextSentence Prediction, to capture the representations at the word and sentence levels respectively, and uses P(w i |w 1 ,..., w i-1 , w i+1 ,..., w n ) as the objective function to train the LM.

[0045] Up and down dependencies: The tasks in the current cycle depend on the completion status of the tasks in the previous cycle, and the completion status of the tasks in the current cycle also affects the start time of the tasks in the next cycle.

[0046] Activation function: A function that defines the output of the current node under a given input or set of inputs, such as a logical function or an arctangent function.

[0047] Sigmoid function: An S-shaped function commonly found in biology, also known as an S-shaped growth curve. In information science, due to its properties such as monotonic increase and monotonic increase of the inverse function, the Sigmoid function is often used as the activation function of neural networks, mapping variables between 0 and 1. Common examples include the logistic regression function.

[0048] The present application will be described below in conjunction with embodiments:

[0049] According to one aspect of the embodiments of the present application, a task scheduling method based on a resource prediction model is provided. Optionally, in this embodiment, the above-mentioned task scheduling method based on a resource prediction model can be applied to, for example, Figure 1 the hardware environment composed of the server 101 and the terminal device 103 as shown. As Figure 1 shown, the server 101 is connected to the terminal 103 through a network and can be used to provide services for the terminal device or the application installed on the terminal device. The application can be a video application, an instant messaging application, a browser application, an educational application, a game application, etc. A database 105 can be set on the server or independently of the server to provide data storage services for the server 101. For example, a game data storage server. The above-mentioned network can include, but is not limited to: wired networks, wireless networks. Among them, the wired network includes: local area networks, metropolitan area networks, and wide area networks. The wireless network includes: Bluetooth, WIFI, and other networks that implement wireless communication. The terminal device 103 can be a terminal configured with an application and can include, but is not limited to, at least one of the following: mobile phones (such as Android mobile phones, iOS mobile phones, etc.), laptop computers, tablet computers, handheld computers, MIDs (Mobile Internet Devices), PADs, desktop computers, smart TVs, and other computer devices. The above-mentioned server can be a single server, a server cluster composed of multiple servers, or a cloud server.

[0050] Combined with Figure 1 shown, the above-mentioned task scheduling method based on a resource prediction model can be implemented through the following steps:

[0051] S1. Obtain the first task scheduling historical information and the first resource occupancy status information of the application 107 on the terminal device 103 on the server 101. The first task scheduling historical information includes the scheduling characteristics of the tasks scheduled in N historical periods. Each historical period includes multiple time slots, where N is an integer greater than or equal to 1. The first resource occupancy status information includes the resource occupancy status labels of the scheduled tasks, and the resource occupancy status labels are used to represent the resource occupancy status of the scheduled tasks;

[0052] S2. On the server 101, determine a target training sample set according to the first task scheduling historical information and the first resource occupancy status information. Each training sample in the target training sample set includes the scheduling characteristics and resource occupancy status labels of a task in a time slot of a historical period, the scheduling characteristics and resource occupancy status labels of the parent task of a task in the previous time slot of a historical period, and the scheduling characteristics and resource occupancy status labels of the child task of a task in the next time slot of a historical period in the previous historical period. The N historical periods include a historical period and the previous historical period. The scheduled tasks include a task, a parent task, and a child task;

[0053] S3. On the server 101, train the resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model. The resource prediction model to be trained is used to determine the predicted resource occupancy status in each of the multiple time slots according to each training sample in the target training sample set.

[0054] Optionally, in this embodiment, the above task scheduling method based on the resource prediction model can also be implemented by the terminal device. For example, Figure 1 it can be implemented in the terminal device 103 shown; or jointly implemented by the terminal device and the server.

[0055] The above is only an example, and this embodiment does not make specific limitations.

[0056] Optionally, as an alternative implementation manner, as Figure 2 shown, the above task scheduling method based on the resource prediction model includes:

[0057] S202. Obtain the first task scheduling historical information and the first resource occupancy status information. The first task scheduling historical information includes the scheduling characteristics of the tasks scheduled in N historical periods. Each historical period includes multiple time slots, where N is an integer greater than or equal to 1. The first resource occupancy status information includes the resource occupancy status labels of the scheduled tasks, and the resource occupancy status labels are used to represent the resource occupancy status of the scheduled tasks;

[0058] S204. Determine a target training sample set according to the first task scheduling historical information and the first resource occupancy status information. Each training sample in the target training sample set includes the scheduling characteristics and resource occupancy status label of a task in a time period of a historical cycle, the scheduling characteristics and resource occupancy status label of the parent task of a task in the previous time period of a time period in a historical cycle, and the scheduling characteristics and resource occupancy status label of the child task of a task in the next time period of a time period in the previous historical cycle. The N historical cycles include a historical cycle and the previous historical cycle. The tasks to be scheduled include a task, a parent task, and a child task;

[0059] S206. Train the resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model. The resource prediction model to be trained is used to determine the predicted resource occupancy status in each of multiple time periods according to each training sample in the target training sample set.

[0060] Optionally, in this embodiment, the above task scheduling method based on a resource prediction model can be implemented based on a distributed system.

[0061] For example, the system involved in the embodiments of the present application may be a distributed system formed by connecting a client and multiple nodes (any form of computing device accessing the network, such as a server, a user terminal) through network communication.

[0062] Taking the distributed system as a blockchain system as an example, see Figure 3 , Figure 3 FIG. is an optional structural schematic diagram of the distributed system 100 provided by the embodiments of the present application applied to a blockchain system, formed by multiple nodes 200 (any form of computing device accessing the network, such as a server, a user terminal) and a client 300. A peer-to-peer (P2P) network is formed between the nodes. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). In a distributed system, any machine such as a server or a terminal can join and become a node. A node includes a hardware layer, a middle layer, an operating system layer, and an application layer.

[0063] See Figure 3 The functions of each node in the blockchain system shown involve the following functions:

[0064] 1) Routing, which is a basic function of a node and is used to support communication between nodes.

[0065] In addition to the routing function, a node may also have the following functions:

[0066] 2) An application, which is used to be deployed in a blockchain, implements specific services according to actual business requirements, records data related to the implemented functions to form recorded data, carries a digital signature in the recorded data to indicate the source of the task data, and sends the recorded data to other nodes in the blockchain system. When other nodes verify the source and integrity of the recorded data successfully, they add the recorded data to a temporary block.

[0067] For example, the services implemented by the application include:

[0068] 2.1) A wallet, which is used to provide the function of conducting electronic currency transactions, including initiating a transaction (i.e., sending the transaction record of the current transaction to other nodes in the blockchain system. After other nodes verify it successfully, as a response to acknowledging the validity of the transaction, they deposit the recorded data of the transaction into the temporary block of the blockchain. Of course, the wallet also supports querying the remaining electronic currency in the electronic currency address;

[0069] 2.2) A shared ledger, which is used to provide functions such as storing, querying, and modifying account data. It sends the recorded data of the operations on the account data to other nodes in the blockchain system. After other nodes verify its validity, as a response to acknowledging the validity of the account data, they deposit the recorded data into the temporary block, and can also send a confirmation to the node that initiated the operation.

[0070] 2.3) A smart contract, which is a computerized protocol that can execute the terms of a certain contract. It is implemented through code deployed on the shared ledger and executed when certain conditions are met. According to actual business requirements, the code is used to complete automated transactions, such as querying the logistics status of the goods purchased by the buyer and transferring the buyer's electronic currency to the merchant's address after the buyer signs for the goods. Of course, smart contracts are not limited to executing contracts for transactions, but can also execute contracts for processing received information.

[0071] 3) A blockchain includes a series of blocks (Blocks) that are sequentially connected in the order of generation. Once a new block is added to the blockchain, it will not be removed again. The block records the recorded data submitted by nodes in the blockchain system.

[0072] See Figure 4 , Figure 4It is an optional schematic diagram of the block structure provided by the embodiments of the present application. Each block includes the hash value of the transaction records stored in this block (the hash value of this block) and the hash value of the previous block. Each block is connected through the hash value to form a blockchain. In addition, the block may further include information such as the timestamp when the block is generated. A blockchain is essentially a decentralized database, a series of data blocks generated by using cryptographic methods. Each data block contains relevant information for verifying the validity of the information (anti-counterfeiting) and generating the next block.

[0073] It should be noted that the above is only an example of a distributed system, and the present embodiment does not make any specific limitations on the specific composition of the distributed system.

[0074] Optionally, in the present embodiment, the application scenarios of the above task scheduling method based on the resource prediction model may include, but are not limited to, the task scheduling processes in various application scenarios such as medical, financial, credit investigation, banking, energy, education, security, building, gaming, transportation, Internet of Things, and industry.

[0075] For example, an e-commerce system needs to issue a batch of coupons at 10 am, 3 pm, and 8 pm every day.

[0076] A bank system needs to send a text message reminder three days before the credit card due date for repayment.

[0077] A financial system needs to settle the financial data of the previous day and perform statistical summary at 0:10 am every day.

[0078] The ticket system will set several time points for batch ticket release according to different train numbers.

[0079] In order to achieve real-time weather display, a certain website goes to the weather server to obtain the latest real-time weather information every 5 minutes.

[0080] The above scenarios are the problems that task scheduling needs to solve.

[0081] Figure 5 It is a schematic diagram of another optional task scheduling method based on the resource prediction model according to the embodiments of the present application, as Figure 5As shown, in the xx application, task scheduling is implemented through the task scheduling background. Task scheduling refers to the process in which the system automatically executes tasks at a specified moment to complete specific tasks. With task scheduling, more human resources can be liberated and tasks can be automatically executed by the system. By obtaining the operation data in each original task node to the management end, preparatory work for the next data prediction is done. The task management background includes the heartbeat detection of tasks, the reporting of the execution track after task execution, as well as the process of task registration and service governance. After a task is started, it will be registered to the management background. The management background gives the sharded data to the server according to the allocation strategy of the task. The server obtains the chunk information and executes it. Finally, the conversion from task data to event data is completed.

[0082] Optionally, in this embodiment, the above first task scheduling historical information may include, but is not limited to, cluster data obtained from the cluster monitoring database. For example, cluster data (obtaining data from T - n,..., T - n + 1 days, 0 - 24 hours per day, and data for each hour) is obtained from the cluster monitoring database (such as mysql, oracle, etc.), including, but not limited to: the id of each task, the actual scheduling time of each task, the submission time of each task, the set start time of each task, the end time of each task, the error reporting time of each task, the restart time of each task, etc.

[0083] Optionally, in this embodiment, the above first resource occupancy status information includes, but is not limited to, the resource occupancy status of the scheduled tasks indicated by the resource occupancy identifier. For example, the resource occupancy rate for each period, the resource occupancy rate for each task scheduling, the resource occupancy rate for each historical period, etc.

[0084] Optionally, in this embodiment, the above N historical periods may include, but are not limited to, N time periods. For example, N days, N months, N years, etc. Each of the above historical periods includes multiple time segments. When the historical period is in days, the time segments may include, but are not limited to, hours, minutes, etc. When the historical period is in months, the time segments may include, but are not limited to, weeks, days, hours. When the historical period is in years, the time segments may include, but are not limited to, half - years, quarters, months, etc.

[0085] It should be noted that the above first task scheduling historical information can be represented in a matrix. Taking the historical period as days and the time segment as hours as an example, the above first task scheduling historical information can be represented as:

[0086]

[0087] Among them, represents the sample feature data (corresponding to the aforementioned scheduling features) in the j - th hour segment of the i - th day.

[0088] The above first resource occupancy status information can be represented by a matrix. Taking the historical period as days and the time period as hours as an example, the above first resource occupancy status information can be expressed as:

[0089]

[0090] Among them, represents the classification label of the cluster resource utilization rate in the j-th hour period of the i-th day (corresponding to the above first resource occupancy status information).

[0091] Optionally, in this embodiment, the above target training sample set may include, but is not limited to, the scheduling characteristics and resource occupancy status labels of each task in a time period of a historical period among multiple tasks, the scheduling characteristics and resource occupancy status labels of the parent task corresponding to a task in the previous time period of a time period in a historical period, and the scheduling characteristics and resource occupancy status labels of the subtask of a task in the next time period of a time period in the previous historical period. The N historical periods include a historical period and the previous historical period, and the tasks to be scheduled include a task, a parent task, and a subtask.

[0092] For example, Figure 6 is a schematic diagram of another optional task scheduling method based on a resource prediction model according to an embodiment of the present application. As Figure 6 shown, X(Task2) represents the scheduling characteristics of task Task2 in the 0th time period of the T-1 historical period, Y(Task2) represents the resource occupancy status label of task Task2 in the 1st time period of the T-1 historical period, Task1 is the parent task of Task2, Task3 is the subtask of Task1, X(Task1) represents the scheduling characteristics of task Task1 in the 0th time period (the previous time period of the 1st time period) of the T-1 historical period, Y(Task1) represents the resource occupancy status label of task Task1 in the 0th time period (the previous time period of the 1st time period) of the T-1 historical period, X(Task3) represents the scheduling characteristics of task Task3 in the 2nd time period (the next time period of the 1st time period) of the T-2 historical period, and Y(Task3) represents the resource occupancy status label of task Task3 in the 2nd time period (the next time period of the 1st time period) of the T-2 historical period. Then X(Task1), Y(Task1), X(Task2), Y(Task2), and X(Task3), Y(Task3) are a target training sample in the above target training sample set.

[0093] Optionally, in this embodiment, the parent task and subtask of the above task can be directly determined from the task code. Specifically, it can be determined from the relationship library generated according to the task code.

[0094] For example, Figure 7 is a schematic diagram of another optional task scheduling method based on a resource prediction model according to an embodiment of the present application. As Figure 7 shown, the parent task of the task with the current task ID of Task_00003 is Task_00002, and the child task is Task_00004. The task ID and the task IDs with an upper and lower dependency relationship can be determined according to the task scheduling historical information. Specifically, the ID of the scheduling task and the ID of the scheduling task with an upper and lower dependency relationship can be obtained from the cluster monitoring database to form a task ID correspondence library D corresponding to the task IDs with an upper and lower dependency relationship.

[0095] Optionally, in this embodiment, the resource prediction model to be trained may include, but is not limited to, the BERT model. The full name of BERT is Bidirectional Encoder Representations from Transformer, that is, the bidirectional encoder representation based on Transformer. As the name implies, BERT uses Transformer and can also consider the words before and after the word when processing a word to obtain its meaning in the context. As we know, the attention mechanism of Transformer has a good effect in extracting features of words in the context, and intuitively, the bidirectional encoding considering the context is better than the unidirectional effect that only considers the above (or below) context.

[0096] Optionally, in this embodiment, the training sample of the resource prediction model to be trained is the above-mentioned target training sample set, the input of the target resource prediction model is the above-mentioned first task scheduling historical information, the output of the target resource prediction model is the prediction probability vector for each of multiple time periods, and the predicted resource occupancy status for each of the multiple time periods can be obtained according to the above-mentioned prediction probability vector.

[0097] In an embodiment of the present application, the first task scheduling historical information and the first resource occupancy status information are obtained. The first task scheduling historical information includes the scheduling characteristics of the tasks scheduled in N historical periods. Each historical period includes multiple time periods, and N is an integer greater than or equal to 1. The first resource occupancy status information includes the resource occupancy status labels of the scheduled tasks. The resource occupancy status labels are used to represent the resource occupancy status of the scheduled tasks. According to the first task scheduling historical information and the first resource occupancy status information, a target training sample set is determined. Each training sample in the target training sample set includes the scheduling characteristics and resource occupancy status labels of a task in a time period of a historical period, the scheduling characteristics and resource occupancy status labels of the parent task of a task in the previous time period of a time period of a historical period, and the scheduling characteristics and resource occupancy status labels of the child task of a task in the next time period of a time period of the previous historical period. The N historical periods include a historical period and the previous historical period. The scheduled tasks include a task, a parent task, and a child task. According to the target training sample set, the resource prediction model to be trained is trained to obtain a target resource prediction model. The resource prediction model to be trained is used to determine the predicted resource occupancy status of each time period in multiple time periods according to each training sample in the target training sample set. By using tasks with upper and lower dependencies for resource occupancy status prediction, according to the time sequence characteristics and labels of the scheduled tasks, the purpose of being able to determine the resource occupancy prediction status of tasks with upper and lower dependencies in multiple time periods is achieved. Thus, the technical effect of improving the accuracy of resource occupancy prediction for task scheduling is realized, and furthermore, the technical problem of inaccurate resource occupancy prediction for task scheduling is solved.

[0098] As an alternative solution, training the resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model includes:

[0099] Sequentially input each training sample in the target training sample set into the resource prediction model to be trained until the loss value between the predicted resource occupancy status of each time period in multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status of each time period in multiple time periods meets a preset loss condition.

[0100] Wherein, when the loss value between the predicted resource occupancy status at each of multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each of the multiple time periods does not meet the preset loss condition, the parameters in the resource prediction model to be trained are adjusted. The actual resource occupancy status at each of the multiple time periods is the resource occupancy status determined according to the scheduling characteristics and resource occupancy status labels of a task in a training sample at a time period in a historical cycle.

[0101] Wherein, the resource prediction model to be trained is used to determine the predicted resource occupancy status of a task at a time period in a historical cycle according to the scheduling characteristics and resource occupancy status labels of the parent task of a task in a training sample at the previous time period of a time period in a historical cycle, and the scheduling characteristics and resource occupancy status labels of the sub - task of a task at the next time period of a time period in the previous historical cycle, and determine the predicted resource occupancy status at each of the multiple time periods according to the predicted resource occupancy status of the task at each of the determined multiple time periods.

[0102] Optionally, in this embodiment, the samples in the above - mentioned target training sample set may be constructed training samples, and the specific construction method is as follows:

[0103] Input the label data of tasks with upper - lower dependency relationships and the feature data of tasks with upper - lower dependency relationships Denote the part of T - n, …, T - 1 in the feature data matrix as Denote the part of T - n + 1, …, T in the feature data as Match the label data matrix Y with the feature data X T-1 and X T According to the task ID and the corresponding tasks at the previous time period of a time period in the current cycle and the next time period of a time period in the previous historical cycle of each task, obtain the time - series sample set S at T - 1 period T-1 , and this sample set is used to construct training samples and test samples. For S T-1 Randomly split it into training samples (with a proportion of а) and test samples (with a proportion of 1 - а) according to a certain ratio. For example, randomly split the samples into training samples: test samples = 8:2 (that is, randomly split the training samples and test samples ) according to the ratio of 8:2. For X T It is used to construct prediction samples.

[0104] Optionally, in this embodiment, the loss value between the predicted resource occupancy status in each of the above-mentioned multiple time periods and the actual resource occupancy status in each of the multiple time periods satisfying a preset loss condition may include, but is not limited to, that the difference between the predicted resource occupancy status output by the resource prediction model to be trained and the actual resource occupancy status recorded in the historical data satisfies a preset threshold.

[0105] Optionally, in this embodiment, adjusting the parameters in the resource prediction model to be trained may include, but is not limited to, adjusting the hyperparameters in the resource prediction model. Determining the predicted resource occupancy status in each of the multiple time periods according to the predicted resource occupancy status of the tasks in each of the determined multiple time periods may include, but is not limited to, using the predicted resource occupancy status of the tasks in each of the multiple time periods as the output of the hidden layer to determine the predicted resource occupancy status in each of the above-mentioned multiple time periods.

[0106] As an alternative solution, each training sample in the target training sample set is sequentially input into the resource prediction model to be trained until the loss value between the predicted resource occupancy status in each of the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status in each of the multiple time periods satisfies a preset loss condition, including:

[0107] Repeat the following steps until the loss value between the predicted resource occupancy status in each of the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status in each of the multiple time periods satisfies a preset loss condition:

[0108] Select the current training sample from the target training sample set and input the current training sample into the BERT model to be trained, where the resource prediction model to be trained is the BERT model to be trained;

[0109] In the BERT model to be trained, determine the predicted resource occupancy status of a task in a time period in a historical cycle according to the scheduling characteristics and resource occupancy status labels of the parent task of a task in a previous time period in a historical cycle in each training sample, and the scheduling characteristics and resource occupancy status labels of the sub-task of a task in the next time period in a previous historical cycle in a historical cycle, and determine the predicted resource occupancy status in each of the multiple time periods according to the predicted resource occupancy status of the tasks in each of the determined multiple time periods;

[0110] Determine whether the loss value between the predicted resource occupancy status in each of the multiple time periods and the actual resource occupancy status in each of the multiple time periods satisfies a preset loss condition;

[0111] In the case where the loss value between the predicted resource occupancy status at each of multiple time periods output by the BERT model to be trained and the actual resource occupancy status at each of the multiple time periods does not meet the preset loss condition, the parameters in the BERT model to be trained are adjusted.

[0112] Optionally, in this embodiment, taking the BERT model as an example, a BERT model is constructed.

[0113]

[0114] Among them, represents the input vector, represents the hidden layer vector, represents the output vector; W Y and W H and W' H and U H and U' H respectively represent the parameter matrices; B H and B Y respectively represent the parameter vectors; represents the activation function of the hidden layer, sig mod Y respectively represent the activation functions of the output layer. In the initial state, the hidden layer adopts the probability transformation of the true output vector in the first period (T - n period) The hidden layer adopts the probability transformation of the true output vector in the first period (T - n period)

[0115] BERT model training and testing phase. Input the training samples and the test samples into the BERT model to obtain the model parameter matrices W Y and W H and W' H and U H and U' H respectively represent the parameter matrices; B H and B Y respectively represent the parameter vectors; the hidden layer at the i - th hour period in the t - th period

[0116] As an alternative solution, after training the resource prediction model to be trained according to the target training sample set to obtain the target resource prediction model, the method further includes:

[0117] Obtain a set of target tasks scheduled in advance in a target future period and a set of scheduled time periods, where each scheduled time period in the set of scheduled time periods is the scheduling time period of the tasks in the set of target tasks in the target future period;

[0118] Obtain the predicted resource occupancy status for each target scheduling time period in the set of target scheduling time periods, and obtain the average number of scheduled tasks for the target scheduling time period, where the predicted resource occupancy status for each target scheduling time period is the resource occupancy status determined according to the target resource prediction model;

[0119] Adjust the number of tasks scheduled in advance for each scheduled time period in the target future period according to the set of scheduled time periods, the predicted resource occupancy status for each target scheduling time period, and the average number of scheduled tasks.

[0120] Optionally, in this embodiment, the above target future period may include, but is not limited to, the next period of the current period. For example, when the current period is February 2nd, the above target future period is February 3rd.

[0121] Optionally, in this embodiment, the above set of target tasks may include, but is not limited to, a set of tasks to be scheduled in the target future period, and the above scheduled time periods include, but are not limited to, the time periods scheduled in advance for the tasks in the above set of target tasks.

[0122] Optionally, in this embodiment, obtaining the predicted resource occupancy status for each target scheduling time period in the set of target scheduling time periods may include, but is not limited to, determining according to the target resource prediction model. For example, input the scheduling characteristics and resource occupancy status labels of a task in a time period of the current period, the scheduling characteristics and resource occupancy status labels of the parent task of a task in the previous time period of a time period in the current period, and the scheduling characteristics and resource occupancy status labels of the child task of a task in the next time period of a time period in the previous historical period of the current period, then the output of the above target resource prediction model is the predicted resource occupancy status for each target scheduling time period in the target future period.

[0123] Optionally, in this embodiment, the average number of scheduled tasks for the target scheduling time period may include, but is not limited to, being obtained by dividing the total number of tasks to be scheduled in the target future period by the number of target scheduling time periods. In other words, the above average number of scheduled tasks represents the number of tasks scheduled for each target scheduling time period.

[0124] As an optional solution, the method further includes:

[0125] Obtain the second task scheduling history information and the second resource occupancy status information, where the second task scheduling history information includes the scheduling characteristics of the tasks scheduled in the M historical cycles before the target future cycle, each of the M historical cycles includes multiple time periods, M is an integer greater than or equal to 1, and the second resource occupancy status information includes the resource occupancy status labels of the tasks scheduled in the M historical cycles;

[0126] Determine the target test sample set according to the second task scheduling history information and the second resource occupancy status information, where each test sample in the target test sample set includes the scheduling characteristics and resource occupancy status label of a task in a time period of a historical cycle, the scheduling characteristics and resource occupancy status label of the parent task of a task in the previous time period of a time period in a historical cycle, and the scheduling characteristics and resource occupancy status label of the child task of a task in the next time period of a time period in the previous historical cycle, the M historical cycles include a historical cycle and the previous historical cycle, and the tasks scheduled include a task, a parent task, and a child task;

[0127] Input the target test sample set into the target resource prediction model to obtain the predicted resource occupancy status for each time period among multiple time periods, where the target resource prediction model is used to determine the predicted resource occupancy status for each time period among multiple time periods according to each test sample in the target test sample set, the target scheduling time period set is multiple time periods, and the predicted resource occupancy status for each target scheduling time period in the target scheduling time period set is the predicted resource occupancy status for each time period among multiple time periods.

[0128] Optionally, in this embodiment, the above second task scheduling history information includes, but is not limited to, the scheduling characteristics of the tasks scheduled in the M historical cycles before the target future cycle, and the above second resource occupancy status information may include, but is not limited to, the resource occupancy status labels of the tasks scheduled in the M historical cycles.

[0129] Optionally, in this embodiment, the above target test sample set may include, but is not limited to, being the same as the above target training sample set, or may also be a set composed of other samples in the constructed sample set except the target training sample set.

[0130] As an alternative solution, inputting the target test sample set into the target resource prediction model to obtain the predicted resource occupancy status for each time period among multiple time periods includes:

[0131] Input each test sample in the target test sample set into the target resource prediction model in sequence;

[0132] In the target resource prediction model, based on the scheduling characteristics and resource occupancy status labels of the previous period of a time period in a historical period of the parent task of a task in each test sample, and the scheduling characteristics and resource occupancy status labels of the next period of a time period in the previous historical period of the subtask of a task, determine the predicted resource occupancy status of a task in a time period in a historical period, and based on the predicted resource occupancy status of the tasks in each of the determined multiple time periods, determine the predicted resource occupancy status of each of the multiple time periods.

[0133] Optionally, in this embodiment, as Figure 6 shown, X(Task2) represents the scheduling characteristics of Task2 in the 0th time period in the T-1 historical period, Y(Task2) represents the resource occupancy status label of Task2 in the 1st time period in the T-1 historical period, Task1 is the parent task of Task2, Task3 is the subtask of Task1, X(Task1) represents the scheduling characteristics of Task1 in the 0th time period (the previous period of the 1st time period) in the T-1 historical period, Y(Task1) represents the resource occupancy status label of Task1 in the 0th time period (the previous period of the 1st time period) in the T-1 historical period, X(Task3) represents the scheduling characteristics of Task3 in the 2nd time period (the next period of the 1st time period) in the T-2 historical period, Y(Task3) represents the resource occupancy status label of Task3 in the 2nd time period (the next period of the 1st time period) in the T-2 historical period, then X(Task1), Y(Task1), X(Task2), Y(Task2), and X(Task3), Y(Task3) are a target test sample in the above target test sample set.

[0134] As an alternative solution, obtaining the average number of scheduled tasks in the target scheduling time period includes:

[0135] When the target scheduling time period set is multiple time periods and the multiple time periods are P time periods, obtain the total number of tasks scheduled in 1 historical period before the target future period, where P is an integer greater than or equal to 2; determine the average number of scheduled tasks to be equal to the value obtained by dividing the total number by P; or

[0136] When the set of target scheduling periods is multiple periods and the multiple periods are P periods, obtain the total number of tasks scheduled in each of the Q historical periods before the target future period, resulting in Q total numbers, where P is an integer greater than or equal to 2 and Q is an integer greater than or equal to 2; divide each of the Q total numbers by P to obtain Q values; determine the average scheduled task quantity to be equal to the average value of the Q values, or equal to the weighted sum of the Q values.

[0137] Optionally, in this embodiment, the 1 historical period before the target future period may include, but is not limited to, the 1 historical period closest to the target future period. For example, when the target future period represents tomorrow, the 1 historical period may include, but is not limited to, today or yesterday.

[0138] Optionally, in this embodiment, the Q historical periods before the target future period may include, but is not limited to, the Q historical periods closest to the target future period. For example, when the target future period represents tomorrow, the 1 historical period may include, but is not limited to, today and yesterday.

[0139] As an alternative solution, according to the set of reserved scheduling periods, the predicted resource occupancy status on each target scheduling period, and the average scheduled task quantity, adjust the quantity of tasks scheduled in advance on each reserved scheduling period in the target future period, including:

[0140] For each reserved scheduling period in the set of reserved scheduling periods, perform the following operations. When performing the following operations, each reserved scheduling period is the current reserved scheduling period:

[0141] Obtain the quantity of tasks scheduled in advance on the current reserved scheduling period in the set of target tasks;

[0142] When the quantity of tasks scheduled in advance is less than or equal to the average scheduled task quantity, keep the quantity of tasks scheduled in advance on the current reserved scheduling period unchanged;

[0143] When the quantity of tasks scheduled in advance is greater than the average scheduled task quantity, determine the target quantity of tasks among the tasks scheduled in advance on the current reserved scheduling period, where the target quantity is equal to the difference between the quantity of tasks scheduled in advance and the average scheduled task quantity; according to the predicted resource occupancy status on the target scheduling period after the current reserved scheduling period, adjust the reserved scheduling period of the target quantity of tasks to one or more reserved scheduling periods after the current reserved scheduling period.

[0144] Optionally, in this embodiment, each of the above reservation scheduling periods is a reservation scheduling period for a task to be scheduled. When the number of tasks scheduled by reservation is less than or equal to the average number of scheduled tasks, keeping the number of tasks scheduled by reservation in the current reservation scheduling period unchanged may include, but is not limited to, when the number of tasks scheduled by reservation in the current reservation scheduling period is less than or equal to the average value, implementing task scheduling according to the correspondence between the reservation scheduling period and the tasks. When the number of tasks scheduled by reservation is greater than the average number of scheduled tasks, determining the difference between the number of tasks scheduled by reservation and the average number of scheduled tasks, and adjusting the target number of tasks to one or more reservation scheduling periods after the current reservation scheduling period, where the specific adjustment method may be determined according to the predicted resource occupancy status in the reservation scheduling period after the current reservation scheduling period.

[0145] For example, obtain the scheduling task ID and reservation scheduling time for the (T + 1)-th day, input the predicted resource occupancy status on each target scheduling period in the target scheduling period set, obtain the number of scheduling tasks in each historical target scheduling period, calculate the average number of scheduling tasks in the target scheduling period, match the task reservation scheduling period with the target scheduling period according to the time priority principle, and allocate the scheduling tasks for the (T + 1)-th day to each target scheduling period on the (T + 1)-th day according to the average number of tasks. If the number of tasks scheduled in the target scheduling period has exceeded the average number of tasks, then it will be postponed to the next target scheduling period in chronological order.

[0146] As an alternative solution, adjusting the reservation scheduling period of the target number of tasks to one or more reservation scheduling periods after the current reservation scheduling period according to the predicted resource occupancy status in the target scheduling period after the current reservation scheduling period includes:

[0147] Search for the first reservation scheduling period that meets the first preset condition after the current reservation scheduling period, where the first preset condition includes: the predicted resource occupancy status on the target scheduling period identical to the first reservation scheduling period indicates that the predicted resource utilization rate on the target scheduling period is less than the preset threshold, and the sum of the number of tasks scheduled by reservation on the first reservation scheduling period and the target number is less than or equal to the average number of scheduled tasks; in the case of finding the first reservation scheduling period that meets the first preset condition, adjusting the reservation scheduling period of the target number of tasks to the first reservation scheduling period that meets the first preset condition; or

[0148] Find a first set of appointment scheduling time periods that meet the second preset condition after the current appointment scheduling time period. The second preset condition includes: the predicted resource occupancy status on the target scheduling time period that is the same as each appointment scheduling time period in the first set of appointment scheduling time periods indicates that the predicted resource utilization rate on the target scheduling time period is less than the preset threshold, the number of tasks scheduled by appointment on each appointment scheduling time period in the first set of appointment scheduling time periods is less than the average number of scheduled tasks, and the sum of the differences between the number of tasks scheduled by appointment on each appointment scheduling time period and the average number of scheduled tasks is greater than or equal to the target number; in the case of finding a first set of appointment scheduling time periods that meet the second preset condition, adjust the appointment scheduling time period of each task in the target number of tasks to the corresponding appointment scheduling time period in the first set of appointment scheduling time periods, where the number of tasks scheduled by appointment on each appointment scheduling time period in the first set of appointment scheduling time periods after adjustment is less than or equal to the average number of scheduled tasks.

[0149] Optionally, in this embodiment, if the predicted resource occupancy status on the target scheduling time period that is the same as the first appointment scheduling time period indicates that the predicted resource utilization rate on the target scheduling time period is less than the preset threshold, and the sum of the number of tasks scheduled by appointment on the first appointment scheduling time period and the target number is less than or equal to the average number of scheduled tasks, then use this target scheduling time period as the appointment scheduling time period after adjusting the tasks in the target number.

[0150] For example, when the current appointment scheduling time period of task A is 1:00, and the number of tasks scheduled at 1:00 is 10, and the average number of scheduled tasks is 5, since 10 > 5, task A needs to be adjusted to a time period after 1:00. At this time, among the time periods after 1:00, the time period with a predicted resource utilization rate less than the preset threshold is 3:00, and the number of tasks scheduled at 3:00 is 3, then task A is adjusted to be scheduled at 3:00, that is, the time period corresponding to 3:00 is the first appointment scheduling time period of task A.

[0151] Optionally, in this embodiment, if the predicted resource occupancy status on the target scheduling time period that is the same as each appointment scheduling time period in the first set of appointment scheduling time periods indicates that the predicted resource utilization rate on the target scheduling time period is less than the preset threshold, the number of tasks scheduled by appointment on each appointment scheduling time period in the first set of appointment scheduling time periods is less than the average number of scheduled tasks, and the sum of the differences between the number of tasks scheduled by appointment on each appointment scheduling time period and the average number of scheduled tasks is greater than or equal to the target number, then use the corresponding appointment scheduling time period in the first set of appointment scheduling time periods as the appointment scheduling time period after adjusting the tasks in the target number.

[0152] For example, when the current scheduled time slots for Task A and Task B are 1:00, and the number of tasks scheduled at 1:00 is 10 while the average number of scheduled tasks is 5, since 10 > 5, Task A needs to be adjusted to a time slot after 1:00. At this time, the time slots with predicted resource utilization rates less than the preset threshold after 1:00 are 3:00 and 5:00. Among them, the number of tasks scheduled at 3:00 is 4, and the number of tasks scheduled at 5:00 is 3. Then Task A is adjusted to be scheduled at 3:00, and Task B is adjusted to be scheduled at 5:00. That is, the time slots corresponding to 3:00 and 5:00 are the scheduled time slots corresponding to the first group of scheduled time slots after Task A.

[0153] As an optional solution, after adjusting the number of tasks scheduled on each scheduled time slot in the target future period, the method further includes:

[0154] On the current scheduled time slot in the target future period, detect whether all the tasks scheduled on the current scheduled time slot have finished running;

[0155] When it is detected that all the tasks scheduled on the current scheduled time slot have finished running and there are still remaining resources on the current scheduled time slot, determine one or more tasks from the tasks scheduled on the scheduled time slots after the current scheduled time slot; schedule one or more tasks on the current scheduled time slot.

[0156] Optionally, in this embodiment, the above detection of whether the tasks scheduled on the current scheduled time slot have finished running may include, but is not limited to, receiving feedback information or trigger information indicating task completion. The situation where there are still remaining resources on the current scheduled time slot may include, but is not limited to, that the resource occupancy rate of the current scheduled time slot is less than the preset threshold. At this time, the tasks scheduled on the scheduled time slots after the current scheduled time slot are scheduled in advance to the current scheduled time slot to run.

[0157] As an optional solution, determining one or more tasks from the tasks scheduled on the scheduled time slots after the current scheduled time slot includes:

[0158] Find the first scheduled time slot after the current scheduled time slot that meets the third preset condition, where the third preset condition includes: the predicted resource occupancy status on the target scheduled time slot that is the same as the first scheduled time slot indicates that the predicted resource utilization rate on the target scheduled time slot is greater than or equal to the preset threshold;

[0159] In the case of finding the first scheduled time slot that meets the third preset condition, determine one or more tasks in the first scheduled time slot that meets the third preset condition.

[0160] Optionally, in this embodiment, the first reserved scheduling period that meets the third preset condition may include, but is not limited to, a reserved scheduling period in which the predicted resource utilization rate is greater than or equal to a preset threshold. Therefore, when it is necessary to reduce the number of tasks in the first reserved scheduling period, by determining one or more tasks in this period and scheduling them in advance to run in the current reserved scheduling period, the resource utilization efficiency is improved.

[0161] As an alternative solution, after adjusting the number of tasks scheduled for reservation in each reserved scheduling period of the target future period, the method further includes:

[0162] In the current reserved scheduling period of the target future period, detect whether the resources in the current reserved scheduling period are less than the resources required for the tasks scheduled for reservation in the current reserved scheduling period to run;

[0163] When it is detected that the resources in the current reserved scheduling period are less than the resources required for the tasks scheduled for reservation in the current reserved scheduling period to run, determine one or more tasks among the tasks scheduled for reservation in the current reserved scheduling period; adjust the reserved scheduling period of the one or more tasks from the current reserved scheduling period to the reserved scheduling period after the current reserved scheduling period.

[0164] Optionally, in this embodiment, the above detection of whether the tasks scheduled for reservation in the current reserved scheduling period have finished running may include, but is not limited to, receiving feedback information or trigger information indicating task completion. The situation where the resources in the current reserved scheduling period are less than the resources required for the tasks scheduled for reservation in the current reserved scheduling period to run may include, but is not limited to, that the resource occupancy rate of the current reserved scheduling period is greater than or equal to a preset threshold. At this time, the tasks in the current reserved scheduling period are scheduled backward to run in the reserved scheduling period after the current reserved scheduling period.

[0165] As an alternative solution, adjusting the reserved scheduling period of one or more tasks from the current reserved scheduling period to the reserved scheduling period after the current reserved scheduling period includes:

[0166] Find the first reserved scheduling period that meets the fourth preset condition after the current reserved scheduling period, where the fourth preset condition includes: the predicted resource occupancy status on the target scheduling period that is the same as the first reserved scheduling period indicates that the predicted resource utilization rate on the target scheduling period is less than the preset threshold;

[0167] In the case where the first reserved scheduling period that meets the fourth preset condition is found, adjust the reserved scheduling period of the one or more tasks from the current reserved scheduling period to the first reserved scheduling period that meets the fourth preset condition.

[0168] Optionally, in this embodiment, the first reserved scheduling period that meets the fourth preset condition may include, but is not limited to, a reserved scheduling period in which the predicted resource utilization rate is less than a preset threshold. Therefore, when it is necessary to reduce the number of tasks in the current reserved scheduling period, by determining one or more tasks in the current reserved period and scheduling them backward to the first reserved scheduling period after the current reserved scheduling period for execution, the resource utilization efficiency is improved.

[0169] The following further explains and illustrates the present application with specific examples:

[0170] Regarding the problem of resource occupancy prediction for task scheduling in the prior art, it mainly uses historical data in the past to predict the resource occupancy of each task. However, for the problem of resource occupancy with context interdependence, there is currently no relevant solution.

[0171] Since the scheduling tasks with context interdependence are a problem regarding the sequence of task scheduling time, that is, the execution of the current task is affected by the execution of the previous task, and the running state (such as the set start time, etc.) of the next task also affects the resource occupancy of the current task. The present application solves the problem of resource prediction for task scheduling with context interdependence through the BERT algorithm. Since this task scheduling can only start the current task after the previous task is completed, and the execution of the current task in turn affects the task scheduling problem of the next period. Therefore, the BERT algorithm meets the business scenario with context dependence and solves the problem of resource occupancy prediction for scheduling tasks with context dependence in each time period.

[0172] The technical process of the present application is mainly divided into the following 11 stages: cluster data acquisition stage, context-dependent task ID construction stage, context-dependent relationship task sample label extraction stage, context-dependent relationship scheduling task feature data construction stage, sample construction stage, BERT model construction stage, BERT model training and testing stage, BERT model prediction stage, prediction classification stage, task reservation and resource prediction matching stage, task scheduling stage.

[0173] Figure 8 It is a schematic diagram of another optional task scheduling method based on a resource prediction model according to an embodiment of the present application. As Figure 8 shown, it includes but is not limited to the following steps:

[0174] Step1. Cluster data acquisition phase. Obtain cluster data (acquire data for T-n, …, T n+1 days, from 0 to 24 hours each day, and data for each hour) from the cluster monitoring database (such as mysql, oracle), including but not limited to: the id of each task, the actual scheduling time of each task, the submission time of each task, the set start time of each task, the end time of each task, the error reporting time of each task, the restart time of each task, the resource occupancy rate for each time period, and the resource occupancy rate for each task scheduling.

[0175] Step2. Construction phase of the upper and lower dependent task IDs. Obtain the IDs of the scheduling tasks and the IDs of the scheduling tasks with upper and lower dependencies from the cluster monitoring database to form a corresponding relationship library D of task IDs with upper and lower dependencies.

[0176] Step3. Extraction phase of the sample labels for tasks with upper and lower dependencies. Input the data obtained in Step1 and the corresponding relationship library D of task IDs with upper and lower dependencies. Convert the cluster resource utilization rate for each time period each day into classification labels (where the resource utilization rate exceeds 70% (expert opinion), marked as 0 (negative sample); otherwise, marked as 1 (positive sample)). According to the task ID, match the classification labels with the corresponding relationship library D of task IDs with upper and lower dependencies to obtain a sample label matrix for tasks with upper and lower dependencies. Among them, represents the classification label of the cluster resource utilization rate in the jth hour period on the ith day.

[0177] Step4. Construction phase of the characteristic data for scheduling tasks with upper and lower dependencies. The characteristic data includes but not limited to: the occupancy rate of the cluster for each hour granularity in the past n+1 days (T, T-1, T-2, …, T-n), the number of scheduling tasks, the average waiting time of the scheduling tasks, the average running time of the tasks, the average resource occupancy number of the tasks, the total amount of cluster resources in each time area, the average number of associated tasks, the average completion time of the associated tasks, the average resource occupancy number of the associated tasks, the time difference between the task issuance time and the task start time, whether the task issuance time falls within the time interval where the issuance time is located, etc. as the sample characteristic data matrix. According to the task ID, match the task library D with upper and lower dependencies with the sample characteristic data to obtain a characteristic data matrix for scheduling tasks with upper and lower dependencies. represents the sample characteristic data in the jth hour period on the ith day.

[0178] Step5. Sample construction phase. Input the label data of tasks with upper and lower dependencies in Step4 and the characteristic data of tasks with upper and lower dependencies Record the T-n, …, T-1 part in the characteristic data matrix as The T-n+1, …, T parts in the feature data are denoted as The label data matrix Y and the feature data X T-1 and X T Are matched according to the task ID and the corresponding tasks of the previous child node (corresponding to the aforementioned time period) and the next child node of the previous master node of each task's current master node (corresponding to the aforementioned cycle), and the time series sample set S at T-1 period is obtained T-1 , and this sample set is used to construct training samples and test samples. For S T-1 Randomly split into training samples (proportion is а) and test samples (proportion is 1-а) according to a certain proportion. For example, randomly split the samples into training samples: test samples = 8:2 according to general experience (that is, randomly split the training samples and test samples ) according to the ratio of 8:2. For X T Is used to construct prediction samples.

[0179] Step6, BERT model construction stage. Construct the BERT model

[0180]

[0181] Among them Represents the input vector Represents the hidden layer vector Represents the output vector; W Y , W H , W′ H , U H , U′ H Respectively represent the parameter matrices; B H , B Y Respectively represent the parameter vectors; tanh H Represents the activation function of the hidden layer, sigmod Y Respectively represent the output layer activation functions. In the initial state, the hidden layer Adopts the probability transformation of the true output vector of the first period (T-n period) Hidden layer Adopts the probability transformation of the true output vector of the first period (T-n period)

[0182] Step7, BERT model training and testing stage. Input the training samples and test samples Into the BERT model to obtain the model parameter matrices W Y , W H , W′ H , U H , U′ H Respectively represent the parameter matrices; BH and B Y respectively represent parameter vectors; the hidden layer of the i-th hour period at time t

[0183] Step 8, BERT model prediction stage. Input the prediction sample X of Step 5 T , the parameter matrix W of Step 7 Y , W H , W' H , U H , U' H respectively represent parameter matrices; B H , B Y respectively represent parameter vectors; the hidden layer of the i-th hour period at time t Use Substitute the above parameters to obtain the probability vector P{Y of the task scheduling for the (i + 1)-th hour period on the t-th day t+1}.

[0184] Step 9, prediction classification stage. Perform target division on the classification probabilities predicted in Step 6 according to a certain threshold (usually 0.5) (where the target period represents the period when the cluster resource occupancy rate is lower than 70%, and its corresponding classification probability is greater than 0.5, marked as 1, otherwise marked as 0).

[0185] Step 10, task reservation and resource prediction matching stage. Obtain the task scheduling task ID and reservation scheduling time for the (T + 1)-th day of the task, input the task scheduling target period in Step 9, obtain the number of scheduling tasks in each historical target period, calculate the average number of scheduling tasks in the target period, match the reservation time of the scheduling task with the task allocation target period according to the time priority principle, and allocate the scheduling tasks for the (T + 1)-th day to each period of the (T + 1)-th day according to the average number of tasks. If the number of tasks in this period has exceeded its average number, then it will be postponed to the next period in chronological order.

[0186] Step 11, task scheduling. Start tasks in sequence according to the chronological order and the scheduling task order pre-allocated in Step 8. If the tasks in the current period have been completed and there are still remaining resources, then move the tasks in the next period forward to the current period for scheduling according to the sorting in Step 8; if there is resource tension in the current period, then move the scheduling tasks in the current period backward to the next period for scheduling according to the sorting in Step 8.

[0187] This application uses the BERT algorithm to solve the resource prediction problem of task scheduling with upper and lower interdependent relationships. Since this task scheduling is based on the completion of the previous task before the current task can be started, and the operation of the current task affects the task scheduling problem of the next period. Therefore, the BERT algorithm meets the business scenarios with upper and lower dependencies and solves the resource occupancy prediction problem of scheduling tasks with upper and lower dependencies within each time period.

[0188] This application constructs an upper and lower dependency relationship library for scheduling tasks, matches the parent tasks and child tasks of each task, and matches them with sample labels and sample feature data to obtain sample labels and sample features of scheduling tasks with upper and lower dependency relationships. It effectively depicts the interdependent relationships and features of task scheduling.

[0189] When constructing the BERT algorithm in the solution of this application, the feature data of the previous child node of the current master node and the resource occupancy status label of the corresponding next child node of the previous master node are used to predict the resource occupancy status of the current master node corresponding to the current child node (for example, using the feature data at 10:00 on the current day and the feature data at 12:00 on the previous day to predict the resource occupancy status at 11:00 on the current day).

[0190] This application reconstructs the BERT algorithm model according to the sample data of the upper and lower dependency relationships, and can effectively reflect the quantitative influence relationship of the sample features of the upper and lower dependency relationships on the label status.

[0191] This application can make full use of the characteristics of BERT, use bidirectional features for state prediction, and solve the resource occupancy prediction problem of task scheduling with upper and lower related dependency relationships according to the time sequence features and labels of scheduling tasks, and also effectively improve the accuracy of prediction.

[0192] It can be understood that in the specific implementation of this application, data related to user information, etc. is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions.

[0193] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0194] According to another aspect of the embodiments of the present application, there is also provided a task scheduling device based on a resource prediction model for implementing the above-mentioned task scheduling method based on a resource prediction model. As Figure 9 shown, the device includes:

[0195] An acquisition module 902, configured to acquire first task scheduling historical information and first resource occupancy status information, where the first task scheduling historical information includes scheduling characteristics of tasks scheduled in N historical periods, each historical period includes a plurality of time periods, N is an integer greater than or equal to 1, and the first resource occupancy status information includes resource occupancy status tags of the scheduled tasks, and the resource occupancy status tags are used to represent the resource occupancy status of the scheduled tasks;

[0196] A determination module 904, configured to determine a target training sample set according to the first task scheduling historical information and the first resource occupancy status information, where each training sample in the target training sample set includes the scheduling characteristics and resource occupancy status tags of a task in a time period in a historical period, the scheduling characteristics and resource occupancy status tags of the parent task of the task in the previous time period in the historical period, and the scheduling characteristics and resource occupancy status tags of the child task of the task in the next time period in the previous historical period of the historical period, the N historical periods include the historical period and the previous historical period, and the scheduled tasks include the task, the parent task, and the child task;

[0197] A training module 906, configured to train a resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model, where the resource prediction model to be trained is used to determine the predicted resource occupancy status in each of the plurality of time periods according to each training sample in the target training sample set.

[0198] As an alternative solution, the device is configured to train a resource prediction model to be trained according to the target training sample set in the following manner to obtain a target resource prediction model: sequentially input each training sample in the target training sample set into the resource prediction model to be trained until the loss value between the predicted resource occupancy status at each of the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each of the multiple time periods meets a preset loss condition, wherein, when the loss value between the predicted resource occupancy status at each of the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each of the multiple time periods does not meet the preset loss condition, adjust the parameters in the resource prediction model to be trained, and the actual resource occupancy status at each of the multiple time periods is the resource occupancy status determined according to the scheduling characteristics and resource occupancy status labels of the one task in the one time period of the one historical cycle in each training sample; wherein, the resource prediction model to be trained is configured to determine the predicted resource occupancy status of the one task in the one time period of the one historical cycle according to the scheduling characteristics and resource occupancy status labels of the parent task of the one task in the previous time period of the one time period in the one historical cycle and the scheduling characteristics and resource occupancy status labels of the child tasks of the one task in the next time period of the one time period in the previous historical cycle, and determine the predicted resource occupancy status at each of the multiple time periods according to the predicted resource occupancy status of the tasks at each of the multiple time periods determined.

[0199] As an alternative, the device is used to sequentially input each training sample in the target training sample set into the resource prediction model to be trained until the loss value between the predicted resource occupancy status at each time period among the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each time period among the multiple time periods meets a preset loss condition: Repeat the following steps until the loss value between the predicted resource occupancy status at each time period among the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each time period among the multiple time periods meets the preset loss condition: Select a current training sample from the target training sample set and input the current training sample into the BERT model to be trained, where the resource prediction model to be trained is the BERT model to be trained; In the BERT model to be trained, according to the scheduling characteristics and resource occupancy status labels of the parent task of the one task in the previous time period of the one time period in the one historical cycle and the scheduling characteristics and resource occupancy status labels of the child tasks of the one task in the next time period of the one time period in the previous historical cycle of the one historical cycle, determine the predicted resource occupancy status of the one task in the one time period in the one historical cycle, and according to the predicted resource occupancy status of the tasks at each time period among the determined multiple time periods, determine the predicted resource occupancy status at each time period among the multiple time periods; Determine whether the loss value between the predicted resource occupancy status at each time period among the multiple time periods and the actual resource occupancy status at each time period among the multiple time periods meets the preset loss condition; In the case where the loss value between the predicted resource occupancy status at each time period among the multiple time periods output by the BERT model to be trained and the actual resource occupancy status at each time period among the multiple time periods does not meet the preset loss condition, adjust the parameters in the BERT model to be trained.

[0200] As an alternative solution, the device is further configured to: after training the resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model, acquire a target task set scheduled in a target future period and a set of scheduled time periods, where each scheduled time period in the set of scheduled time periods is a scheduling time period of a task in the target task set in the target future period; acquire the predicted resource occupancy status at each target scheduling time period in the target scheduling time period set, and acquire the average number of scheduled tasks at the target scheduling time period, where the predicted resource occupancy status at each target scheduling time period is a resource occupancy status determined according to the target resource prediction model; and adjust the number of tasks scheduled at each scheduled time period in the target future period according to the set of scheduled time periods, the predicted resource occupancy status at each target scheduling time period, and the average number of scheduled tasks.

[0201] As an alternative solution, the device is further configured to: acquire second task scheduling historical information and second resource occupancy status information, where the second task scheduling historical information includes scheduling characteristics of tasks scheduled in M historical periods before the target future period, each of the M historical periods includes the plurality of time periods, M is an integer greater than or equal to 1, and the second resource occupancy status information includes resource occupancy status labels of tasks scheduled in the M historical periods; determine a target test sample set according to the second task scheduling historical information and the second resource occupancy status information, where each test sample in the target test sample set includes the scheduling characteristics and resource occupancy status label of a task at a time period in a historical period, the scheduling characteristics and resource occupancy status label of the parent task of the task at the previous time period of the time period in the historical period, and the scheduling characteristics and resource occupancy status label of the child task of the task at the next time period of the time period in the previous historical period of the historical period, the M historical periods include the historical period and the previous historical period, and the scheduled tasks include the task, the parent task, and the child task; input the target test sample set into the target resource prediction model to obtain the predicted resource occupancy status at each of the plurality of time periods, where the target resource prediction model is configured to determine the predicted resource occupancy status at each of the plurality of time periods according to each test sample in the target test sample set, the target scheduling time period set is the plurality of time periods, and the predicted resource occupancy status at each target scheduling time period in the target scheduling time period set is the predicted resource occupancy status at each of the plurality of time periods.

[0202] As an alternative, the device is configured to input the target test sample set into the target resource prediction model in the following manner to obtain the predicted resource occupancy status for each of the multiple time periods: sequentially input each test sample in the target test sample set into the target resource prediction model; in the target resource prediction model, based on the scheduling characteristics and resource occupancy status labels of the parent task of the one task in the previous time period of the one time period in the one historical period in each test sample, and the scheduling characteristics and resource occupancy status labels of the child tasks of the one task in the next time period of the one time period in the previous historical period of the one historical period, determine the predicted resource occupancy status of the one task in the one time period in the one historical period, and based on the predicted resource occupancy statuses of the tasks in each of the multiple time periods determined, determine the predicted resource occupancy status for each of the multiple time periods.

[0203] As an alternative, the device is configured to obtain the average number of scheduled tasks for the target scheduling time period in the following manner: when the target scheduling time period set is the multiple time periods and the multiple time periods are P time periods, obtain the total number of tasks scheduled in 1 historical period before the target future period, where P is an integer greater than or equal to 2; determine the average number of scheduled tasks to be equal to the value obtained by dividing the total number by P; or when the target scheduling time period set is the multiple time periods and the multiple time periods are P time periods, obtain the total number of tasks scheduled in each of the Q historical periods before the target future period to obtain Q total numbers, where P is an integer greater than or equal to 2 and Q is an integer greater than or equal to 2; divide each of the Q total numbers by P to obtain Q values; determine the average number of scheduled tasks to be equal to the average of the Q values, or equal to the weighted sum of the Q values.

[0204] As an alternative, the device is configured to adjust the number of tasks scheduled in each reservation scheduling period in the target future period according to the set of reservation scheduling periods, the predicted resource occupancy status on each target scheduling period, and the average number of scheduling tasks, in the following manner: for each reservation scheduling period in the set of reservation scheduling periods, perform the following operations, where when performing the following operations, each reservation scheduling period is the current reservation scheduling period: obtain the number of tasks scheduled in the current reservation scheduling period in the set of target tasks; when the number of tasks scheduled is less than or equal to the average number of scheduling tasks, keep the number of tasks scheduled in the current reservation scheduling period unchanged; when the number of tasks scheduled is greater than the average number of scheduling tasks, determine a target number of tasks among the tasks scheduled in the current reservation scheduling period, where the target number is equal to the difference between the number of tasks scheduled and the average number of scheduling tasks; according to the predicted resource occupancy status on the target scheduling period after the current reservation scheduling period, adjust the reservation scheduling period of the target number of tasks to one or more reservation scheduling periods after the current reservation scheduling period.

[0205] As an alternative, the device is configured to adjust the reservation scheduling period of the target number of tasks to one or more reservation scheduling periods after the current reservation scheduling period according to the predicted resource occupancy status on the target scheduling period after the current reservation scheduling period in the following manner: find the first reservation scheduling period that meets the first preset condition after the current reservation scheduling period, where the first preset condition includes: the predicted resource occupancy status on the target scheduling period that is the same as the first reservation scheduling period indicates that the predicted resource utilization rate on the target scheduling period is less than a preset threshold, and the sum of the number of tasks scheduled for reservation on the first reservation scheduling period and the target number is less than or equal to the average number of scheduled tasks; in the case where the first reservation scheduling period that meets the first preset condition is found, adjust the reservation scheduling period of the target number of tasks to the first reservation scheduling period that meets the first preset condition; or find the first set of reservation scheduling periods that meet the second preset condition after the current reservation scheduling period, where the second preset condition includes: the predicted resource occupancy status on the target scheduling period that is the same as each reservation scheduling period in the first set of reservation scheduling periods indicates that the predicted resource utilization rate on the target scheduling period is less than a preset threshold, the number of tasks scheduled for reservation on each reservation scheduling period in the first set of reservation scheduling periods is less than the average number of scheduled tasks, and the sum of the differences between the number of tasks scheduled for reservation on each reservation scheduling period and the average number of scheduled tasks is greater than or equal to the target number; in the case where the first set of reservation scheduling periods that meet the second preset condition is found, adjust the reservation scheduling period of each task in the target number of tasks to the corresponding reservation scheduling period in the first set of reservation scheduling periods, where the number of tasks scheduled for reservation on each reservation scheduling period in the first set of reservation scheduling periods after adjustment is less than or equal to the average number of scheduled tasks.

[0206] As an alternative, the device is further configured to: after adjusting the number of tasks scheduled for reservation on each reservation scheduling period in the target future period, at the current reservation scheduling period in the target future period, detect whether all the tasks scheduled for reservation on the current reservation scheduling period have finished running; when it is detected that all the tasks scheduled for reservation on the current reservation scheduling period have finished running and there are still remaining resources on the current reservation scheduling period, determine one or more tasks from the tasks scheduled for reservation on the reservation scheduling periods after the current reservation scheduling period; schedule the one or more tasks on the current reservation scheduling period.

[0207] As an alternative, the apparatus is configured to determine one or more tasks from the tasks scheduled in a scheduling period after the current scheduled period in the following manner: find the first scheduling period after the current scheduled period that meets a third preset condition, where the third preset condition includes: the predicted resource occupancy status in the same target scheduling period as the first scheduling period indicates that the predicted resource utilization rate in the target scheduling period is greater than or equal to a preset threshold; in the case where the first scheduling period that meets the third preset condition is found, determine the one or more tasks in the first scheduling period that meets the third preset condition.

[0208] As an alternative, the apparatus is further configured to: after adjusting the number of tasks scheduled in each scheduling period in the target future period, detect, in the current scheduling period in the target future period, whether the resources in the current scheduling period are less than the resources required for the tasks scheduled in the current scheduling period to run; when it is detected that the resources in the current scheduling period are less than the resources required for the tasks scheduled in the current scheduling period to run, determine one or more tasks from the tasks scheduled in the current scheduling period; and adjust the scheduling periods of the one or more tasks from the current scheduling period to a scheduling period after the current scheduling period.

[0209] As an alternative, the apparatus is configured to adjust the scheduling periods of the one or more tasks from the current scheduling period to a scheduling period after the current scheduling period in the following manner: find the first scheduling period after the current scheduling period that meets a fourth preset condition, where the fourth preset condition includes: the predicted resource occupancy status in the same target scheduling period as the first scheduling period indicates that the predicted resource utilization rate in the target scheduling period is less than a preset threshold; in the case where the first scheduling period that meets the fourth preset condition is found, adjust the scheduling periods of the one or more tasks from the current scheduling period to the first scheduling period that meets the fourth preset condition.

[0210] According to one aspect of the present application, there is provided a computer program product, which includes computer programs / instructions, and the computer programs / instructions include program codes for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1009 and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit 1001, various functions provided by the embodiments of the present application are executed.

[0211] 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.

[0212] Figure 10 A block diagram of a computer system of an electronic device for implementing the embodiments of the present application is schematically shown.

[0213] It should be noted that Figure 10 The computer system 1000 of the electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.

[0214] As Figure 10 shown, the computer system 1000 includes a central processing unit 1001 (Central Processing Unit, CPU), which can perform various appropriate actions and processes according to the program stored in the read-only memory 1002 (Read-Only Memory, ROM) or the program loaded from the storage section 1008 into the random access memory 1003 (Random Access Memory, RAM). In the random access memory 1003, various programs and data required for system operation are also stored. The central processing unit 1001, the read-only memory 1002, and the random access memory 1003 are connected to each other via a bus 1004. The input / output interface 1005 (Input / Output interface, i.e., I / O interface) is also connected to the bus 1004.

[0215] The following components are connected to the input / output interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including, for example, a cathode ray tube (Cathode Ray Tube, CRT), a liquid crystal display (Liquid Crystal Display, LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a local area network card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. The drive 1100 is also connected to the input / output interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1100 as needed so that a computer program read from it can be installed into the storage section 1008 as needed.

[0216] In particular, according to an embodiment of the present application, the processes described in each method flowchart can be implemented as computer software programs. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit 1001, various functions defined in the system of the present application are executed.

[0217] According to another aspect of the embodiments of the present application, an electronic device for implementing the above-mentioned task scheduling method based on a resource prediction model is further provided. The electronic device may be Figure 1 the terminal device or server shown. This embodiment takes the electronic device as the terminal device as an example for illustration. As Figure 11 shown, the electronic device includes a memory 1102 and a processor 1104. A computer program is stored in the memory 1102, and the processor 1104 is configured to execute the steps in any one of the above method embodiments through the computer program.

[0218] Optionally, in this embodiment, the above-mentioned electronic device may be at least one of multiple network devices in a computer network.

[0219] Optionally, in this embodiment, the above-mentioned processor may be configured to execute the following steps through a computer program:

[0220] S1. Obtain first task scheduling historical information and first resource occupancy status information, where the first task scheduling historical information includes scheduling characteristics of tasks scheduled in N historical periods, each historical period includes multiple time periods, N is an integer greater than or equal to 1, the first resource occupancy status information includes resource occupancy status labels of the scheduled tasks, and the resource occupancy status labels are used to represent the resource occupancy status of the scheduled tasks;

[0221] S2. Determine a target training sample set according to the first task scheduling historical information and the first resource occupancy status information, where each training sample in the target training sample set includes the scheduling characteristics and resource occupancy status labels of a task in a time period of a historical period, the scheduling characteristics and resource occupancy status labels of the parent task of a task in the previous time period of a time period in a historical period, and the scheduling characteristics and resource occupancy status labels of the sub-task of a task in the next time period of a time period in the previous historical period of N historical periods. The N historical periods include a historical period and the previous historical period, and the scheduled tasks include a task, a parent task, and a sub-task;

[0222] S3. Train the resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model, where the resource prediction model to be trained is used to determine the predicted resource occupancy status at each of multiple time periods according to each training sample in the target training sample set.

[0223] Optionally, those of ordinary skill in the art can understand that Figure 11 The structure shown is only schematic, and the electronic device or electronic equipment can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a handheld computer, and terminal devices such as Mobile Internet Devices (MID), PAD, etc. Figure 11 It does not limit the structure of the above-mentioned electronic device or electronic equipment. For example, the electronic device or electronic equipment may further include more or fewer components (such as a network interface, etc.) than those shown in Figure 11 or have a different configuration from that shown in Figure 11 shown.

[0224] Among them, the memory 1102 can be used to store software programs and modules, such as the program instructions / modules corresponding to the task scheduling method and device based on the resource prediction model in the embodiments of the present application. The processor 1104 executes various functional applications and data processing by running the software programs and modules stored in the memory 1102, that is, implements the above-mentioned task scheduling method based on the resource prediction model. The memory 1102 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 1102 may further include a memory remotely set relative to the processor 1104, and these remote memories can be connected to the terminal through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof. Among them, the memory 1102 can specifically but not limitedly be used to store information such as sample features of tasks. As an example, as Figure 11 shown, the above-mentioned memory 1102 may include but are not limited to the acquisition module 902, the determination module 904, and the training module 906 in the task scheduling device based on the resource prediction model. In addition, it may also include but are not limited to other module units in the task scheduling device based on the resource prediction model, which will not be elaborated in this example.

[0225] Optionally, the above-mentioned transmission device 1106 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 1106 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers through a network cable, so as to communicate with the Internet or a local area network. In one example, the transmission device 1106 is a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0226] In addition, the above-mentioned electronic device further includes: a display 1108, which is used to display the above-mentioned task data; and a connection bus 1110, which is used to connect each module component in the above-mentioned electronic device.

[0227] In other embodiments, the above-mentioned terminal device or server may be a node in a distributed system. Among them, the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes in the form of network communication. Among them, the nodes may form a Peer To Peer (P2P) network, and any form of computing device, such as electronic devices such as servers and terminals, can become a node in the blockchain system by joining the peer-to-peer network.

[0228] According to one aspect of the present application, there is provided a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the task scheduling method based on the resource prediction model provided in various optional implementation manners of the above-mentioned task scheduling based on the resource prediction model.

[0229] Optionally, in this embodiment, the above-mentioned computer-readable storage medium may be set to store a computer program for executing the following steps:

[0230] S1, obtain the first task scheduling historical information and the first resource occupancy status information, where the first task scheduling historical information includes the scheduling characteristics of the tasks scheduled in N historical periods, each historical period includes multiple time periods, N is an integer greater than or equal to 1, and the first resource occupancy status information includes the resource occupancy status labels of the scheduled tasks, and the resource occupancy status labels are used to represent the resource occupancy status of the scheduled tasks;

[0231] S2. Determine a target training sample set according to the first task scheduling history information and the first resource occupancy status information. Each training sample in the target training sample set includes the scheduling characteristics and resource occupancy status labels of a task in a time period of a historical cycle, the scheduling characteristics and resource occupancy status labels of the parent task of a task in the previous time period of a time period in a historical cycle, and the scheduling characteristics and resource occupancy status labels of the subtask of a task in the next time period of a time period in the previous historical cycle. The N historical cycles include a historical cycle and the previous historical cycle. The tasks to be scheduled include a task, a parent task, and a subtask.

[0232] S3. Train the resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model. The resource prediction model to be trained is used to determine the predicted resource occupancy status in each time period of multiple time periods according to each training sample in the target training sample set.

[0233] Optionally, in this embodiment, those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the relevant hardware of the terminal device through a program. The program can be stored in a computer-readable storage medium. The storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, etc.

[0234] The serial numbers of the embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0235] If the integrated unit in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0236] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0237] In several embodiments provided by this application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection between each other can be through some interfaces. The indirect coupling or communication connection of units or modules can be in electrical or other forms.

[0238] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0239] In addition, in each embodiment of this application, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0240] The above is only the preferred embodiment of this application. It should be noted that for those of ordinary skill in the art, without departing from the principle of this application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of this application.

Claims

1. A task scheduling method based on a resource prediction model, characterized in that, it includes: Obtain the first task scheduling historical information and the first resource occupancy status information, wherein the first task scheduling historical information includes the scheduling characteristics of the tasks scheduled in N historical periods, each historical period includes multiple time periods, N is an integer greater than or equal to 1, and the first resource occupancy status information includes the resource occupancy status labels of the scheduled tasks, and the resource occupancy status labels are used to represent the resource occupancy status of the scheduled tasks; According to the first task scheduling historical information and the first resource occupancy status information, determine a target training sample set, wherein each training sample in the target training sample set includes the scheduling characteristics and resource occupancy status labels of a task in a time period of a historical period, the scheduling characteristics and resource occupancy status labels of the parent task of the task in the previous time period of the time period in the historical period, and the scheduling characteristics and resource occupancy status labels of the child task of the task in the next time period of the time period in the previous historical period of the historical period, the N historical periods include the historical period and the previous historical period, and the scheduled tasks include the task, the parent task and the child task; According to the target training sample set, train the resource prediction model to be trained to obtain a target resource prediction model, wherein the resource prediction model to be trained is used to determine the predicted resource occupancy status of a task in a time period of the historical period according to the scheduling characteristics and resource occupancy status labels of the parent task of the task in the previous time period of the time period in the historical period and the scheduling characteristics and resource occupancy status labels of the child task of the task in the next time period of the time period in the previous historical period of the historical period, and determine the predicted resource occupancy status of each time period in the multiple time periods according to the predicted resource occupancy status of the tasks in each time period in the determined multiple time periods.

2. The method according to claim 1, characterized in that, the training the resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model includes: Input each training sample in the target training sample set into the resource prediction model to be trained in sequence until the loss value between the predicted resource occupancy status at each of the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each of the multiple time periods meets a preset loss condition. Wherein, when the loss value between the predicted resource occupancy status at each of the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each of the multiple time periods does not meet the preset loss condition, adjust the parameters in the resource prediction model to be trained. The actual resource occupancy status at each of the multiple time periods is the resource occupancy status determined according to the scheduling characteristics and resource occupancy status labels of the one task in the one time period of the one historical cycle in each training sample.

3. The method according to claim 2, characterized in that the step of inputting each training sample in the target training sample set into the resource prediction model to be trained in sequence until the loss value between the predicted resource occupancy status at each of the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each of the multiple time periods meets a preset loss condition includes: repeatedly execute the following steps until the loss value between the predicted resource occupancy status at each of the multiple time periods output by the resource prediction model to be trained and the actual resource occupancy status at each of the multiple time periods meets a preset loss condition: select a current training sample in the target training sample set and input the current training sample into the BERT model to be trained, wherein the resource prediction model to be trained is the BERT model to be trained; in the BERT model to be trained, determine the predicted resource occupancy status of the one task in the one time period of the one historical cycle according to the scheduling characteristics and resource occupancy status labels of the parent task of the one task in the previous time period of the one time period of the one historical cycle and the scheduling characteristics and resource occupancy status labels of the sub - task of the one task in the next time period of the previous historical cycle of the one time period, and determine the predicted resource occupancy status at each of the multiple time periods according to the predicted resource occupancy status of the tasks at each of the multiple time periods determined; determine whether the loss value between the predicted resource occupancy status at each of the multiple time periods and the actual resource occupancy status at each of the multiple time periods meets the preset loss condition; In the case that the loss value between the predicted resource occupancy status at each of the multiple time periods output by the BERT model to be trained and the actual resource occupancy status at each of the multiple time periods does not satisfy the preset loss condition, adjust the parameters in the BERT model to be trained.

4. The method according to claim 1, wherein, after training the resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model, the method further includes: obtaining a target task set scheduled in advance in a target future period and a set of scheduled time periods, wherein each scheduled time period in the set of scheduled time periods is the scheduling time period of the task in the target task set in the target future period; obtaining the predicted resource occupancy status at each target scheduling time period in the target scheduling time period set, and obtaining the average number of scheduled tasks at the target scheduling time period, wherein the predicted resource occupancy status at each target scheduling time period is the resource occupancy status determined according to the target resource prediction model; adjusting the number of tasks scheduled in advance at each scheduled time period in the target future period according to the set of scheduled time periods, the predicted resource occupancy status at each target scheduling time period, and the average number of scheduled tasks.

5. The method according to claim 4, wherein, the method further includes: obtaining second task scheduling historical information and second resource occupancy status information, wherein the second task scheduling historical information includes the scheduling characteristics of the tasks scheduled in the M historical periods before the target future period, each of the M historical periods includes the multiple time periods, M is an integer greater than or equal to 1, and the second resource occupancy status information includes the resource occupancy status labels of the tasks scheduled in the M historical periods; determining a target test sample set according to the second task scheduling historical information and the second resource occupancy status information, wherein each test sample in the target test sample set includes the scheduling characteristics and resource occupancy status labels of a task at a time period in a historical period, the scheduling characteristics and resource occupancy status labels of the parent task of the task at the previous time period of the time period in the historical period, and the scheduling characteristics and resource occupancy status labels of the sub-task of the task at the next time period of the time period in the previous historical period of the historical period, the M historical periods include the historical period and the previous historical period, and the scheduled tasks include the task, the parent task, and the sub-task; Input the target test sample set into the target resource prediction model to obtain the predicted resource occupancy status for each of the multiple time periods, where the target resource prediction model is used to determine the predicted resource occupancy status for each of the multiple time periods based on each test sample in the target test sample set, the target scheduling time period set is the multiple time periods, and the predicted resource occupancy status for each target scheduling time period in the target scheduling time period set is the predicted resource occupancy status for each of the multiple time periods.

6. The method according to claim 5, wherein, the step of inputting the target test sample set into the target resource prediction model to obtain the predicted resource occupancy status for each of the multiple time periods includes: sequentially input each test sample in the target test sample set into the target resource prediction model; in the target resource prediction model, based on the scheduling characteristics and resource occupancy status labels of the parent task of the one task in the previous time period of the one time period in the one historical cycle and the scheduling characteristics and resource occupancy status labels of the child tasks of the one task in the next time period of the one time period in the previous historical cycle of the one historical cycle, determine the predicted resource occupancy status of the one task in the one time period in the one historical cycle, and based on the determined predicted resource occupancy status of the tasks for each time period in the multiple time periods, determine the predicted resource occupancy status for each of the multiple time periods.

7. The method according to claim 4, wherein, the step of obtaining the average number of scheduled tasks for the target scheduling time period includes: when the target scheduling time period set is the multiple time periods and the multiple time periods are P time periods (where P is an integer greater than or equal to 2), obtain the total number of tasks scheduled in 1 historical cycle before the target future cycle; determine the average number of scheduled tasks to be equal to the value obtained by dividing the total number by P; or when the target scheduling time period set is the multiple time periods and the multiple time periods are P time periods (where P is an integer greater than or equal to 2) and Q is an integer greater than or equal to 2, obtain the total number of tasks scheduled in each of the Q historical cycles before the target future cycle to obtain Q total numbers; divide each of the Q total numbers by P to obtain Q values; determine the average number of scheduled tasks to be equal to the average of the Q values, or equal to the weighted sum of the Q values.

8. The method according to claim 4, wherein, the step of adjusting the number of tasks scheduled for each reservation scheduling time period in the target future cycle according to the reservation scheduling time period set, the predicted resource occupancy status for each target scheduling time period, and the average number of scheduled tasks includes: For each reservation scheduling period in the set of reservation scheduling periods, perform the following operations. When performing the following operations, each of the reservation scheduling periods is the current reservation scheduling period: Obtain the number of tasks reserved and scheduled during the current reservation scheduling period in the set of target tasks; When the number of tasks reserved and scheduled is less than or equal to the average number of scheduled tasks, keep the number of tasks reserved and scheduled during the current reservation scheduling period unchanged; When the number of tasks reserved and scheduled is greater than the average number of scheduled tasks, determine a target number of tasks among the tasks reserved and scheduled during the current reservation scheduling period, where the target number is equal to the difference between the number of tasks reserved and scheduled and the average number of scheduled tasks; according to the predicted resource occupancy status during the target scheduling period after the current reservation scheduling period, adjust the reservation scheduling period of the target number of tasks to one or more reservation scheduling periods after the current reservation scheduling period.

9. The method according to claim 8, wherein, the adjusting the reservation scheduling period of the target number of tasks to one or more reservation scheduling periods after the current reservation scheduling period according to the predicted resource occupancy status during the target scheduling period after the current reservation scheduling period includes: Search for the first reservation scheduling period that meets the first preset condition after the current reservation scheduling period, where the first preset condition includes: the predicted resource occupancy status during the same target scheduling period as the first reservation scheduling period indicates that the predicted resource utilization rate during the target scheduling period is less than the preset threshold, and the sum of the number of tasks reserved and scheduled during the first reservation scheduling period and the target number is less than or equal to the average number of scheduled tasks; when the first reservation scheduling period that meets the first preset condition is found, adjust the reservation scheduling period of the target number of tasks to the first reservation scheduling period that meets the first preset condition; or Find a first set of appointment scheduling time periods that meet the second preset condition after the current appointment scheduling time period, where the second preset condition includes: the predicted resource occupancy status on the target scheduling time period that is the same as each appointment scheduling time period in the first set of appointment scheduling time periods indicates that the predicted resource utilization rate on the target scheduling time period is less than the preset threshold, the number of tasks scheduled by appointment on each appointment scheduling time period in the first set of appointment scheduling time periods is less than the average number of scheduled tasks, and the sum of the differences between the number of tasks scheduled by appointment on each appointment scheduling time period and the average number of scheduled tasks is greater than or equal to the target number; in the case of finding the first set of appointment scheduling time periods that meet the second preset condition, adjust the appointment scheduling time period of each task in the target number of tasks to the corresponding appointment scheduling time period in the first set of appointment scheduling time periods, where the number of tasks scheduled by appointment on each appointment scheduling time period in the first set of appointment scheduling time periods after adjustment is less than or equal to the average number of scheduled tasks.

10. The method according to any one of claims 4 to 9, characterized in that after adjusting the number of tasks scheduled by appointment on each appointment scheduling time period in the target future period, the method further includes: on the current appointment scheduling time period in the target future period, detect whether all the tasks scheduled by appointment on the current appointment scheduling time period have been completed; when it is detected that all the tasks scheduled by appointment on the current appointment scheduling time period have been completed and there are still remaining resources on the current appointment scheduling time period, determine one or more tasks from the tasks scheduled by appointment on the appointment scheduling time periods after the current appointment scheduling time period; schedule the one or more tasks on the current appointment scheduling time period.

11. The method according to claim 10, characterized in that determining one or more tasks from the tasks scheduled by appointment on the appointment scheduling time periods after the current appointment scheduling time period includes: finding the first appointment scheduling time period that meets the third preset condition after the current appointment scheduling time period, where the third preset condition includes: the predicted resource occupancy status on the target scheduling time period that is the same as the first appointment scheduling time period indicates that the predicted resource utilization rate on the target scheduling time period is greater than or equal to the preset threshold; in the case of finding the first appointment scheduling time period that meets the third preset condition, determine the one or more tasks in the first appointment scheduling time period that meets the third preset condition.

12. The method according to any one of claims 4 to 9, characterized in that after adjusting the number of tasks scheduled by appointment on each appointment scheduling time period in the target future period, the method further includes: on the current appointment scheduling time period in the target future period, detect whether the resources on the current appointment scheduling time period are less than the resources required for the tasks scheduled by appointment on the current appointment scheduling time period to run; When it is detected that the resources in the current reservation scheduling period are less than the resources required for the task running reserved and scheduled in the current reservation scheduling period, determine one or more tasks among the tasks reserved and scheduled in the current reservation scheduling period; adjust the reservation scheduling period of the one or more tasks from the current reservation scheduling period to the reservation scheduling period after the current reservation scheduling period.

13. The method according to claim 12, wherein, the adjusting the reservation scheduling period of the one or more tasks from the current reservation scheduling period to the reservation scheduling period after the current reservation scheduling period includes: finding the first reservation scheduling period that meets the fourth preset condition after the current reservation scheduling period, wherein the fourth preset condition includes: the predicted resource occupancy status on the target scheduling period that is the same as the first reservation scheduling period indicates that the predicted resource utilization rate on the target scheduling period is less than a preset threshold; in the case of finding the first reservation scheduling period that meets the fourth preset condition, adjusting the reservation scheduling period of the one or more tasks from the current reservation scheduling period to the first reservation scheduling period that meets the fourth preset condition.

14. A task scheduling device based on a resource prediction model, wherein, it includes: an acquisition module, configured to acquire first task scheduling historical information and first resource occupancy status information, wherein the first task scheduling historical information includes the scheduling characteristics of the tasks scheduled in N historical periods, each historical period includes multiple time periods, N is an integer greater than or equal to 1, the first resource occupancy status information includes the resource occupancy status labels of the scheduled tasks, and the resource occupancy status labels are used to represent the resource occupancy status of the scheduled tasks; a determination module, configured to determine a target training sample set according to the first task scheduling historical information and the first resource occupancy status information, wherein each training sample in the target training sample set includes the scheduling characteristics and resource occupancy status labels of a task in a time period of a historical period, the scheduling characteristics and resource occupancy status labels of the parent task of the one task in the previous time period of the one time period in the historical period, and the scheduling characteristics and resource occupancy status labels of the child task of the one task in the next time period of the one time period in the previous historical period of the historical period, the N historical periods include the one historical period and the previous historical period, and the scheduled tasks include the one task, the parent task, and the child task; A training module, configured to train a resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model, wherein the resource prediction model to be trained is used to determine the predicted resource occupancy status of a task in a period of a historical period according to the scheduling characteristics and resource occupancy status labels of the parent task of the task in the previous period of the period in the historical period in each training sample in the target training sample set, and the scheduling characteristics and resource occupancy status labels of the sub - tasks of the task in the next period of the period in the previous historical period in the historical period, and determine the predicted resource occupancy status of each period in the multiple periods according to the predicted resource occupancy status of the task in each period in the determined multiple periods.

15. The apparatus according to claim 14, wherein, the apparatus is configured to train a resource prediction model to be trained according to the target training sample set to obtain a target resource prediction model in the following manner: Input each training sample in the target training sample set into the resource prediction model to be trained in sequence until the loss value between the predicted resource occupancy status of each period in the multiple periods output by the resource prediction model to be trained and the actual resource occupancy status of each period in the multiple periods meets a preset loss condition. Wherein, when the loss value between the predicted resource occupancy status of each period in the multiple periods output by the resource prediction model to be trained and the actual resource occupancy status of each period in the multiple periods does not meet the preset loss condition, adjust the parameters in the resource prediction model to be trained. The actual resource occupancy status of each period in the multiple periods is the resource occupancy status determined according to the scheduling characteristics and resource occupancy status labels of the task in a period of a historical period in each training sample.

16. The apparatus according to claim 15, wherein, the apparatus is configured to input each training sample in the target training sample set into the resource prediction model to be trained in sequence until the loss value between the predicted resource occupancy status of each period in the multiple periods output by the resource prediction model to be trained and the actual resource occupancy status of each period in the multiple periods meets a preset loss condition in the following manner: Repeat the following steps until the loss value between the predicted resource occupancy status of each period in the multiple periods output by the resource prediction model to be trained and the actual resource occupancy status of each period in the multiple periods meets a preset loss condition: Select a current training sample from the target training sample set and input the current training sample into the BERT model to be trained, wherein the resource prediction model to be trained is the BERT model to be trained; In the BERT model to be trained, according to the scheduling characteristics and resource occupancy status labels of the parent task of the one task in each training sample during the previous period of a period in the one historical period, and the scheduling characteristics and resource occupancy status labels of the subtasks of the one task during the next period of a period in the previous historical period of the one historical period, determine the predicted resource occupancy status of the one task during the one period in the one historical period, and according to the predicted resource occupancy status of the tasks during each period in the determined multiple periods, determine the predicted resource occupancy status of each period in the multiple periods; Determine whether the loss value between the predicted resource occupancy status of each period in the multiple periods and the actual resource occupancy status of each period in the multiple periods meets the preset loss condition; In the case where the loss value between the predicted resource occupancy status of each period in the multiple periods output by the BERT model to be trained and the actual resource occupancy status of each period in the multiple periods does not meet the preset loss condition, adjust the parameters in the BERT model to be trained.

17. The apparatus according to claim 14, wherein, after training the resource prediction model to be trained according to the target training sample set to obtain the target resource prediction model, the apparatus is further configured to: Obtain a target task set and a reserved scheduling period set reserved for scheduling in a target future period, wherein each reserved scheduling period in the reserved scheduling period set is the scheduling period of the tasks in the target task set in the target future period; Obtain the predicted resource occupancy status of each target scheduling period in the target scheduling period set, and obtain the average number of scheduled tasks on the target scheduling period, wherein the predicted resource occupancy status of each target scheduling period is the resource occupancy status determined according to the target resource prediction model; According to the reserved scheduling period set, the predicted resource occupancy status of each target scheduling period, and the average number of scheduled tasks, adjust the number of tasks reserved for scheduling in each reserved scheduling period in the target future period.

18. The apparatus according to claim 17, wherein, the apparatus is further configured to: Obtain second task scheduling historical information and second resource occupancy status information, wherein the second task scheduling historical information includes the scheduling characteristics of the tasks scheduled in M historical periods before the target future period, each of the M historical periods includes the multiple periods, M is an integer greater than or equal to 1, and the second resource occupancy status information includes the resource occupancy status labels of the tasks scheduled in the M historical periods; Determine a target test sample set according to the second task scheduling historical information and the second resource occupancy status information, wherein each test sample in the target test sample set includes scheduling characteristics and resource occupancy status labels of a task during a period in a historical cycle, scheduling characteristics and resource occupancy status labels of the parent task of the task during the previous period of the period in the historical cycle, and scheduling characteristics and resource occupancy status labels of the child task of the task during the next period of the period in the previous historical cycle of the historical cycle. The M historical cycles include the historical cycle and the previous historical cycle, and the scheduled tasks include the task, the parent task, and the child task; Input the target test sample set into the target resource prediction model to obtain the predicted resource occupancy status for each period in the multiple periods, wherein the target resource prediction model is used to determine the predicted resource occupancy status for each period in the multiple periods according to each test sample in the target test sample set. The target scheduling period set is the multiple periods, and the predicted resource occupancy status for each target scheduling period in the target scheduling period set is the predicted resource occupancy status for each period in the multiple periods.

19. The apparatus according to claim 18, wherein, The apparatus is configured to input the target test sample set into the target resource prediction model in the following manner to obtain the predicted resource occupancy status for each period in the multiple periods: Input each test sample in the target test sample set into the target resource prediction model in sequence; In the target resource prediction model, determine the predicted resource occupancy status of the task during the period in the historical cycle according to the scheduling characteristics and resource occupancy status labels of the parent task of the task during the previous period of the period in the historical cycle and the scheduling characteristics and resource occupancy status labels of the child task of the task during the next period of the period in the previous historical cycle of the historical cycle, and determine the predicted resource occupancy status for each period in the multiple periods according to the determined predicted resource occupancy status of the task for each period in the multiple periods.

20. The apparatus according to claim 17, wherein, The apparatus is configured to obtain the average number of scheduled tasks on the target scheduling period in the following manner: When the target scheduling period set is the multiple periods and the multiple periods are P periods, obtain the total number of tasks scheduled in 1 historical cycle before the target future cycle, where P is an integer greater than or equal to 2; determine the average number of scheduled tasks to be equal to the value obtained by dividing the total number by P; or When the set of target scheduling periods is the multiple periods and the multiple periods are P periods, obtain the total number of tasks scheduled in each of the Q historical periods before the target future period, obtaining Q total numbers, where P is an integer greater than or equal to 2 and Q is an integer greater than or equal to 2; divide each of the Q total numbers by P to obtain Q values; determine the average number of scheduled tasks to be equal to the average value of the Q values or equal to the weighted sum of the Q values.

21. The apparatus according to claim 17, wherein, the apparatus is configured to adjust the number of tasks scheduled in each reserved scheduling period in the target future period according to the set of reserved scheduling periods, the predicted resource occupancy status on each target scheduling period, and the average number of scheduled tasks in the following manner: For each reserved scheduling period in the set of reserved scheduling periods, perform the following operations, where when performing the following operations, each reserved scheduling period is the current reserved scheduling period: Obtain the number of tasks scheduled in the current reserved scheduling period in the set of target tasks; When the number of tasks scheduled is less than or equal to the average number of scheduled tasks, keep the number of tasks scheduled in the current reserved scheduling period unchanged; When the number of tasks scheduled is greater than the average number of scheduled tasks, determine the target number of tasks among the tasks scheduled in the current reserved scheduling period, where the target number is equal to the difference between the number of tasks scheduled and the average number of scheduled tasks; according to the predicted resource occupancy status on the target scheduling period after the current reserved scheduling period, adjust the reserved scheduling period of the target number of tasks to one or more reserved scheduling periods after the current reserved scheduling period.

22. The apparatus according to claim 21, wherein, the apparatus is configured to adjust the reserved scheduling period of the target number of tasks to one or more reserved scheduling periods after the current reserved scheduling period according to the predicted resource occupancy status on the target scheduling period after the current reserved scheduling period in the following manner: Search for the first reserved scheduling period that satisfies a first preset condition after the current reserved scheduling period, where the first preset condition includes: the predicted resource occupancy status on the target scheduling period that is the same as the first reserved scheduling period indicates that the predicted resource utilization rate on the target scheduling period is less than a preset threshold, and the sum of the number of tasks scheduled in the first reserved scheduling period and the target number is less than or equal to the average number of scheduled tasks; when the first reserved scheduling period that satisfies the first preset condition is found, adjust the reserved scheduling period of the target number of tasks to the first reserved scheduling period that satisfies the first preset condition; or Find a first set of reservation scheduling time periods that meet the second preset condition after the current reservation scheduling time period, where the second preset condition includes: the predicted resource occupancy status on the target scheduling time period that is the same as each reservation scheduling time period in the first set of reservation scheduling time periods indicates that the predicted resource utilization rate on the target scheduling time period is less than a preset threshold, the number of tasks scheduled by reservation on each reservation scheduling time period in the first set of reservation scheduling time periods is less than the average number of scheduled tasks, and the sum of the differences between the number of tasks scheduled by reservation on each reservation scheduling time period and the average number of scheduled tasks is greater than or equal to the target number; in the case where the first set of reservation scheduling time periods that meet the second preset condition is found, adjust the reservation scheduling time period of each task in the target number of tasks to the corresponding reservation scheduling time period in the first set of reservation scheduling time periods, where after the adjustment, the number of tasks scheduled by reservation on each reservation scheduling time period in the first set of reservation scheduling time periods is less than or equal to the average number of scheduled tasks.

23. The apparatus according to any one of claims 17 to 22, wherein, after adjusting the number of tasks scheduled by reservation on each reservation scheduling time period in the target future period, the apparatus is further configured to: on the current reservation scheduling time period in the target future period, detect whether all the tasks scheduled by reservation on the current reservation scheduling time period have finished running; when it is detected that all the tasks scheduled by reservation on the current reservation scheduling time period have finished running and there are still remaining resources on the current reservation scheduling time period, determine one or more tasks from the tasks scheduled by reservation on the reservation scheduling time periods after the current reservation scheduling time period; schedule the one or more tasks on the current reservation scheduling time period.

24. The apparatus according to claim 23, wherein, the apparatus is configured to determine one or more tasks from the tasks scheduled by reservation on the reservation scheduling time periods after the current reservation scheduling time period in the following manner: find the first reservation scheduling time period that meets the third preset condition after the current reservation scheduling time period, where the third preset condition includes: the predicted resource occupancy status on the target scheduling time period that is the same as the first reservation scheduling time period indicates that the predicted resource utilization rate on the target scheduling time period is greater than or equal to the preset threshold; in the case where the first reservation scheduling time period that meets the third preset condition is found, determine the one or more tasks in the first reservation scheduling time period that meets the third preset condition.

25. The apparatus according to any one of claims 17 to 22, wherein, after adjusting the number of tasks scheduled by reservation on each reservation scheduling time period in the target future period, the apparatus is further configured to: on the current reservation scheduling time period in the target future period, detect whether the resources on the current reservation scheduling time period are less than the resources required for the tasks scheduled by reservation on the current reservation scheduling time period to run; When it is detected that the resources in the current reservation scheduling period are less than the resources required for the task running of the reservation scheduling in the current reservation scheduling period, determine one or more tasks among the tasks of the reservation scheduling in the current reservation scheduling period; Adjust the reservation scheduling period of the one or more tasks from the current reservation scheduling period to the reservation scheduling period after the current reservation scheduling period.

26. The apparatus according to claim 25, wherein, The apparatus is configured to adjust the reservation scheduling period of the one or more tasks from the current reservation scheduling period to the reservation scheduling period after the current reservation scheduling period in the following manner: Search for the first reservation scheduling period that meets the fourth preset condition after the current reservation scheduling period, where the fourth preset condition includes: the predicted resource occupancy status in the target scheduling period that is the same as the first reservation scheduling period indicates that the predicted resource utilization rate in the target scheduling period is less than a preset threshold; In the case where the first reservation scheduling period that meets the fourth preset condition is found, adjust the reservation scheduling period of the one or more tasks from the current reservation scheduling period to the first reservation scheduling period that meets the fourth preset condition.

27. A computer-readable storage medium, wherein, The computer-readable storage medium includes a stored program, wherein the program can be executed by a terminal device or a computer to execute the method described in any one of claims 1 to 13.

28. A computer program product, comprising a computer program / instructions, wherein, The computer program / instructions, when executed by a processor, implement the steps of the method described in any one of claims 1 to 13.

29. An electronic device, comprising a memory and a processor, wherein, A computer program is stored in the memory, and the processor is configured to execute the method described in any one of claims 1 to 13 through the computer program.

Citation Information

Patent Citations

  • User conversion rate determination method and related equipment

    CN111709789A

  • Resource prediction method and device

    CN113485833A