Task processing method and device, electronic equipment, storage medium and program product
By predicting task information and querying task information of the same task category in the task list, resource requirements are predicted, which solves the problem of low task execution efficiency caused by insufficient resources and achieves high efficiency of task execution.
Patent Information
- Application Number
- CN202510828515.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-09-26
AI Technical Summary
When the system processes massive tasks, insufficient resource allocation causes tasks to be queued or fail to execute. Existing technologies are unable to flexibly respond to changes in resource demand, resulting in low task execution efficiency.
By predicting task information and querying task information with the same task category in the task list, resource requirements are predicted and a plan for executing tasks is determined to ensure sufficient resources.
It improves the efficiency of task execution and reduces the risk of task queuing or failure caused by insufficient resources.
Smart Images

Figure CN120704832A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a task processing method, device, electronic device, storage medium and program product. Background Art
[0002] In the field of electronics, executing tasks often requires computing resources. Computing resources refer to the combined hardware and software capabilities required to complete a computing task. When a system processes a massive volume of tasks, the number of tasks can vary significantly over time. In some time periods, the excessive number of tasks can lead to insufficient resources, forcing pending tasks to queue or even fail.
[0003] Manual resource scheduling consumes too much energy, and pre-configuring a fixed number of resources makes it difficult to adapt to flexible and changing resource demands. Insufficient resources in certain time periods reduce the system's task execution efficiency. Summary of the Invention
[0004] The embodiments of the present application provide a task processing method, device, electronic device and storage medium, which can improve task execution efficiency.
[0005] In a first aspect, an embodiment of the present application provides a task processing method, including: When a first task needs to be performed at a first time point, predicting first task information of the first task according to the first time point; Searching the task list for a second task executed at the first time point, and obtaining second task information of the second task, wherein the first task and the second task have the same task category; Predicting resource information required to execute the task at the first time point based on the first task information and the second task information; A plan for executing the task at the first time point is determined based on the resource information.
[0006] In a second aspect, an embodiment of the present application provides a task processing device, including: A prediction unit, configured to, when a first task needs to be executed at a first time point, predict first task information of the first task according to the first time point; a query unit, configured to query a task list for a second task executed at the first time point, and obtain second task information of the second task, wherein the first task and the second task have the same task category; The prediction unit is further configured to predict resource information required to execute the task at the first time point based on the first task information and the second task information; A determining unit is configured to determine a plan for executing the task at the first time point based on the resource information.
[0007] In a third aspect, an embodiment of the present application provides an electronic device comprising: a processor; and a memory configured to store computer-executable instructions, wherein the computer-executable instructions, when executed, cause the processor to perform the task processing method described in the first aspect.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium for storing computer-executable instructions, which, when executed by a processor, implement the task processing method as described in the first aspect.
[0009] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the task processing method described in the first aspect.
[0010] It can be seen that in the embodiment of the present application, first, when the first task needs to be executed at the first time point, the first task information of the first task is predicted based on the first time point; then, the second task to be executed at the first time point is queried in the task list, and the second task information of the second task is obtained, and the task category of the first task and the second task is the same; then, the resource information required to execute the task at the first time point is predicted based on the first task information and the second task information; finally, the plan for executing the task at the first time point is determined based on the resource information. In this embodiment, considering that the second task is in the task list and the first task is outside the task list, by predicting the task information of the first task and obtaining the task information of the second task, the resource information consumed by each task can be predicted using the obtained task information, and then the plan for executing the task at the first time point is determined based on the resource information, so that there are sufficient resources when executing the task at the first time point, reducing the risk of task queuing or task execution failure due to insufficient resources, and improving the task execution efficiency overall. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments described in this specification. Those skilled in the art can also derive other drawings based on these drawings without inventive work. Figure 1 A schematic diagram of an implementation environment for a task processing method provided in an embodiment of the present application; Figure 2 A processing flow chart of a task processing method provided in an embodiment of the present application; Figure 3 A processing flow chart of another task processing method provided in an embodiment of the present application; Figure 4 A partial processing flow chart of resource scheduling in another task processing method provided in an embodiment of the present application; Figure 5 Another partial processing flow chart for resource scheduling in another task processing method provided in an embodiment of the present application; Figure 6 A processing flow chart of the data collection and preprocessing module provided in an embodiment of the present application; Figure 7A A schematic diagram of a first model in a training phase in another task processing method provided in an embodiment of the present application; Figure 7B A schematic diagram of the first model in the reasoning stage in another task processing method provided in an embodiment of the present application; Figure 8A A schematic diagram of a second model in a training phase in another task processing method provided in an embodiment of the present application; Figure 8B A schematic diagram of the second model in the reasoning stage in another task processing method provided in an embodiment of the present application; Figure 9 A schematic diagram of a task processing device provided in an embodiment of the present application; Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0012] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0013] When the system is processing massive tasks, it may encounter various unexpected situations. The pre-configured fixed amount of computing resources performs relatively poorly in dealing with unexpected situations.
[0014] For example, when the number of tasks surges, if resources are unevenly distributed or insufficient, tasks may wait in line for a long time or fail after waiting in line for a long time, resulting in low resource utilization, reduced task response speed, and reduced task execution efficiency.
[0015] Manual resource scheduling is often delayed, and in scenarios involving massive tasks, manual resource scheduling requires too much manpower and material resources, is inefficient, and is not suitable as the main resource scheduling method; if a specific number of computing resources is configured for a time period, it can have a certain effect in alleviating the surge in the number of scheduled tasks, but when non-scheduled tasks occur frequently, task execution may still be limited by computing resources, resulting in low overall task execution efficiency of the system.
[0016] Therefore, in order to solve the above problems, an embodiment of the present application provides a task processing method.
[0017] The task processing method provided in one or more embodiments of this specification may be applicable to an implementation environment of the task processing method, which implementation environment at least includes a server 101 for processing tasks.
[0018] The server 101 may be a single server, or a server cluster consisting of several servers, or one or more cloud servers in a cloud computing platform for resource scheduling.
[0019] In this implementation environment, when the server 101 is processing tasks, first, when the first task needs to be executed at the first time point, the first task information of the first task is predicted based on the first time point; then, the second task to be executed at the first time point is searched in the task list, and the second task information of the second task is obtained, and the task category of the first task and the second task is the same; then, the resource information required to execute the task at the first time point is predicted based on the first task information and the second task information; finally, the plan for executing the task at the first time point is determined based on the resource information. In this embodiment, considering that the second task is in the task list and the first task is outside the task list, by predicting the task information of the first task and obtaining the task information of the second task, the resource information consumed by each task can be predicted using the obtained task information, and then the plan for executing the task at the first time point is determined based on the resource information, so that there are sufficient resources when executing the task at the first time point, reducing the risk of task queuing or task execution failure due to insufficient resources, and improving the overall efficiency of task execution.
[0020] Figure 2 This is a flowchart of a task processing method provided in an embodiment of the present application. Figure 2 The task processing method provided in this embodiment specifically includes steps S202 to S208.
[0021] Step S202 : When a first task needs to be executed at a first time point, first task information of the first task is predicted according to the first time point.
[0022] The first time point may be the next time point closest to the current time point in a preconfigured time sequence. The preconfigured time sequence may include multiple time points arranged in chronological order. The current time point may be the time point at which step S202 is executed. For example, the time sequence includes: time point T1, time point T2, time point T3, and so on. In chronological order, if the current time point T4 is between time point T1 and time point T2, then the next time point closest to the current time point T4 may be obtained in the time sequence: time point T2, and time point T2 may be used as the first time point.
[0023] The first time point may also be any predetermined time point. For example, the predetermined first time point includes: 10 o'clock, 12 o'clock, and 14 o'clock.
[0024] The first time point may also be a selected time point determined based on a first input. The first input may be a single click on the timeline, a time text input in an input box, or any other input that can be used to select a time point. For example, a user enters "time point T1" in the input box to trigger the system to set time point T1 as the first time point and execute the task processing method provided in this embodiment.
[0025] In this embodiment, the system may be an execution subject of the task processing method provided in this embodiment, or may be a system running on the execution subject of the task processing method provided in this embodiment.
[0026] A task can be a processing job or an analysis job that needs to be processed.
[0027] Processing tasks focus on the specific processing, transformation, and handling of data or tasks to achieve specific business functions. For example, in the data processing field, processing tasks may include data cleansing, data conversion, file format conversion, data encryption, and other operations. In business processes, processing tasks can include order processing, inventory management, production process control, etc. For example, tasks can include data cleansing tasks, data conversion tasks, file format conversion tasks, data encryption tasks, and so on.
[0028] Analytical tasks primarily involve in-depth research and evaluation of data to extract valuable information, discover patterns, and support decision-making. These tasks typically utilize various analytical methods and tools, such as statistical analysis, data mining, and machine learning algorithms. For example, a market analysis task might analyze sales data to understand consumer behavior, market trends, and product popularity. Tasks can include statistical analysis, data mining, model training, and more.
[0029] The first task in this embodiment can be a task that is temporarily generated and executed. "Temporarily generated and executed" can be triggered by user behavior or by a specified event, etc. This embodiment does not specifically limit the triggering method of the first task. For example, the first task includes task B1 and task B2. At time point t1, user A creates task B1 and instructs the system to execute task B1; at time point t2, when the event "the value of indicator 1 is greater than the first threshold" is detected, the system automatically creates task B2 and executes it, and so on.
[0030] It's important to note that when users pre-configure scheduled tasks, while there may be user interaction during the task configuration process, the scheduled task's execution time and frequency are regular, so the scheduled task does not qualify as a first task. For example, a user configures the system to execute Task A once a day at 10:00 AM. After the configuration is complete, the user no longer participates in Task A, allowing the system to automatically execute it. This Task A does not qualify as a first task.
[0031] Task information represents various aspects and related details of the corresponding task. Exemplarily, the first task information of the first task includes: basic information of the first task and attributes of the first task, wherein the basic information is used to define the core identity and logic of the task, and is the minimum necessary description for task scheduling. The basic information includes but is not limited to: task identification, task name, task type, task target, input data, output data, etc.; the attribute user controls the behavior strategy and resource management of the task, and the attributes include but are not limited to: priority, execution time, timeout time, resource requirements, etc. In actual applications, the specific content of the first task information can be flexibly configured in combination with the scenario. Among the various information related to the first task, any information that can be used as a reference for resource prediction can be used as the first task information.
[0032] The resource requirements described above refer to the computing resource requirements of the first task, which can include CPU (Central Processing Unit), memory, and I / O (Input / Output). In task scheduling and resource management scenarios, the resource requirements in the task's attributes may include pre-estimated computing resource values. These resource requirements may or may not match the actual computing resource values consumed during task execution.
[0033] In the case where the first task needs to be executed at the first time point, the first task information of the first task is predicted based on the first time point. This can be specifically achieved in the following manner: the first time point is input into a pre-trained prediction model to perform prediction processing on the task identifier of the first task that needs to be executed at the first time point to obtain a prediction result; if the prediction result is empty, it is determined that the first task does not need to be executed at the first time point; if the prediction result includes one or more task identifiers, it is determined that the first task needs to be executed at the first time point, and the task information of the corresponding task is obtained in a preset storage area according to each task identifier, and the obtained task information is used as the first task information of the first task.
[0034] The prediction model can be any machine learning model with prediction capabilities. For example, the prediction model can be composed of a Convolutional Neural Network (CNN) and a Long Short-Term Memory (LSTM), with the CNN output serving as the LSTM input.
[0035] In this embodiment, during the training phase of the prediction model, the input data may include the third time point and user behavior information of performing the first task, and the output data may include a task identifier representing the first task.
[0036] Among them, the third time point can be any predetermined time point. User behavior analysis (UserBehavior Analysis) can refer to identifying the user's usage habits and preferences by collecting and analyzing a series of operation records of the user in the system, including but not limited to information such as the time, frequency, task type, and resource requirements of task submission. Specifically in this embodiment, a series of operation records of the user in the system may include user behavior information for performing the first task. Exemplarily, the user behavior information for performing the first task includes one or more of the following: the time when the user submits the first task, the frequency with which the user submits the first task, the task type selected by the user for the first task, the resource requirements configured by the user for the first task, and so on.
[0037] For example, a training sample X1 is generated based on a third time point t1 and user behavior information, and the training sample X1 carries a sample label Y1. The sample label Y1 is a task identifier that can be used to retrieve task information for the corresponding task from a preset storage area. During iterative training of the prediction model, the training sample X1 can be input into the prediction model to predict the task identifier of the first task to be executed at time point t1, obtaining a prediction result Y1'. A training loss is generated based on the prediction result Y1' and the sample label Y1, and the model parameters of the prediction model are adjusted using the training loss.
[0038] In this embodiment, in the reasoning stage of the prediction model, that is, in the process of inputting the first time point into the pre-trained prediction model to perform predictive processing of the task identifier of the first task that needs to be executed at the first time point, the input data of the prediction model includes the first time point, and the output data of the prediction model includes one or more task identifiers of the first task.
[0039] For example, the first time point a1 is input into the prediction model to perform prediction processing on the task identifier of the first task that needs to be executed at the first time point a1, resulting in the following: task identifier "001" and task identifier "002". Task identifier "001" is the task identifier of the first task S1 that needs to be executed at the first time point a1. This task identifier "001" can be used to obtain the basic information and attributes of the corresponding task in the preset storage area. Task identifier "002" is the task identifier of the first task S2 that needs to be executed at the first time point a1. This task identifier "002" can be used to obtain the basic information and attributes of the corresponding task in the preset storage area.
[0040] It should be noted that in the training stage of the prediction model, the user behavior information of executing the first task can be used to enable the prediction model to learn user behavior patterns that are related to time and the first task. Then, in the reasoning stage of the prediction model, the "first time point" of the input model and the pre-learned user behavior patterns can be used to jointly realize the prediction of the task identifier.
[0041] The preset storage area may be a database or other data storage area. The preset storage area may store the task identifier and the task information corresponding to the task identifier.
[0042] In the case where the first task needs to be executed at the first time point, the first task information of the first task is predicted based on the first time point. It can also be that based on the first time point, one or more execution records matching the first time point and the execution time of each execution record are queried in the historical execution record of the first task; the execution frequency of executing the first task at the first time point is determined based on the execution time of each execution record; the first task that needs to be executed at the first time point is predicted based on the execution frequency and the execution time of each record to obtain a prediction result; if the prediction result is empty, it is determined that the first task does not need to be executed at the first time point; if the prediction result includes one or more first tasks, it is determined that the first task needs to be executed at the first time point, and the corresponding task information is obtained in the preset storage area according to the task identifier of each first task, and the obtained task information is used as the first task information of the first task.
[0043] Each execution record in the above historical execution records may include one or more of the following information of the corresponding task: basic information, attributes, task execution results, type and amount of computing resources consumed during task execution, etc. Among them, attributes may include task execution time.
[0044] Based on the first time point, one or more execution records that match the first time point are searched in the historical execution records of the first task. For example, the first time point is 10 o'clock, and the historical execution records of the first task include: record 1, record 2, record 3, and so on. Among them, the execution time included in record 1 is: x1 month y1 day 10 o'clock; the execution time included in record 2 is: x1 month y2 day 10 o'clock; the execution time included in record 3 is: x1 month y1 day 13 o'clock. Based on the first time point "10 o'clock", the execution records that match "10 o'clock" can be found in records 1, record 2, and record 3, including: record 1 and record 2.
[0045] For another example, based on the first time point T1, one or more execution records matching T1 are searched in the historical execution records of the first task, and the following are obtained: record 001, record 002, and record 003. The execution time of record 001 is obtained: time point T1 on X month A day, the execution time of record 002 is obtained: time point T1 on X month B day, and the execution time of record 003 is obtained: time point T1 on X month C day. Based on the execution time of each execution record, the execution frequency of executing the first task at the first time point is determined to be f1. Based on the execution frequency f1 and the execution time of each record, it is predicted that the first task to be executed at T1 is task S1, and then the task identifier "S01" of task S1 is used to query the basic information and attributes of the corresponding task in the database, and the query result is used as the first task information.
[0046] In addition, after step S202 is executed and before step S204 is executed, data cleaning can be performed on the obtained first task information. Through data cleaning, invalid or erroneous data records can be removed, thereby reducing the interference of poor-quality data on subsequent prediction operations and improving prediction accuracy.
[0047] In a specific implementation, the first task information is predicted by the first model, and the training method of the first model includes: extracting features of the second time point and user behavior sample information to obtain a third feature; extracting features of the identification information of the training sample task to generate a fourth feature; and training the first model based on the third feature and the fourth feature.
[0048] The first model can be any machine learning model with a prediction function, and reference can be made to the corresponding description of the prediction model described above. The task processing method provided in this embodiment can include a training method for the first model.
[0049] The first task information is predicted using the first model, which means that the first task information of the first task is predicted based on the first time point using the first model. In the process of predicting the first task information of the first task based on the first time point using the first model, the first time point can be input into the first model to perform prediction processing on the task identifier of the first task to be executed at the first time point, thereby obtaining a prediction result; if the prediction result includes one or more task identifiers, it is determined that the first task needs to be executed at the first time point, and task information corresponding to each task identifier is obtained from a preset storage area, and the obtained task information is used as the first task information of the first task.
[0050] The second time point may be any predetermined time point, and reference may be made to the corresponding description of the first time point mentioned above.
[0051] User behavior sample information can be generated based on historical user data. This information includes, but is not limited to, the time when the user submitted the first task, the frequency with which the user submitted the first task, the task type selected by the user for the first task, and the resource requirements configured by the user for the first task. For more information about user behavior sample information, refer to the description of user behavior information for executing the first task.
[0052] The third feature may be a vector, and the third feature may be used as a training sample for the first model. Each training sample may be an independent data record in a data set used for model training, and the independent data record may be a set of features input into the model during the model training process.
[0053] The training sample task refers to the first task corresponding to the third feature, and the identification information of the training sample task may be the task identifier of the first task corresponding to the third feature.
[0054] The fourth feature can be another vector different from the third feature, and the third feature can serve as the sample label of the training sample of the first model. The sample label refers to the correct answer or target value corresponding to the sample, which is the target to be predicted by the model.
[0055] In the process of extracting features from the second time point and user behavior sample information to obtain the third feature, the following steps can be performed: based on the second time point, determine the first sub-information that matches the second time point in the user behavior sample information, and generate the third feature based on the second time point and the first sub-information.
[0056] For example, the second time point is t1. Based on the second time point t1, first behavior sample information matching the second time point t1 is determined in the user behavior sample information. This first behavior sample information includes: the time t1 when the user submitted the first task S1, the frequency f1 at which the user submitted the first task S1, the task type X1 selected by the user for the first task S1, and the resource requirement "8GB storage resources" configured by the user for the first task S1; the time t1 when the user submitted the first task S2, the frequency f2 at which the user submitted the first task S2, the task type X2 selected by the user for the first task S2, and the resource requirement "32GB storage resources" configured by the user for the first task S2. A first vector V1 is constructed based on t1, f1, X1, and "8GB storage resources." A first vector V2 is constructed based on t1, f2, X2, and "32GB storage resources." The first vector V1 and the first vector V2 are combined to obtain a third feature. Furthermore, considering that the first tasks corresponding to the third feature include the first task S1 and the first task S2, the first tasks S1 and S2 can be determined as training sample tasks.
[0057] Feature extraction is performed on the identification information of the training sample task to generate the fourth feature, and the identification information of the training sample task may be encoded to obtain the fourth feature.
[0058] The first model is trained according to the third feature and the fourth feature, and the third feature and the fourth feature are input into the first model for iterative training.
[0059] Exemplarily, the training process of the first model is as follows: (a1) Initialization parameters: Set the initial weights and other model parameters of the first model.
[0060] (a2) Define the loss function: Select the mean square error loss function as the loss function for model training of the first model.
[0061] (a3) Data partitioning: Divide the data for model training into training set, validation set, and test set.
[0062] Specific division method: Divide the data randomly and divide the data into the following proportions: 70% training set, 15% validation set, and 15% test set.
[0063] The model training data refers to the sample data used in the model training of the first model. The sample data may be composed of a third feature representing the training sample and a fourth feature representing the sample label. In this embodiment, constructing the sample data includes: extracting features from the second time point and the user behavior sample information to obtain the third feature; and extracting features from the identification information of the training sample task to generate the fourth feature.
[0064] (a4) Model training: Use the data in the training set to train the first model and calculate the loss value.
[0065] That is, the first model is trained based on the third feature and the fourth feature.
[0066] (a5) Model evaluation: Evaluate the performance and accuracy of the first model using the test set data.
[0067] (a6) Model parameter adjustment: Adjust the parameters of the first model according to the calculated evaluation results to reduce the loss value until the training end condition is met.
[0068] The training end condition may be satisfied when the number of training times reaches a preset threshold, or when the loss value is less than a preset loss threshold, etc.
[0069] In this embodiment, by using user behavior sample information to construct training samples in the training stage of the first model, and using the identification information of the training sample tasks to construct sample labels, the first model can learn the user behavior patterns related to the first task during the model training process, as well as the potential connection between the second time point, the user behavior patterns and the identification information of the first task. Then, the trained first model is used to predict the task identification of the first task, which can improve the prediction accuracy.
[0070] In a specific implementation, feature extraction is performed on the second time point and user behavior sample information to obtain a third feature, including: determining a first time period based on the second time point and a preset time length; the end time of the first time period is the second time point, and the time length of the first time period is the preset time length; performing time series feature extraction on the user behavior sample information of the first time period to obtain a fourth sub-feature; performing feature extraction on the second time point to generate a fifth sub-feature; and generating a third feature based on the fourth sub-feature and the fifth sub-feature.
[0071] The preset time length can be custom configured, for example, one month.
[0072] The first time period is determined based on the second time point and the preset time length. For example, if the second time point is 10:00 on the 20th day of the month Y of the year X and the preset time length is one month, then the first time period can be from 10:00 on the 20th day of the month (Y-1) of the year X to 10:00 on the 20th day of the month Y of the year X. The start time of the first time period, "10:00 on the 20th day of the month (Y-1) of the year X", is determined by the second time point and the preset time length. The end time of the first time period, "10:00 on the 20th day of the month Y of the year X", is the second time point. The length of the first time period is the preset time length, "one month".
[0073] Time series features are features extracted from time series data that can reflect the patterns or laws of data over time. Time series data can be a set of values arranged in chronological order.
[0074] In this embodiment, illustratively, the time series features include but are not limited to: operation time series and behavior attenuation effect features.
[0075] The operation time series can be a numerical sequence or multidimensional data sequence arranged in chronological order, with each time point corresponding to one or more indicator values. For example, a user submits a first task 1 of a first task type at time point T1, a first task 2 of the first task type at time point T2, and a first task 3 of a second task type at time point T3. This generates the following operation time series: (T1, 001), (T2, 001), (T3, 002), where time point T1 precedes time point T2, which precedes time point T3. The indicator value corresponding to time point T1 is the task type identifier "001" for first task 1, the indicator value corresponding to time point T2 is the task type identifier "001" for first task 2, and the indicator value corresponding to time point T3 is the task type identifier "002" for first task 3. Due to similar concepts, an operation time series corresponding to multiple indicator values at each time point can refer to the example of an operation time series corresponding to a single indicator value at each time point.
[0076] The behavioral decay effect feature refers to the regularity that a certain behavior or reaction gradually weakens, fades, or becomes less efficient over time, with an increase in the number of repetitions, or with changes in the environment. Specifically in this embodiment, in the process of task creation, allocation, execution, and management, the user's behavior pattern (such as response speed, operation frequency, task processing quality, etc.) shows a systematic weakening or declining efficiency trend over time, with an increase in the number of task repetitions, or with changes in task attributes (such as urgency and complexity). This decay reflects the dynamic changes in the user's interaction habits, attention allocation, or operation strategy with the task scheduling system. Based on the above content, the behavioral decay effect feature can be extracted from the user behavior sample information. For example, based on the user's behavior sample information at time points T1, time points T2, and time points T3, a decay curve of the time consumed in task processing can be extracted.
[0077] Time sensitivity refers to the sensitivity, dependency, or dynamic response pattern of an entity (such as individual behavior, events, system responses, or data metrics) to time changes. It is an abstract temporal correlation characteristic, reflecting the mechanism by which the time dimension influences the entity's state, performance, or results. In this embodiment, for example, time sensitivity can be extracted from user behavior sample information on weekdays and holidays, as well as from user behavior sample information during peak and off-peak hours.
[0078] Temporal feature extraction is performed on the user behavior sample information of the first time period to obtain a fourth sub-feature, which can represent one or more of temporal features such as operation time series, behavior attenuation effect feature, and time sensitivity feature.
[0079] The feature extraction is performed on the second time point to generate the fifth sub-feature. The second time point may be encoded to obtain the fifth sub-feature representing the second time point.
[0080] The third feature is generated according to the fourth sub-feature and the fifth sub-feature. The third feature can be obtained by concatenating the fourth sub-feature and the fifth sub-feature.
[0081] In this embodiment, user behavior sample information from a period of time before the second time point is used to generate a training sample corresponding to the second time point. This is because some user behavior patterns may need to be extracted from a large amount of user behavior data accumulated over a period of time. For example, if the first task is only performed once, it is impossible to tell whether a behavior decay effect exists, and it is difficult to extract the behavior decay effect characteristics from the user behavior sample information. In addition, if the first task is only performed once or twice, it may not be possible to extract time sensitivity characteristics related to a specific time period from the user behavior sample information. By aggregating user behavior sample information from the most recent period of time, the first model can be helped to learn user behavior patterns related to time.
[0082] In addition, when the first task does not need to be executed at the first time point, there is no need to execute subsequent steps, and the current task processing flow can be terminated.
[0083] Step S204 : searching the task list for a second task executed at the first time point, and obtaining second task information of the second task. The first task and the second task have the same task category.
[0084] The second task may be a task executed according to a preset time period. For example, the second task includes Task A. The preset time period of Task A is 24 hours, and the system executes Task A once every day at 10 o'clock.
[0085] If the second task is executed according to a preset time period, the task list can be predetermined and generated based on the preset time period and a custom-configured initial time point. For example, for task A, the initial time point is T1 and the preset time period is L. Based on T1 and the preset time period, the task execution times determined include: T1, (T1+L), (T1+2L), (T1+3L), and so on. Furthermore, a task list can be generated based on the task execution time of each second task. The task list can include one or more second tasks and the task execution time of each second task.
[0086] The second task can also be any other task with a predetermined execution time. For example, the second task includes Task B. The trigger condition of Task B is: Task B will be executed one hour after Trigger Condition X is met. Assuming that Trigger Condition X is met at 10:00, Task B can be scheduled to be executed at 11:00.
[0087] The task list for the second task can be adjusted based on the trigger condition. For example, in the initial task list, the system does not execute any tasks. When trigger condition X is met at 10:00, the system inserts Task B at 11:00 in the task list. In other words, the system predetermines the execution time of Task B at 10:00 and adjusts the task list accordingly.
[0088] A task list may include one or more information combinations, each of which includes a time point and one or more second tasks to be executed at that time point. For example, a task list may include: (time point T1: second task a1, second task a2), (time point T2: second task b1), (time point T3: second task c1), and so on.
[0089] In addition, considering that the list can be regarded as a specific implementation method of the data set, this embodiment can also adopt the data set in combination with the specific application scenario, or adopt other specific implementation methods of the data set to replace the above-mentioned task list. For example, the second task executed at the first time point is queried in a predetermined data pair set, and the data pair set includes one or more data pairs, each data pair consists of a second task and the task execution time of the second task.
[0090] Query the task list for the second task executed at the first time point. For example, the first time point is time point T2. Query the task list based on the first time point to obtain an information combination that matches the first time point T2 (time point T2: second task b1). Use the second task b1 in the information combination as the second task executed at the first time point.
[0091] Task information represents various aspects and related details of the corresponding task. Exemplarily, the second task information of the second task includes: basic information of the second task and attributes of the second task, wherein the basic information is used to define the core identity and logic of the task, and is the minimum necessary description for task scheduling. The basic information includes but is not limited to: task identification, task name, task type, task target, input data, output data, etc.; attribute users control the behavioral strategy and resource management of the task, and the attributes include but are not limited to: priority, execution time, timeout time, resource requirements, etc. In actual applications, the specific content of the second task information can be flexibly configured in combination with the scenario. Among the various information related to the second task, any information that can be used as a reference for resource prediction can be used as the second task information. The second task information can refer to the corresponding description of the first task information.
[0092] The second task information of the second task can be stored in a preset storage area. After the second task is determined, a task identifier for the second task can be obtained, and the second task information of the second task can be retrieved from the preset storage area using the task identifier. The first task information of the first task and the second task information of the second task can be stored in the same preset storage area or in different preset storage areas.
[0093] The first task and the second task have the same task category. In this embodiment, the same task category means that the first task and the second task have the same task characteristics, can be classified into the same task category, and can share the resource set corresponding to the task category.
[0094] A resource pool is a logical or physical aggregation of resources with common attributes or functions, forming a manageable and schedulable unit. For example, a resource pool might include 16 cores and 16GB of storage. In the example "16 cores and 16GB," "core" refers to the CPU, "16 cores" refers to the number of CPUs, and "GB" represents the storage capacity in gigabytes (GB). "16GB" refers to the storage capacity of 16GB.
[0095] For example, the first task includes a temporarily generated data cleaning task a1, whose task category is "data cleaning." The second task includes a scheduled data cleaning task b1, whose task category is "data cleaning." Data cleaning tasks a1 and b1 have the same task category. The resource set corresponding to the task category "data cleaning" includes 100GB of storage resources. Data cleaning tasks a1 and b1 can each use a portion of this 100GB of storage resources.
[0096] It should be emphasized that the "task category" in this embodiment is not the same concept as the "task type" included in the basic information in the previous text. In this embodiment, the "task category" can be regarded as the product of coarse-grained classification of each task, and the "task type" can be regarded as the product of fine-grained classification of each task. "Coarse-grained" and "fine-grained" are relative concepts. For example, if each task is coarse-grainedly classified, based on the classification results, it can be determined that the task category of the first task a2 is "risk control", and the task category of the second task b2 is "risk control"; if each task is fine-grainedly classified, based on the classification results, it can be determined that the task type of the first task a2 is "anomaly detection", and the task type of the second task b2 is "credit scoring". That is, two tasks with different task types may belong to the same task category.
[0097] Considering that tasks in the same task category may have strong correlation and similar computing requirements, computing resources from the same source can be used. In this embodiment, by configuring the first task and the second task to have the same task category, the first task and the second task can be jointly predicted whether the computing resources in the resource set corresponding to the task category are sufficient.
[0098] Based on a similar concept, the "task categories of the first task and the second task are the same" in step S204 can also be replaced by the following technical features: the first task and the second task correspond to the same resource set; and together with the other processing steps of this embodiment, a new implementation method is formed.
[0099] For example, both the first and second tasks belong to the first business domain, and they correspond to the same resource set: the resource set of the first business domain. A first business domain is any predetermined business domain. A business domain refers to a core business area within an organization, with clear boundaries, specific goals, and independent functions. It reflects the organization's specialized division of labor in a specific market or industry, and is typically organized around core business processes, product lines, or customer needs.
[0100] In addition, after obtaining the second task information, the obtained data can be cleaned. Through data cleaning, invalid or erroneous data records can be removed, thereby reducing the interference of poor-quality data on subsequent prediction operations and improving prediction accuracy.
[0101] Step S206 : predicting resource information required to execute the task at the first time point based on the first task information and the second task information.
[0102] Predicting the resource information required to execute the task at the first time point based on the first task information and the second task information can be: predicting the resources consumed by executing the first task at the first time point based on the first task information to obtain a first prediction result, and predicting the resources consumed by executing the second task at the first time point based on the second task information to obtain a second prediction result; generating the resource information consumed by executing the task at the first time point based on the first prediction result and the second prediction result.
[0103] Resource information can include the quantity of a specified resource, or it can include both the resource type and the resource quantity. Resource types include, but are not limited to, CPU, memory, network bandwidth, and storage resources. For example, if the resource type is CPU, the resource quantity can be the number of CPUs, CPU utilization, and so on.
[0104] For example, the resource information consumed by executing a task at the first time point may include 2 cores and 4 GB. In the above "2 cores and 4 GB", "core" refers to the CPU, "2 cores" refers to the number of CPUs, "G" represents the storage capacity in GB, and "4 GB" refers to the storage capacity of 4 GB.
[0105] In a specific implementation method, resource information required to execute a task at a first time point is predicted based on the first task information and the second task information, including: extracting features of the first task information to obtain a first feature of the first task information, and predicting resource consumption information for executing the first task at the first time point based on the first feature; extracting features of the second task information to obtain a second feature of the second task information, and predicting resource consumption information for executing the second task at the first time point based on the second feature; and determining resource information based on the resource consumption information of the first task and the resource consumption information of the second task.
[0106] Feature extraction is performed on the first task information to obtain a first feature of the first task information, and resource consumption information of executing the first task at a first time point is predicted based on the first feature.
[0107] It should be emphasized that the first task information includes the first time point. On this basis, the first feature obtained by extracting features from the first task information can be used to predict resource consumption information of executing the first task at the first time point.
[0108] Feature extraction is performed on the first task information to obtain a first feature of the first task information. This can be performed by encoding the first task information to obtain the first feature. For example, the first task information includes: task identifier "002", task name "B", task type "data analysis", input data "indicator x2", output data "data analysis result of indicator x2", priority "R3", execution time "t2", resource requirements "number of first resources s3, number of second resources s4, number of third resources s5", etc. The first task information is encoded to obtain a vector, which is used as the first feature.
[0109] Predicting resource consumption information for executing the first task at the first time point based on the first feature can be performed by inputting the first feature into a second model to predict the resources consumed for executing the first task at the first time point, thereby obtaining resource consumption information for executing the first task at the first time point.
[0110] Resource consumption information can include the quantity of a specific resource, or it can include both the resource type and the resource quantity. Resource types include, but are not limited to, CPU, memory, network bandwidth, and storage resources. For example, if the resource type is CPU, the resource quantity can be the number of CPUs or CPU utilization, among other things.
[0111] The number of the first tasks can be one or more, and the second model processes the first features of each first task in the same manner.
[0112] The second model can be any machine learning model with predictive capabilities. For example, the second model can be composed of a CNN and an LSTM, with the CNN output serving as the LSTM input. It should be noted that the model structure of the first model and the model structure of the second model can be the same or different, the input data of the first model and the input data of the second model are different, and the output data of the first model and the output data of the second model are different. Therefore, the first model and the second model are two different models.
[0113] The training method of the second model includes: extracting features from sample task information to obtain a fifth feature; the sample task information includes a fourth time point; extracting features from identification information of the training sample task to generate a fourth feature; and training the first model based on the third and fourth features.
[0114] In this embodiment, during the training phase of the second model, the input data may include a fifth feature generated based on task information of a sample task, the sample task information including a fourth time point, and the output data may include resource consumption information of executing the sample task at the fourth time point. The fourth time point may be the execution time of the sample task.
[0115] For example, the task information of sample task 1 includes: task identifier "001", task name "A", task type "anomaly detection", input data "indicator x1", output data "detection result of indicator x1", priority "R2", execution time "t1", resource requirements "the number of first resources s1 and the number of second resources s2", etc. Feature extraction is performed on the task information of sample task 1 to obtain the fifth feature X1. During the training process, the fifth feature X1 is input into the second model to predict the resources consumed in executing sample task 1 at "t1" to obtain resource consumption information: the types of resources include first resources and second resources, where the number of first resources is s1' and the number of second resources is s2'.
[0116] In this embodiment, in the reasoning stage of the second model, specifically, in the process of inputting the first feature into the second model to predict the resources consumed in executing the first task at the first time point, and obtaining the resource consumption information of executing the first task at the first time point, the input data of the second model includes the first feature, and the first feature is obtained by feature extraction of the first task information, and the first task information includes the first time point, and the output data of the second model includes the resource consumption information of executing the first task at the first time point.
[0117] For example, the first task information of the first task 1 includes: task ID "002", task name "B", task type "data analysis", input data "indicator x2", output data "data analysis result of indicator x2", priority "R3", execution time "t2", resource requirements "number of first resources s3, number of second resources s4, number of third resources s5", etc. Feature extraction is performed on the first task information of the first task 1 to obtain the first feature x1.
[0118] The first task information for Task 2 includes the following: task ID "003", task name "C", task type "data cleaning", input data "data table 1", output data "cleaned data table 1", priority "R2", execution time "t2", resource requirements "number of first resources s6, number of second resources s7", etc. Feature extraction is performed on the first task information for Task 2 to obtain the first feature x2.
[0119] Input the first feature x1 into the second model to predict the resources consumed by executing the first task 1 at "t2", and obtain the resource consumption information for executing the first task 1 at the first time point: the types of resources include first resources, second resources, and third resources, where the quantity of first resources is s3', the quantity of second resources is s4', and the quantity of third resources is s5'. Input the first feature x2 into the second model to predict the resources consumed by executing the first task 2 at "t2", and obtain the resource consumption information for executing the first task 2 at the first time point: the types of resources include first resources and second resources, where the quantity of first resources is s6', and the quantity of second resources is s7'.
[0120] It should be emphasized that although the first task information of the first task may include resource requirements, for the same first task, the resource requirements of the first task and the resource consumption information of executing the first task at the first time point predicted by the second model may be different, and the resource requirements cannot directly replace the resource consumption information. Resource requirements refer to the estimated amount of resources declared when the task is submitted. The resource requirements can be pre-set by the user or the system and fixed before the task runs. Resource consumption information refers to the actual amount of resources occupied when the task runs, and the resource consumption information may fluctuate over time. Therefore, in this embodiment, when the resource requirements are known, there is still a need to predict resource consumption information. By predicting resource consumption information, sufficient preparations can be made before the task is executed, reducing the risk of task queuing or task processing failure due to insufficient resources, thereby improving the overall task processing efficiency.
[0121] Due to the same concept, feature extraction is performed on the second task information to obtain the second feature of the second task information, and resource consumption information for executing the second task at the first time point is predicted based on the second feature. Please refer to the corresponding description part of "feature extraction is performed on the first task information to obtain the first feature of the first task information, and resource consumption information for executing the first task at the first time point is predicted based on the first feature".
[0122] In this embodiment, the resource consumption is predicted using the pre-trained second model, which can fully utilize the learning ability of the machine learning model to improve the prediction accuracy.
[0123] Determining the resource information based on the resource consumption information of the first task and the resource consumption information of the second task may be to sum the resource consumption information of the first task and the resource consumption information of the second task to obtain the resource information consumed by executing the task at the first time point.
[0124] For example, the resource consumption information for executing the first task at the first time point includes: the types of resources include first resources, second resources, and third resources, where the quantity of first resources is s3', the quantity of second resources is s4', and the quantity of third resources is s5'. The resource consumption information for executing the second task at the first time point includes: the types of resources include first resources, where the quantity of first resources is s8'. The resource consumption information of the first task and the resource consumption information of the second task are summed to obtain resource information, which includes: the types of resources include first resources, second resources, and third resources, where the quantity of first resources is (s3'+s8'), the quantity of second resources is s4', and the quantity of third resources is s5'.
[0125] The resource information may be determined based on the resource consumption information of the first task and the resource consumption information of the second task, or based on the resource consumption information of the first task, the backup resource information of the first task, the resource consumption information of the second task, and the backup resource information of the second task.
[0126] For example, the resource types only involve first resources. The pre-configured backup resource information for each first task indicates that the quantity of the specified resource (i.e., the first resource) is s1, and the backup resource information for each second task indicates that the quantity of the first resource is s2. When two first tasks and one second task are executed at a first point in time, the resource consumption information of first task 1 indicates that the quantity of the first resource is S1, the resource consumption information of first task 2 indicates that the quantity of the first resource is S2, and the resource consumption information of second task 1 indicates that the quantity of the first resource is S3. Based on the resource consumption information of the first task, the backup resource information of the first task, the resource consumption information of the second task, and the backup resource information of the second task, the resource information is determined to be (S1+s1)+(S2+s1)+(S3+s2).
[0127] In this embodiment, by configuring the backup resource information, more resources can be reserved based on the model prediction results, which can reduce the risk of insufficient resources due to unexpected load during task execution and improve system stability.
[0128] Resource information may be determined based on the resource consumption information of the first task and the resource consumption information of the second task. Alternatively, the resource consumption information of the first task and the resource consumption information of the second task may be used as the resource information. In other words, the resource consumption information of each task can be directly aggregated to form the resource information without summing the same type of resources across different tasks.
[0129] In this embodiment, the resource consumption information of each task can provide a reference basis for subsequent task scheduling, so that sufficient preparation can be made before task execution, reducing the risk of task queuing or task processing failure due to insufficient resources, and improving task processing efficiency as a whole.
[0130] In addition, the resources consumed in executing the first task at the first time point are predicted based on the first task information to obtain the first prediction result. Alternatively, the resources consumed in executing the first task at the first time point are predicted based on the resource requirements and preset ratio values in the first task information to obtain the first prediction result.
[0131] Similarly, the resources consumed in executing the second task at the first time point can be predicted based on the second task information to obtain a second prediction result. Alternatively, the resources consumed in executing the second task at the first time point can be predicted based on the resource requirements and preset ratio values in the second task information to obtain a second prediction result.
[0132] For example, the resource requirements in the first task information include: the quantity of the first resource is k1, and the quantity of the second resource is k2. The preset ratio value is a%, where a can be a positive or negative real number, and the specific value can be configured based on the application scenario. Based on the resource requirements in the first task information and the preset ratio value, the resources consumed by executing the first task at the first time point are predicted, resulting in a first prediction result: the quantity of the first resource is k1*(1+a%), and the quantity of the second resource is k2*(1+a%).
[0133] In this embodiment, by configuring a preset ratio value, the amount of resources consumed during the actual task execution can be more accurately predicted in combination with the specific application scenario, thereby reducing the risk of insufficient resources due to unexpected load during task execution and improving system stability.
[0134] For another example, the resource requirements in the first task information include: the number of the first resource is k3. The resource requirements in the second task information include: the number of the first resource is k4. The preset ratio value corresponding to the first task is b%, b can be a positive real number or a negative real number, and the specific value can be configured in combination with the application scenario. The preset ratio value corresponding to the second task is c%, c can be a positive real number or a negative real number, and the specific value can be configured in combination with the application scenario. The values of b and c can be the same or different. Based on the resource requirements and the preset ratio values in the first task information, the resources consumed in executing the first task at the first time point are predicted, and a first prediction result is obtained: the number of the first resource is k3*(1+b%). Based on the resource requirements and the preset ratio values in the second task information, the resources consumed in executing the second task at the first time point are predicted, and a second prediction result is obtained: the number of the first resource is k4*(1+c%).
[0135] In this embodiment, by configuring different preset ratio thresholds for the first task and the second task, the amount of resources consumed during the actual task execution can be more accurately predicted in combination with the specific application scenario, thereby reducing the risk of insufficient resources due to unexpected load during task execution and improving system stability.
[0136] In a specific implementation, the first task information includes first sub-information representing a numerical value, second sub-information representing a category, and third sub-information representing a time series; feature extraction is performed on the first task information to obtain a first feature of the first task information, including: normalizing the first sub-information to obtain a first sub-feature of the first sub-information; performing one-hot encoding on the second sub-information to obtain a second sub-feature of the second sub-information; processing the third sub-information through a sliding window function to obtain a third sub-feature of the third sub-information; and obtaining the first feature based on the first sub-feature, the second sub-feature, and the third sub-feature.
[0137] The first sub-information may represent a numerical value. For example, the first sub-information may include: execution time, CPU utilization, memory usage, etc.
[0138] Normalization is a data processing method that aims to transform data into a specific range or distribution for easier analysis, comparison, and modeling. Normalizing the first sub-information to obtain its first sub-feature can involve mapping a numerical value represented by the first sub-information to another numerical value between [0, 1], and using this other numerical value as the first sub-feature. Normalizing the numerical value of the first sub-information ensures consistency between features at different scales.
[0139] The second sub-information may represent a category. The second sub-information is one-hot encoded to obtain a second sub-feature of the second sub-information, which may be a binary vector. For example, the second sub-information may include: task type, priority, etc.
[0140] One-hot encoding (IHE) is an encoding method that converts categorical data into machine-readable digital features. The basic idea of IHE is to map each category into a unique binary vector, in which only the position corresponding to the category is 1, and all other positions are 0. IHE can convert the secondary information representing the category into multiple binary features. For example, task types include: Type 1, Type 2, and Type 3. If the task type is Type 1, it can be encoded as [0, 0, 1]; if the task type is Type 2, it can be encoded as [0, 1, 0]; and if the task type is Type 3, it can be encoded as [1, 0, 0]. For another example, priority levels include: S1, S2, S3, and S4. If the priority is S1, the priority can be encoded as [0, 0, 0, 1]; if the priority is S2, the priority can be encoded as [0, 0, 1, 0]; if the priority is S3, the priority can be encoded as [0, 1, 0, 0]; if the priority is S4, the priority can be encoded as [1, 0, 0, 0].
[0141] The third sub-information may represent a time series, and the third sub-information may be a feature that changes over time. For example, the third sub-information may include: CPU utilization, memory usage, etc.
[0142] The third sub-information is processed using a sliding window function to obtain its third sub-feature. A sliding window function is a concept in stream processing and time series analysis. It is used to perform calculations on continuously changing subsets (called "windows") of a dynamic data stream. It slides a fixed-size window across the data stream, performing aggregation operations on the data within the window after each slide, such as summing, averaging, and finding the maximum value. The third sub-feature can be time series data. By constructing time series data, temporal trends can be captured.
[0143] The first feature is obtained according to the first sub-feature, the second sub-feature and the third sub-feature. The first feature can be obtained by combining the first sub-feature, the second sub-feature and the third sub-feature.
[0144] In another implementation, the first task information may also include at least one of the first sub-information, the second sub-information, and the third sub-information. In this case, the feature extraction of the first task information and the specific implementation process of obtaining the first feature of the first task information can refer to the corresponding description above.
[0145] Step S208: determining a plan for executing the task at the first time point according to the resource information.
[0146] The scheme for executing the task at the first time point is determined based on the resource information consumed by executing the task at the first time point. The scheme for executing the task at the first time point can be used to indicate which tasks are actually executed at the first time point.
[0147] In practical applications, task execution may be subject to resource constraints. If the number of resources required to execute a task exceeds the number of available resources, the task may be queued or fail, thereby reducing task execution efficiency. In this embodiment, by predicting resource information in advance for the first time point and using this resource information to determine a plan for executing the task, the risk of task execution failure due to insufficient resources can be reduced, thereby improving task execution efficiency.
[0148] In a specific implementation, the resource information includes a first quantity of a first resource consumed in executing a task at a first point in time, and a scheme for executing the task at the first point in time is determined based on the resource information, including: in response to the first quantity being less than or equal to the quantity of resources in the first resource set, determining to execute the first task and the second task at the first point in time, and the task category of the task corresponding to the first resource set is the same as the task category of the first task; in response to the first quantity being greater than the quantity of resources in the first resource set, obtaining a second quantity of resources from the second resource set based on the difference between the first quantity and the quantity of resources in the first resource set, and determining to execute the first task and the second task at the first point in time if the second quantity of resources is obtained; or, in response to the first quantity being greater than the quantity of resources in the first resource set, determining priority information of the first task and the second task, and determining the task to be executed at the first point in time in the first task and the second task based on the priority information and the third quantity of the first resources consumed in executing the first task in the resource information and the fourth quantity of the first resources consumed in executing the second task in the resource information.
[0149] The resource information includes a first quantity of a first resource consumed in executing the task at a first point in time. This embodiment uses a first resource as an example to illustrate the specific implementation process of step S208. When the resource information involves multiple first resources, reference may be made to the corresponding description portion of a first resource. The first resource may be any type of resource. For example, the first resource may be one of a CPU, memory, network bandwidth, and storage resource. Taking the first resource being a CPU as an example, the first quantity may represent the number of CPUs, or may represent CPU utilization, and so on.
[0150] In response to the first quantity being less than or equal to the quantity of resources in the first resource set, it is determined that the first task and the second task are to be executed at the first time point, and the task category of the task corresponding to the first resource set is the same as the task category of the first task. Considering that the task category of the first task is the same as the task category of the second task, the task category of the task corresponding to the first resource set, the task category of the first task, and the task category of the second task are all the same, the first resource in the first resource set can be used during the execution of the first task, and the first resource in the first resource set can be used during the execution of the second task.
[0151] The number of resources in the first resource set refers to the number of first resources in the first resource set that are in an idle state. The state of the first resource may include at least an occupied state and an idle state, wherein the occupied state indicates that the corresponding first resource has been occupied by other tasks, and the idle state indicates that the corresponding first resource is available.
[0152] The first quantity is less than or equal to the quantity of resources in the first resource set, indicating that the quantity of first resources required to be consumed during task execution is less than or equal to the quantity of first resources available to the system, that is, there are sufficient resources at the first time point. In this case, it can be determined that the first task and the second task are to be executed at the first time point, wherein the first task refers to the first task that needs to be executed at the first time point determined by executing step S202, and the second task refers to the second task to be executed at the first time point determined by executing step S204.
[0153] For example, the first time point is 11 o'clock. The resource information predicted at 10:55 includes the first quantity S1 of storage resources consumed by the task executed at 11 o'clock. The first tasks to be executed at 11 o'clock include: Task 1 and Task 2, and the second tasks to be executed at 11 o'clock include: Task 3 and Task 4. The first quantity S1 is used to represent the total amount of storage resources required to execute Task 1, Task 2, Task 3 and Task 4 at 11 o'clock. The number of idle storage resources in the first resource set is S1'.
[0154] S1 is less than or equal to S1', indicating that there are sufficient resources to execute Task 1, Task 2, Task 3, and Task 4 at 11:00. Therefore, the plan for executing tasks at 11:00 is to execute Task 1, Task 2, Task 3, and Task 4.
[0155] In response to the first number being greater than the number of resources in the first set of resources, one of the following may be performed: (a1) Acquire a second quantity of resources from the second resource set based on a difference between the first quantity and the quantity of resources in the first resource set; and determine to execute the first task and the second task at the first time point when the second quantity of resources is acquired.
[0156] (a2) Priority information of the first task and the second task is determined, and based on the priority information and the third amount of the first resource consumed by executing the first task in the resource information and the fourth amount of the first resource consumed by executing the second task in the resource information, the task to be executed at the first time point is determined between the first task and the second task.
[0157] That is, in one implementation, when the first quantity is greater than the number of resources in the first resource set, the above step (a1) is performed. In another implementation, when the first quantity is greater than the number of resources in the first resource set, the above step (a2) is performed.
[0158] Alternatively, the above step (a1) may be performed first, and then the above step (a2) may be performed if the second amount of resources is not acquired.
[0159] Alternatively, the above step (a2) may be performed first, and then the above step (a1) may be performed if the number of tasks executed at the first time point is less than a preset number threshold.
[0160] Alternatively, the switching condition between step (a1) and step (a2) may be flexibly configured according to actual needs.
[0161] The first quantity is greater than the quantity of resources in the first resource set, indicating that the quantity of first resources required to be consumed during task execution is greater than the quantity of first resources available in the system, that is, resources are insufficient at the first time point.
[0162] The above step (a1) can be considered as performing resource scheduling first. If the resource scheduling succeeds, a plan for executing the task at the first time point is determined. In addition, if the resource scheduling fails, a prompt indicating insufficient resources can be generated.
[0163] Resource scheduling refers to the process of dynamically allocating computing resources (such as CPU, memory, network bandwidth, storage, etc.) based on task requirements and system status to optimize overall performance, efficiency, or cost.
[0164] Obtaining a second quantity of resources from the second resource set based on the difference between the first quantity and the quantity of resources in the first resource set may be determining the second quantity based on the difference between the first quantity and the quantity of resources in the first resource set, and obtaining the second quantity of resources from the second resource set.
[0165] The second quantity is determined based on the difference between the first quantity and the number of resources in the first resource set. For example, if the first quantity is S1 and the number of resources in the first resource set is S2, the second quantity can be (S1-S2). For another example, if the number of pre-configured standby resources is s1, the first quantity is S1, and the number of resources in the first resource set is S2, the second quantity can be (S1-S2+s1).
[0166] The second resource set may be any resource set other than the first resource set. The task category of the task corresponding to the second resource set is different from the task category of the task corresponding to the first resource set.
[0167] In this embodiment, resource scheduling ensures that the system has sufficient resources to execute tasks. Resource prediction effectively prevents users from creating sporadic tasks on the spur of the moment, leading to insufficient resources and task failures or task queues. Preemptive resource scheduling provides sufficient resources for task execution, reduces task queues, shortens task response times, and improves overall task execution efficiency. The above step (a2) can be understood as reducing the number of tasks to be executed at the first time point so that the available resources are sufficient to support the execution of the tasks at the first time point.
[0168] Priority information can be a task attribute, indicating the priority of the task. For each task, you can pre-configure the corresponding priority information. For example, the priority information of the first task 1 is R1, the priority information of the first task 2 is R2, the priority information of the second task 1 is R3, and the priority information of the second task 2 is R3. Sorting the priority information from high to low, the result is: R3>R2>R1.
[0169] Determining the priority information of the first task may involve obtaining the priority information of the first task from the first task information. Determining the priority information of the second task may involve obtaining the priority information of the second task from the second task information.
[0170] The resource information may include a third amount of the first resource consumed by executing each first task, and a fourth amount of the first resource consumed by executing each second task. For example, the resource information may relate to the following tasks: First Task 1, First Task 2, Second Task 1, and Second Task 2. The resource information may include that the amount of storage resources consumed by executing First Task 1 is 6GB, the amount of storage resources consumed by executing First Task 2 is 5GB, the amount of storage resources consumed by executing Second Task 1 is 8GB, and the amount of storage resources consumed by executing Second Task 2 is 3GB. That is, the third amount includes 6GB and 5GB, and the fourth amount includes 8GB and 3GB.
[0171] Based on the priority information and the third quantity of the first resource consumed by executing the first task in the resource information and the fourth quantity of the first resource consumed by executing the second task in the resource information, the task to be executed at the first point in time is determined in the first task and the second task. The task with the lowest priority can be eliminated from the first task and the second task based on the priority information, the third quantity and the fourth quantity, until the sum of the quantities of the first resources consumed by the remaining tasks is less than or equal to the quantity of resources in the first resource set, and the remaining tasks are regarded as the tasks to be executed at the first point in time.
[0172] For example, the number of resources in the first resource set is: 20GB of storage resources. The third number includes 6GB and 5GB, and the fourth number includes 8GB and 3GB. Executing Task 1, Task 2, Task 1, and Task 2 requires a total of 22GB of storage resources. Therefore, the first number "22GB" is greater than the number of resources "20GB" in the first resource set. The priority information of Task 1 is R1, the priority information of Task 2 is R2, the priority information of Task 1 is R3, and the priority information of Task 2 is R3. Sorting the priority information from high to low, the result is: R3>R2>R1. According to the priority information, the third quantity, and the fourth quantity, it can be determined among the first task 1, the first task 2, the second task 1, and the second task 2 that the tasks to be executed at the first time point include: the first task 2, the second task 1, and the second task 2. 5G+8G+3G=16G<20G. It can be seen that a total of 16G of storage resources are required to execute the first task 2, the second task 1, and the second task 2 at the first time point. The system has 20G of available storage resources, and the resources are sufficient.
[0173] In addition, considering that in actual applications, it may happen that although Task 1 has a lower priority than Task 2 and Task 1 should be eliminated first, the amount of the first resource consumed in executing Task 1 is relatively small, and the amount of the first resource consumed in executing Task 1 is relatively large, and this amount is greater than the number of resources in the first resource set, then both Task 1 and Task 2 are eliminated, and no task is executed at the first time point, which is not conducive to improving task execution efficiency. Therefore, when the number of remaining tasks is less than or equal to the preset task number threshold, the task with the lowest priority will no longer be eliminated, but the task to be executed at the first time point will be determined among the remaining tasks based on the third number and the fourth number.
[0174] For example, the remaining tasks include: the first task 1 and the second task 1. The priority information of the first task 1 is R1, and the priority information of the second task 1 is R2, R1<R2, that is, the priority of the first task 1 is less than the priority of the second task 1. The number of remaining tasks is less than or equal to the preset task number threshold "2". The amount of storage resources consumed in executing the first task 1 is 6G, and the amount of storage resources consumed in executing the second task 1 is 25G. The number of resources in the first resource set is: storage resources 20G. Based on the third quantity "6G" and the fourth quantity "25G", the tasks determined to be executed at the first time point in the first task 1 and the second task 1 include: the first task 1.
[0175] After determining which tasks are executed at the first time point among the first and second tasks, the execution time of each eliminated task can be updated. Specifically, the execution time of each eliminated task can be updated from the first time point to the second time point, where the second time point is after the first time point. For example, the first task includes Task 1 and Task 2. The second task includes Task 3. After determining that Task 3 is the task executed at time t1 among Task 1, Task 2, and Task 3, the execution time of Task 1 and Task 2 can be moved back to time t2.
[0176] In this embodiment, by postponing the execution time of low-priority tasks, the resource demand at the first time point can be reduced, which indirectly makes the resources at the first time point sufficient, ensures successful task execution, and reduces the waiting time of tasks.
[0177] In a specific implementation, the task processing method also includes: in response to the resource quantity of the third resource set being greater than a preset resource quantity threshold, updating the priority and execution time of the unprocessed task corresponding to the third resource set; the third resource set is any one of the first resource set and each second resource set.
[0178] In the task processing method provided in the embodiments of the present application, the resource quantity of each resource set can also be obtained according to a predetermined time period. Each resource set can correspond to one or more clusters. A cluster refers to connecting multiple computers (or servers, or devices) through software and a network, enabling them to work together and appear as a unified system.
[0179] For the third resource set, if the resource quantity of the third resource set is less than or equal to the preset resource quantity threshold, no special operation is required; if the resource quantity of the third resource set is greater than the preset resource quantity threshold, the priority and execution time of the unprocessed tasks corresponding to the third resource set are updated.
[0180] The third resource set may be any one of the first resource set and each of the second resource sets.
[0181] Taking the third resource set as the first resource set as an example for exemplary explanation: the unprocessed task corresponding to the first resource set can be any task whose execution time is after the first time point among the tasks corresponding to the first resource set, and the resources in the first resource set can be used during the execution of this task.
[0182] Specifically, the priority and execution time of the unprocessed tasks corresponding to the third resource set are updated, which may be to increase the priority of the unprocessed tasks to make them higher, and also to move the execution time forward.
[0183] When the number of resources in the third resource set is greater than the preset resource number threshold, it means that the resources in the third resource set are relatively abundant and more tasks can be executed. By updating the task priority and execution time, the resource utilization rate can be improved, the task queuing during the peak period can be reduced, and the task execution efficiency can be improved overall.
[0184] In such Figure 2 In the embodiment shown, first, when the first task needs to be executed at the first time point, the first task information of the first task is predicted based on the first time point; then, the second task to be executed at the first time point is searched in the task list, and the second task information of the second task is obtained, and the task category of the first task and the second task is the same; then, the resource information required to execute the task at the first time point is predicted based on the first task information and the second task information; finally, the plan for executing the task at the first time point is determined based on the resource information. In this embodiment, considering that the second task is in the task list and the first task is outside the task list, by predicting the task information of the first task and obtaining the task information of the second task, the resource information consumed by each task can be predicted using the obtained task information, and then the plan for executing the task at the first time point is determined based on the resource information, so that sufficient resources are available when executing the task at the first time point, reducing the risk of task queuing or task execution failure due to insufficient resources, and improving the overall efficiency of task execution.
[0185] Based on the same technical concept, the embodiment of the present application also provides another task processing method, which can be combined with Figure 3-Figure 6 Common explanation. Figure 3 A processing flow chart of another task processing method provided in an embodiment of the present application.
[0186] like Figure 3 As shown, in step S302, the scheduling task starts at a fixed time.
[0187] Step S304: Obtain the task to be executed at the next time node.
[0188] This step can refer to the above Figure 2 The corresponding description part of “searching the task list for the second task executed at the first time point” in step S204 in the embodiment.
[0189] Step S306: predicting the task that the user needs to perform at the next time point.
[0190] This step can refer to the above Figure 2 Step S202 in the embodiment. That is, in some implementations, it is also possible to exchange Figure 2 The execution order of some steps of the task processing method shown is: first execute step S204, then execute step S202, then execute step S206, and finally execute step S208.
[0191] Step S308: predicting that a task needs to be executed.
[0192] Figure 3 The user behavior prediction model in Figure 2 The first model in the embodiment.
[0193] Step S310: predicting the resources consumed by the task.
[0194] Figure 3 The resource consumption prediction model in Figure 2 The second model in the embodiment.
[0195] Step S312: output the resources that need to be consumed.
[0196] The above steps S310 to S312 can refer to the above Figure 2 The corresponding description part of step S206 in the embodiment.
[0197] Step S314: Automatically coordinate computer resources of the cluster.
[0198] Step S316: Check whether the resources are sufficient.
[0199] If sufficient, execute step S318; if insufficient, execute step S328.
[0200] Step S318, executed in the resource cluster.
[0201] Step S320: regularly checking the resource status and resource remaining status during the task execution.
[0202] Step S322: Check whether there are any remaining available resources.
[0203] If there are remaining available resources, step S324 is executed; otherwise, no special operation is required.
[0204] Step S324: Adjust the task execution time according to the task priority.
[0205] Step S326: Modify the priority and execution time of the task.
[0206] Step S328: Self-service coordination of resources from other business domains.
[0207] Step S330: Check whether the resources are sufficient after coordination.
[0208] If sufficient, execute step S318; if insufficient, execute step S332 Step S332: Warning of insufficient resources.
[0209] Steps S314 to S332 can refer to the above Figure 2 The corresponding description part of step S208 in the embodiment.
[0210] Figure 4 A local processing flow chart for resource scheduling in another task processing method provided in an embodiment of the present application.
[0211] Step S402: Retrieve cluster resources based on the total required resources.
[0212] Step S404: Check whether the queue resources are sufficient.
[0213] If sufficient, execute step S412; if insufficient, execute step S406.
[0214] Step S406: Coordinate resources from other business domains.
[0215] Step S408: Check whether the resources are sufficient after coordination.
[0216] If sufficient, execute step S412; if insufficient, execute step S410 Step S410: Adjust the execution time of the task according to the priority.
[0217] Step S412: The task is executed normally.
[0218] Figure 5 This is another partial processing flowchart for resource scheduling in another task processing method provided in an embodiment of the present application.
[0219] Step S502: The scheduled task checks the business domain cluster resources.
[0220] Step S504: Dynamically adjust the priority and execution time of the task.
[0221] Step S506: The priority and execution time of the task are not adjusted.
[0222] Figure 6 This is a processing flow chart of the data collection and preprocessing module provided in the embodiment of the present application. The data collection and preprocessing module can refer to Figure 3 shown.
[0223] Step S602: data collection.
[0224] Obtaining basic task attributes, task execution data, resource data during task execution, and user behavior data. After obtaining the above data, the obtained data can be preprocessed.
[0225] Step S604: data cleaning.
[0226] Clear invalid or erroneous data records.
[0227] Step S606: data storage.
[0228] Store the data in the data storage middleware for subsequent feature extraction and model training. Figure 2 For the corresponding description of the “first feature data” in the embodiment, please refer to the model training. Figure 2 Corresponding description of the training process of the first model and the corresponding description of the training process of the second model in the embodiment.
[0229] Figure 7A A schematic diagram of a first model in a training phase in another task processing method provided in an embodiment of the present application; Figure 7B A schematic diagram of the first model in the reasoning stage in another task processing method provided in an embodiment of the present application.
[0230] like Figure 7A As shown, exemplarily, in the training phase of the first model 708, the input data of the first model 708 includes: the second time point 702, the user behavior sample information 704 and the identification information 706 of the training sample task. The training phase of the first model 708 can refer to Figure 2 Corresponding description of the training process of the first model in the embodiment: The second time point 702 and the user behavior sample information 704 can be used to generate training samples, and the identification information 706 of the training sample task can be used to generate sample labels for the training samples.
[0231] like Figure 7B As shown, in the inference phase of the first model 708, the input data of the first model 708 is the task execution time 710, and the output data of the first model 708 is the task identifier 712 of the first task to be executed at the first time point. Figure 2After obtaining the task identifier 712, the first task information 714 can be obtained in the preset storage area based on the task identifier 712. The first task information 714 includes basic task information 7142 and task attributes 7144. The reasoning stage of the first model 708 can be referred to Figure 2 Corresponding description of step S202 in the embodiment.
[0232] It should be emphasized that during the training phase of the first model 708, the user behavior sample information 704 can be used to enable the first model 708 to learn user behavior patterns that are related to time and the first task. Then, during the reasoning phase of the first model 708, the task execution time 710 of the input model and the pre-learned user behavior patterns can be used to jointly predict the task identifier 712.
[0233] Figure 8A A schematic diagram of a second model in a training phase in another task processing method provided in an embodiment of the present application; Figure 8B A schematic diagram of the second model in the reasoning stage in another task processing method provided in an embodiment of the present application.
[0234] like Figure 8A As shown, in the training phase of the second model 804, the input data of the second model 804 is the task information 802, which includes: basic information 8022 of the task, attributes 8024 of the task, and resource consumption 8026 of the task. Figure 2 Corresponding description of step S206 in the embodiment.
[0235] like Figure 8B As shown, in the inference phase of the second model 804, the input data of the second model 804 is the task information 806, and the output data of the second model 804 is the resource information 808 consumed by executing the task at the first time point. The resource information 808 includes the virtual cores 8082 consumed by the task and the memory 8084 of the task. For details, please refer to Figure 2 Corresponding description of step S206 in the embodiment.
[0236] Since the technical concept is the same, the description in this embodiment is relatively simple, and the relevant parts can refer to the corresponding description of the method embodiment provided above.
[0237] An embodiment of a task processing device provided in this specification is as follows: In the above embodiment, a task processing method is provided. Based on the same technical concept, the embodiment of the present application also provides a task processing device, which is described below with reference to the accompanying drawings.
[0238] Figure 9This is a schematic diagram of a task processing device provided in an embodiment of the present application. This embodiment provides a task processing device 900, including: The prediction unit 902 is configured to predict first task information of the first task according to the first time point when the first task needs to be executed at the first time point; a query unit 904 configured to query the task list for a second task executed at the first time point, and obtain second task information of the second task, wherein the first task and the second task have the same task category; The prediction unit 902 is further configured to predict resource information required to execute the task at the first time point based on the first task information and the second task information; The determining unit 906 is configured to determine a plan for executing the task at the first time point according to the resource information.
[0239] Optionally, the resource information includes a first quantity of a first resource consumed by executing the task at the first time point. When determining a plan for executing the task at the first time point based on the resource information, the determining unit 906 performs the following steps: In response to the first quantity being less than or equal to the quantity of resources in the first resource set, determining to execute the first task and the second task at the first time point, the task category of the task corresponding to the first resource set being the same as the task category of the first task; In response to the first quantity being greater than the number of resources in the first resource set, a second quantity of resources is obtained from the second resource set based on the difference between the first quantity and the number of resources in the first resource set, and when the second quantity of resources is obtained, it is determined to execute the first task and the second task at the first time point; or, in response to the first quantity being greater than the number of resources in the first resource set, priority information of the first task and the second task is determined, and the task to be executed at the first time point is determined among the first task and the second task based on the priority information and the third quantity of the first resources consumed by executing the first task in the resource information and the fourth quantity of the first resources consumed by executing the second task in the resource information.
[0240] Optionally, when predicting the resource information required to execute the task at the first time point based on the first task information and the second task information, the prediction unit 902 performs the following steps: performing feature extraction on the first task information to obtain a first feature of the first task information, and predicting resource consumption information for executing the first task at the first time point based on the first feature; performing feature extraction on the second task information to obtain a second feature of the second task information, and predicting resource consumption information of executing the second task at the first time point based on the second feature; The resource information is determined according to the resource consumption information of the first task and the resource consumption information of the second task.
[0241] Optionally, the first task information includes first sub-information representing a numerical value, second sub-information representing a category, and third sub-information representing a time series; when the prediction unit 902 extracts features from the first task information to obtain a first feature of the first task information, the prediction unit 902 performs the following steps: performing normalization processing on the first sub-information to obtain a first sub-feature of the first sub-information; Performing one-hot encoding on the second sub-information to obtain a second sub-feature of the second sub-information; Processing the third sub-information through a sliding window function to obtain a third sub-feature of the third sub-information; The first feature is obtained according to the first sub-feature, the second sub-feature, and the third sub-feature.
[0242] Optionally, the task processing device 900 further includes: An updating unit is used to update the priority and execution time of the unprocessed tasks corresponding to the third resource set in response to the resource quantity of the third resource set being greater than a preset resource quantity threshold; the third resource set is any one of the first resource set and each of the second resource sets.
[0243] Optionally, the first task information is obtained by prediction using a first model, and the task processing apparatus 900 further includes a training unit, which is specifically configured to: Extract features from the second time point and the user behavior sample information to obtain a third feature; Extracting features from the identification information of the training sample tasks to generate a fourth feature; The first model is trained according to the third feature and the fourth feature.
[0244] Optionally, when the training unit extracts features from the second time point and the user behavior sample information to obtain a third feature, the training unit performs the following steps: Determine a first time period according to the second time point and a preset time length; the end time of the first time period is the second time point, and the time length of the first time period is the preset time length; Extracting time series features from the user behavior sample information in the first time period to obtain a fourth sub-feature; performing feature extraction on the second time point to generate a fifth sub-feature; The third feature is generated according to the fourth sub-feature and the fifth sub-feature.
[0245] In an embodiment of the present application, the task processing device includes: a prediction unit for predicting first task information of the first task based on the first time point when the first task needs to be executed at the first time point; a query unit for querying the second task to be executed at the first time point in the task list and obtaining the second task information of the second task, wherein the task categories of the first task and the second task are the same; the prediction unit is also used to predict the resource information required to execute the task at the first time point based on the first task information and the second task information; a determination unit is used to determine a plan for executing the task at the first time point based on the resource information. In this embodiment, considering that the second task is in the task list and the first task is outside the task list, by predicting the task information of the first task and obtaining the task information of the second task, the resource information consumed by each task can be predicted using the obtained task information, and then the plan for executing the task at the first time point can be determined based on the resource information, so that there are sufficient resources when executing the task at the first time point, reducing the risk of task queuing or task execution failure due to insufficient resources, and improving the task execution efficiency overall.
[0246] Corresponding to the task processing method described above, based on the same technical concept, an embodiment of the present application further provides an electronic device, which is used to execute the task processing method provided above. Figure 10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0247] like Figure 10 As shown, electronic devices can vary significantly due to different configurations or performance. They may include one or more processors 1001 and memory 1002. Memory 1002 may store one or more applications or data. Memory 1002 may be either ephemeral or persistent. Applications stored in memory 1002 may include one or more modules (not shown), each of which may include a series of computer-executable instructions within the electronic device. Furthermore, processor 1001 may be configured to communicate with memory 1002 to execute the series of computer-executable instructions within memory 1002 on the electronic device. The electronic device may also include one or more power supplies 1003, one or more wired or wireless network interfaces 1004, one or more input / output interfaces 1005, one or more keyboards 1006, and the like.
[0248] In a specific embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the electronic device, and the one or more programs are configured to be executed by one or more processors, including computer-executable instructions for performing the following: When a first task needs to be performed at a first time point, predicting first task information of the first task according to the first time point; Searching the task list for a second task executed at the first time point, and obtaining second task information of the second task, wherein the first task and the second task have the same task category; Predicting resource information required to execute the task at the first time point based on the first task information and the second task information; A plan for executing the task at the first time point is determined based on the resource information.
[0249] The computer-readable storage medium provided in this embodiment is used to store computer-executable instructions. When the computer-executable instructions are executed by a processor, the following process is implemented: When a first task needs to be performed at a first time point, predicting first task information of the first task according to the first time point; Searching the task list for a second task executed at the first time point, and obtaining second task information of the second task, wherein the first task and the second task have the same task category; Predicting resource information required to execute the task at the first time point based on the first task information and the second task information; A plan for executing the task at the first time point is determined based on the resource information.
[0250] It should be noted that the embodiment of the computer-readable storage medium in this specification and the embodiment of the task processing method in this specification are based on the same inventive concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned corresponding method, and the repeated parts will not be repeated.
[0251] Another embodiment of the present disclosure further provides a computer program product, the computer program product including a computer program, which implements the following process when executed by a processor: When a first task needs to be performed at a first time point, predicting first task information of the first task according to the first time point; Searching the task list for a second task executed at the first time point, and obtaining second task information of the second task, wherein the first task and the second task have the same task category; Predicting resource information required to execute the task at the first time point based on the first task information and the second task information; A plan for executing the task at the first time point is determined based on the resource information.
[0252] The computer program product in the embodiment of the present disclosure can implement each process of the above-mentioned task processing method embodiment and achieve the same effects and functions, which will not be repeated here.
[0253] In an embodiment of the present application, first, when the first task needs to be executed at a first time point, the first task information of the first task is predicted based on the first time point; then, the second task to be executed at the first time point is queried in the task list, and the second task information of the second task is obtained, and the task category of the first task and the second task is the same; then, the resource information required to execute the task at the first time point is predicted based on the first task information and the second task information; finally, the plan for executing the task at the first time point is determined based on the resource information. In this embodiment, considering that the second task is in the task list and the first task is outside the task list, by predicting the task information of the first task and obtaining the task information of the second task, the resource information consumed by each task can be predicted using the obtained task information, and then the plan for executing the task at the first time point is determined based on the resource information, so that there are sufficient resources when executing the task at the first time point, reducing the risk of task queuing or task execution failure due to insufficient resources, and improving the task execution efficiency overall.
[0254] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0255] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the embodiments of the present application may take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware. Furthermore, this specification may take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0256] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable electronic device to produce a machine, so that the instructions executed by the processor of the computer or other programmable electronic device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0257] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable electronic device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0258] These computer program instructions can also be loaded onto a computer or other programmable electronic device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0259] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0260] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0261] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can be implemented using any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change RAM (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media such as modulated data signals and carrier waves.
[0262] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0263] The embodiments of the present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0264] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0265] The foregoing description is merely an example of the present invention and is not intended to limit the present invention. Persons skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be included within the scope of the claims herein.
Claims
1. A task processing method, characterized in that: include: When a first task needs to be performed at a first time point, predicting first task information of the first task according to the first time point; Searching the task list for a second task executed at the first time point, and obtaining second task information of the second task, wherein the first task and the second task have the same task category; Predicting resource information required to execute the task at the first time point based on the first task information and the second task information; A plan for executing the task at the first time point is determined based on the resource information.
2. The method according to claim 1, characterized in that The resource information includes a first amount of a first resource consumed when executing the task at the first time point, and determining a plan for executing the task at the first time point based on the resource information includes: In response to the first quantity being less than or equal to the quantity of resources in the first resource set, determining to execute the first task and the second task at the first time point, the task category of the task corresponding to the first resource set being the same as the task category of the first task; In response to the first quantity being greater than the number of resources in the first resource set, a second quantity of resources is obtained from the second resource set based on the difference between the first quantity and the number of resources in the first resource set, and when the second quantity of resources is obtained, it is determined to execute the first task and the second task at the first time point; or, in response to the first quantity being greater than the number of resources in the first resource set, priority information of the first task and the second task is determined, and the task to be executed at the first time point is determined among the first task and the second task based on the priority information and the third quantity of the first resources consumed by executing the first task in the resource information and the fourth quantity of the first resources consumed by executing the second task in the resource information.
3. The method according to claim 1, characterized in that The predicting, based on the first task information and the second task information, of resource information required to execute the task at the first time point includes: performing feature extraction on the first task information to obtain a first feature of the first task information, and predicting resource consumption information for executing the first task at the first time point based on the first feature; performing feature extraction on the second task information to obtain a second feature of the second task information, and predicting resource consumption information of executing the second task at the first time point based on the second feature; The resource information is determined according to the resource consumption information of the first task and the resource consumption information of the second task.
4. The method according to claim 3, characterized in that The first task information includes first sub-information representing a numerical value, second sub-information representing a category, and third sub-information representing a time series; and extracting features from the first task information to obtain a first feature of the first task information includes: performing normalization processing on the first sub-information to obtain a first sub-feature of the first sub-information; Performing one-hot encoding on the second sub-information to obtain a second sub-feature of the second sub-information; Processing the third sub-information through a sliding window function to obtain a third sub-feature of the third sub-information; The first feature is obtained according to the first sub-feature, the second sub-feature, and the third sub-feature.
5. The method according to claim 2, characterized in that The method further comprises: In response to the resource quantity of the third resource set being greater than a preset resource quantity threshold, the priority and execution time of the unprocessed tasks corresponding to the third resource set are updated; the third resource set is any one of the first resource set and each of the second resource sets.
6. The method according to claim 1, wherein The first task information is obtained by prediction through a first model, and the training method of the first model includes: Extract features from the second time point and the user behavior sample information to obtain a third feature; Extracting features from the identification information of the training sample tasks to generate a fourth feature; The first model is trained according to the third feature and the fourth feature.
7. The method according to claim 6, characterized in that The extracting features of the second time point and the user behavior sample information to obtain a third feature includes: Determine a first time period according to the second time point and a preset time length; the end time of the first time period is the second time point, and the time length of the first time period is the preset time length; Extracting time series features from the user behavior sample information in the first time period to obtain a fourth sub-feature; performing feature extraction on the second time point to generate a fifth sub-feature; The third feature is generated according to the fourth sub-feature and the fifth sub-feature.
8. An electronic device, characterized in that: include: processor; and a memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the task processing method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the task processing method according to any one of claims 1 to 7 is implemented.
10. A computer program product, characterized in that The computer program comprises a computer program, which implements the task processing method according to any one of claims 1 to 7 when executed by a processor.