Time consumption prediction method and device based on monotonicity enhancement model, equipment and medium
Through the time-consuming prediction method based on the monotonic enhancement model, the problem of low accuracy and reliability of program time-consuming prediction in the prior art is solved, and accurate prediction of program time-consuming is achieved, and the accuracy and reliability of prediction results are improved.
Patent Information
- Application Number
- CN202510063591.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-15
- Publication Date
- 2025-05-13
AI Technical Summary
In the process time-consuming prediction of the prior art, the accuracy and reliability are low, making it difficult to effectively fit monotonicity, resulting in inaccurate prediction results.
The time-consuming prediction method based on the monotonic enhancement model is adopted. By obtaining the target historical task data set and the basic monotonic enhancement model, it is trained to generate the target monotonic enhancement model, and then time-consuming prediction of the current task.
It improves the accuracy and reliability of program time-consuming prediction, avoids inaccurate modeling in pure data-driven methods, and utilizes common rules between resources and time-consuming to prevent overfitting.
Smart Images

Figure CN119988166A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a time consumption prediction method, device, equipment and medium based on a monotonicity enhancement model. Background Art
[0002] In the field of computer science and software engineering, predicting the running time of a program is crucial for optimizing system performance, resource management, and improving user experience. By accurately predicting the time it takes to run a program, more informed decisions can be made during system design and optimization. However, the running time of a program is usually affected by many factors, including the size of the input data, computational complexity, and system load. For example, in a distributed system, the running time of a program may be affected by factors such as network latency and unbalanced load on computing nodes, making it more challenging to accurately predict the running time of a program.
[0003] In the prior art, program time consumption is usually predicted by machine learning models or given function fitting. However, if a machine learning model is used, monotonicity cannot be fitted. If a given function is used for fitting, it cannot be guaranteed that the system will run according to the law of the function, resulting in a relatively large fitting error, which reduces the accuracy of the prediction results. Therefore, how to accurately predict the program time consumption and improve the accuracy and reliability of the prediction results is a problem that needs to be solved urgently. Summary of the invention
[0004] The present invention provides a time consumption prediction method, device, equipment and medium based on a monotonicity enhancement model, which can solve the problem of low accuracy and reliability of program time consumption prediction results.
[0005] According to one aspect of the present invention, a time consumption prediction method based on a monotonicity enhancement model is provided, comprising:
[0006] Acquire a target historical task data set and a basic monotonicity enhancement model corresponding to the target historical task data set; wherein the basic monotonicity enhancement model includes a preset monotonicity constraint;
[0007] Based on the target historical task data set and a preset training stop mechanism, a basic monotonicity enhancement model is trained to obtain a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model;
[0008] Based on the target monotonicity enhancement model, a time consumption prediction is performed on the current task description to generate a target time consumption result corresponding to the current task description.
[0009] According to another aspect of the present invention, a time consumption prediction device based on a monotonicity enhancement model is provided, comprising:
[0010] A data acquisition module, used to acquire a target historical task data set and a basic monotonicity enhancement model corresponding to the target historical task data set; wherein the basic monotonicity enhancement model includes a preset monotonicity constraint;
[0011] A model training module, used to train a basic monotonicity enhancement model based on the target historical task data set and a preset training stop mechanism to obtain a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model;
[0012] The time consumption prediction module is used to perform time consumption prediction on the current task description based on the target monotonicity enhancement model, and generate a target time consumption result corresponding to the current task description.
[0013] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the time consumption prediction method based on the monotonicity enhanced model described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the time consumption prediction method based on the monotonicity enhancement model described in any embodiment of the present invention when executed.
[0018] According to another aspect of the present invention, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method for predicting time consumption based on a monotonicity enhanced model according to any embodiment of the present invention is implemented.
[0019] The technical solution of the embodiment of the present invention is to obtain a target historical task data set and a basic monotonicity enhancement model corresponding to the target historical task data set. Then, the basic monotonicity enhancement model is trained based on the target historical task data set and a preset training stop mechanism to obtain a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model. Finally, the time consumption of the current task description is predicted based on the target monotonicity enhancement model to generate a target time consumption result corresponding to the current task description. Since the relationship between the given resources and time consumption of the task is predicted based on the monotonicity improvement method, it can avoid the inaccurate modeling caused by the pure data-driven method, and can also utilize the common laws between resources and time consumption, and use the training stop mechanism to help determine the model stop training time to prevent overfitting. The problem of low accuracy and reliability of the program time consumption prediction results is solved, and accurate prediction of the program time consumption can be achieved, which improves the accuracy and reliability of the prediction results.
[0020] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 is a flow chart of a time consumption prediction method based on a monotonicity enhancement model provided according to Embodiment 1 of the present invention;
[0023] Figure 2 is a flow chart of a time-consuming prediction method based on a monotonicity enhancement model provided according to Embodiment 2 of the present invention;
[0024] Figure 3 is a flowchart of an optional time-consuming prediction method based on a monotonicity enhancement model provided according to Embodiment 2 of the present invention;
[0025] Figure 4 is a structural schematic diagram of a time consumption prediction device based on a monotonicity enhancement model provided according to Embodiment 3 of the present invention;
[0026] Figure 5 It is a structural schematic diagram of an electronic device for implementing the time consumption prediction method based on the monotonicity enhancement model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "objective", "basis", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Embodiment 1
[0030] Figure 1 This is a flowchart of a time-consuming prediction method based on a monotonicity enhancement model provided in the first embodiment of the present invention. This embodiment is applicable to the case of predicting the execution time of a software program. The method can be executed by a time-consuming prediction device based on a monotonicity enhancement model. The time-consuming prediction device based on a monotonicity enhancement model can be implemented in the form of hardware and / or software. The time-consuming prediction device based on a monotonicity enhancement model can be configured in an electronic device. Figure 1 As shown, the method includes:
[0031] S110, obtaining a target historical task data set and a basic monotonicity enhancement model corresponding to the target historical task data set; wherein the basic monotonicity enhancement model includes a preset monotonicity constraint.
[0032] Among them, historical task data may refer to the relevant time-consuming data information of a software program to achieve a complete running task within a historical time period. Exemplarily, historical task data may include task parameters, task time consumption, and corresponding number of resources of the software program. Usually, one software program corresponds to one historical task data, and each software program can be distinguished by task parameters. A historical task data set may refer to a set of historical task data within the same historical time period. A target historical task data set may refer to a standardized historical task data set after data processing.
[0033] Among them, the preset monotonicity constraint may refer to a pre-set monotonicity constraint condition. Exemplarily, the preset monotonicity constraint may be the number of resources, such as the number of central processing unit (CPU) processing cores assigned to the running task, and the effect on the time-consuming result is monotonically decreasing. That is, the more resources there are, the smaller the time-consuming result. Thus, the split point selection method of the decision tree can be restricted by the preset monotonicity constraint. For example, if a certain feature is required to have a monotonically increasing constraint in the model output, then when selecting the split point of the feature, only the split point that makes the left child node value less than or equal to the right child node value can be selected to ensure that the output of the model will not decrease in the direction of increasing the feature value.
[0034] The monotonicity enhancement model may refer to an integrated learning algorithm with a monotonicity constraint added. Exemplarily, the monotonicity enhancement model may be a strong classifier model including a monotonicity constraint. The basic monotonicity enhancement model may refer to an untrained initial monotonicity enhancement model.
[0035] S120: Training a basic monotonicity enhancement model based on the target historical task data set and a preset training stop mechanism to obtain a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model.
[0036] The preset training stop mechanism may refer to a pre-set condition for evaluating the timing of stopping model training. Usually, the enhanced model will select the maximum number of rounds, which indicates the maximum number of times the training can be performed, and stop the model training when the maximum number of training times is reached. However, if the problem contains a monotonically increasing condition, it may not be able to improve after a certain round of training. Therefore, it is necessary to use the training stop mechanism to evaluate the model training process.
[0037] The target monotonicity enhancement model may refer to a monotonicity enhancement model obtained after model training is completed. Generally, the execution time of a software program can be predicted by the target monotonicity enhancement model.
[0038] S130 , predicting the time consumption of the current task description based on the target monotonicity enhancement model, and generating a target time consumption result corresponding to the current task description.
[0039] The current task description may refer to the description information corresponding to the task that needs to be time-consuming predicted at the current moment. For example, the current task description may be a task parameter of a software program, etc. The target time-consuming result may refer to the time-consuming prediction result corresponding to the current task description.
[0040] The technical solution of the embodiment of the present invention is to obtain a target historical task data set and a basic monotonicity enhancement model corresponding to the target historical task data set. Then, the basic monotonicity enhancement model is trained based on the target historical task data set and a preset training stop mechanism to obtain a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model. Finally, the time consumption of the current task description is predicted based on the target monotonicity enhancement model to generate a target time consumption result corresponding to the current task description. Since the relationship between the given resources and time consumption of the task is predicted based on the monotonicity improvement method, it can avoid the inaccurate modeling caused by the pure data-driven method, and can also utilize the common laws between resources and time consumption, and use the training stop mechanism to help determine the model stop training time to prevent overfitting. The problem of low accuracy and reliability of the program time consumption prediction results is solved, and accurate prediction of the program time consumption can be achieved, which improves the accuracy and reliability of the prediction results.
[0041] Embodiment 2
[0042] Figure 2 A flowchart of a time-consuming prediction method based on a monotonicity enhanced model is provided for the second embodiment of the present invention. This embodiment is refined based on the above-mentioned embodiment. In this embodiment, the operation of obtaining a target historical task data set is specifically refined, which may include: obtaining a basic historical task data set; wherein the basic historical task data set contains each basic historical task data; each basic historical task data contains a task command line and an actual task time-consuming result; based on the data type of the target task data in the task command line, the task command line of the basic historical task data is processed to obtain a variable data set corresponding to the basic historical task data; normalizing the variable data set and the actual task time-consuming result corresponding to the same basic historical task data to generate the target historical task data corresponding to the basic historical task data; combining and processing the target historical task data corresponding to each basic historical task data in the basic historical task data set to generate a target historical task data set. Figure 2 As shown, the method includes:
[0043] S210, obtaining a basic historical task data set; wherein the basic historical task data set includes various basic historical task data; and each basic historical task data includes a task command line and an actual task time-consuming result.
[0044] Among them, the task command line may refer to a command line containing the task parameters and resource numbers of the software program. Exemplarily, the task command line may be: mpirun-np 2-H. / mpi_dot_product—arg11. The actual task time result may refer to the actual execution time of the software program under the corresponding task parameters and resource numbers. Basic historical task data may refer to the original historical task data without data processing. The basic historical task data set may refer to a set of basic historical task data within the same historical time period. Usually, the basic historical task data set can be obtained in a pre-set database.
[0045] It is worth noting that in the embodiment of the present invention, the operation of acquiring the basic historical task data set can be triggered according to a preset training cycle. That is, if the current moment meets the preset training cycle, the basic historical task data set is acquired and the model training process is repeated, thereby ensuring the accuracy of the model.
[0046] S220 , performing data processing on the task command line of the basic historical task data based on the data type of the target task data in the task command line to obtain a variable data set corresponding to the basic historical task data.
[0047] Among them, the target task data may refer to the parameters selected for data processing in the task command line. Usually, the target task data may be any parameter in the task command line. Exemplarily, taking the task command line as: mpirun-np 2-H. / mpi_dot_product—arg11 as an example, the target task data may be mpi_dot_product or arg1. The variable data may refer to the variable result obtained after data processing on the target task data. The variable data set may refer to a set of variable data corresponding to each target task data in the same task command line. Usually, one task command line corresponds to one variable data set.
[0048] In an optional embodiment, data processing is performed on the task command line of the basic historical task data based on the data type of the target task data in the task command line to obtain a variable data set corresponding to the basic historical task data, including: obtaining the target task data in the task command line corresponding to the basic historical task data; determining the data type of the target task data based on a preset data type classification standard; performing variable conversion on the target task data based on preset variable conversion rules and the data type of the target task data to generate a target variable result corresponding to the target task data; and combining and processing the target variable results corresponding to each target task data in the same task command line based on a preset sequence format to generate a variable data set corresponding to the basic historical task data.
[0049] Among them, the preset data type classification standard may refer to a preset data type classification set. Generally, the preset data type classification standard may include the field name of each task parameter and the corresponding data type. Exemplarily, each task parameter may be pre-classified as a categorical parameter, a continuous parameter or a resource quantity parameter based on historical task parameters. Thus, in the subsequent operation process, the field name of the task parameter may be used to perform a keyword search in the preset data type classification standard to determine whether the data type of the task parameter is a categorical type or a continuous type.
[0050] Among them, variable conversion may refer to the operation of converting task data into variable data. The preset variable conversion rule may refer to a preset rule for performing variable conversion on task data. Exemplarily, the preset variable conversion rule may be a rule for converting categorical task data into variables such as unique hot encoding C_1, C_2, ..., C_k, etc., a rule for converting continuous task data into variables such as S_1, S_2, ..., S_t, etc., or a rule for converting resource quantity task data into Z. Among them, k may represent the number of categorical variables, and t may represent the number of continuous variables. The target variable result may refer to the variable result obtained after performing variable conversion on the target task data. The preset sequence format may refer to a preset variable data sorting format. Exemplarily, the preset sequence format may be: (categorical variable, continuous variable, resource quantity).
[0051] Specifically, taking the task command line as: mpirun-np 2-H. / mpi_dot_product—arg11 as an example, the data type of the target task data mpi_dot_product can be determined as categorized task data by using the preset data type classification standard, the data type of the target task data arg1 is continuous task data, and the data type of the target task data np is the number of resources. Then, based on the preset variable conversion rule, the target task data mpi_dot_product variable is converted into the target variable result C_1, which represents the function called by the task, and the target task data arg1 variable is converted into the target variable result S_1, the value of S_1 is 1, and the target task data np variable is converted into the target variable result Z, the value of Z is 2. Finally, the results of each target variable are combined and processed according to the preset sequence format (categorized variable, continuous variable, number of resources) to generate the variable data set (C_1, S_1, Z) corresponding to the basic historical task data. Thus, an effective basis is provided for subsequent operations.
[0052] It is worth noting that in the embodiment of the present invention, C_1, C_2, ..., C_k respectively represent different entry functions, S_1, S_2, ..., S_t respectively represent different hyperparameter types, and the embodiment of the present invention does not specifically limit the specific meaning of each target variable result.
[0053] S230 , normalizing the variable data set and actual task time-consuming results corresponding to the same basic historical task data to generate target historical task data corresponding to the basic historical task data.
[0054] Among them, normalization processing can refer to scaling the value ranges of different variable data under the same variable dimension to similar intervals to eliminate the dimensional differences between different variables so that different variable data have similar numerical ranges. Usually, through normalization, variable data can be mapped to a specific range, such as [0,1] or [-1,1], to help improve the convergence speed of the model and avoid the problem of weight imbalance.
[0055] It is worth noting that in the embodiment of the present invention, the same normalization processing method is used for variable data of the same type. For example, the target variable results C_1, C_2, ..., C_k use the same normalization processing method, and the target variable results S_1, S_2, ..., S_t use the same normalization processing method. In addition, since the task time consumption cannot be reflected in the command line, when performing the normalization processing, it is necessary to additionally obtain the actual task time consumption result D corresponding to the basic historical task data to generate the target historical task data (C_1, S_1, Z, D) corresponding to the basic historical task data. The embodiment of the present invention does not make additional elaborations on this.
[0056] S240 , combining and processing the target historical task data corresponding to each basic historical task data in the basic historical task data set to generate a target historical task data set.
[0057] Specifically, after generating the target historical task data corresponding to the basic historical task data, the target historical task data corresponding to each basic historical task data in the basic historical task data set can be combined to generate the target historical task data set, providing an effective basis for subsequent model training.
[0058] S250, obtaining a basic monotonicity enhancement model corresponding to the target historical task data set; wherein the basic monotonicity enhancement model includes a preset monotonicity constraint.
[0059] S260. Training a basic monotonicity enhancement model based on the target historical task data set to obtain an intermediate monotonicity enhancement model, a current partial correlation coefficient, and a degree of freedom partial correlation coefficient corresponding to the current round.
[0060] The current round may refer to the fitting round of the current decision tree. Exemplarily, the current round may be the order of the currently fitted decision trees. Usually, the decision trees are fitted one by one, and after each decision tree is fitted, it is determined whether to fit the next decision tree. The intermediate monotonicity enhancement model may refer to the monotonicity enhancement model obtained after the current round of training is completed.
[0061] Among them, the partial correlation coefficient may refer to a coefficient indicating whether there is a linear correlation between two variables under the condition of other variables. Exemplarily, the number of resources Z and the time-consuming residual can be used as calculation variables of the partial correlation coefficient, and other variables can be used as conditional variables to calculate the partial correlation coefficient. The time-consuming residual can be the residual between the model prediction time result of the current round and the actual task time result D. The current partial correlation coefficient may refer to the partial correlation coefficient corresponding to the current round. The degree of freedom partial correlation coefficient may refer to the partial correlation coefficient corresponding to the degree of freedom dimension. The degree of freedom can be expressed as (n-2-c), where n can represent the number of training samples and c can represent the dimension of the conditional variable.
[0062] S270. Perform distribution comparison on the current partial correlation coefficient and the partial correlation coefficient of degrees of freedom based on a preset distribution standard to generate a distribution comparison result.
[0063] The preset distribution standard may refer to a pre-set rule for evaluating the current partial correlation coefficient and the partial correlation coefficient of degrees of freedom. For example, the preset distribution standard may be a t distribution, and the specific formula may be: r can represent the corresponding partial correlation coefficient; j can represent the number of resources, k can represent the time-consuming residual, and X can represent the dimension of categorical variables, continuous variables, and resource variables. The test hypothesis is: null hypothesis H_0: partial correlation coefficient = 0; alternative hypothesis H_1: partial correlation coefficient is not 0. If the statistic calculated according to the null hypothesis does not satisfy the above t distribution, then reject H_0, accept H_1, and continue training. That is, t n-2-c If the probability of falling into the absolute value range of t is less than the set probability, such as 0.05, the event is judged to be a low-probability event, the two variables are strongly correlated, and the next training round can be continued. On the contrary, if the statistic calculated according to the null hypothesis satisfies the above t distribution, it means that the two variables are weakly correlated, and the training ends.
[0064] The distribution comparison result may refer to a comparison result generated after the current partial correlation coefficient and the partial correlation coefficient of degrees of freedom are compared based on a preset distribution standard. For example, the distribution comparison result may be a correlation result indicating that the two variables are strongly correlated, or a non-correlation result indicating that the two variables are weakly correlated.
[0065] S280: If the distribution comparison result is a non-correlated result, the intermediate monotonicity enhancement model is used as a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model.
[0066] Specifically, after obtaining the target historical task data set and the basic monotonicity enhancement model corresponding to the target historical task data set, the basic monotonicity enhancement model can be trained based on the target historical task data set to obtain the intermediate monotonicity enhancement model, the current partial correlation coefficient and the partial correlation coefficient of the degree of freedom corresponding to the current round, and then, the current partial correlation coefficient and the partial correlation coefficient of the degree of freedom are compared based on the preset distribution standard to generate a distribution comparison result. If the distribution comparison result is a relevant result, the intermediate monotonicity enhancement model continues to be trained for the next round; if the distribution comparison result is an irrelevant result, the intermediate monotonicity enhancement model is used as the target monotonicity enhancement model corresponding to the basic monotonicity enhancement model. In this way, a trained monotonicity enhancement model is obtained, which provides an effective basis for subsequent time-consuming prediction.
[0067] It is worth noting that in an embodiment of the present invention, a universally unique identifier (UUId) can be generated for the trained target monotonicity enhancement model, and the target monotonicity enhancement model and the UUId can be stored separately, such as storing the UUId in a database and storing the target monotonicity enhancement model locally. When the target monotonicity enhancement model needs to be used, the UUId corresponding to the target monotonicity enhancement model can be queried in the database first, and then the corresponding target monotonicity enhancement model can be determined using the UUId, thereby improving the storage efficiency of the target monotonicity enhancement model.
[0068] S290. Obtain current task data corresponding to the current prediction task; wherein the current task data includes a task command line.
[0069] The current prediction task may refer to the time-consuming prediction task that needs to be implemented at the current moment. The current task data may refer to the data information corresponding to the current prediction task. Exemplarily, the current task data may include a task command line. The task command line may include software program task parameters.
[0070] S2100 , performing data processing on the task command line of the current task data based on the data type of the target task data in the task command line to obtain a variable data set corresponding to the current task data.
[0071] Specifically, after obtaining the current task data corresponding to the current prediction task, the target task data in the task command line corresponding to the current task data can be obtained, and then, the data type of the target task data is determined based on the preset data type classification standard, and the target task data is converted into variables based on the preset variable conversion rules and the data type of the target task data to generate target variable results C_1, C_2, ..., C_k and S_1, S_2, ..., S_t corresponding to the target task data. Finally, the target variable results corresponding to each target task data in the same task command line are processed based on the preset sequence format combination to generate a variable data set (C, S) corresponding to the current task data.
[0072] S2110. Normalize the variable data set corresponding to the current task data to generate a current task description corresponding to the current prediction task.
[0073] Specifically, after obtaining the variable data set corresponding to the current task data, the variable data set corresponding to the current task data can be normalized to obtain the current task description corresponding to the current prediction task. In this way, the dimensional differences between different variables are eliminated, so that different variable data have similar numerical ranges, which helps to improve the convergence speed of the model and avoid the problem of weight imbalance.
[0074] S2120. Determine a candidate resource number sequence based on a preset resource number sequence generation standard; wherein the candidate resource number sequence includes each candidate resource number.
[0075] Among them, the preset resource number sequence generation standard may refer to a preset resource number array generation rule for time-consuming prediction. Exemplarily, the preset resource number sequence generation standard may be that the maximum number of resources is 100, and a resource number is generated every 10 intervals. The candidate resource number may refer to the number of resources to be selected generated based on the preset resource number sequence generation standard. Exemplarily, taking the preset resource number sequence generation standard as the maximum number of resources being 100 and a resource number being generated every 10 intervals as an example, the corresponding candidate resource numbers may be 10, 20, 30, 40, 50, 60, 70, 80, 90 and 100. The candidate resource number sequence may refer to a set of candidate resource numbers corresponding to the same current prediction task. Exemplarily, if the preset resource number sequence generation standard is that the maximum number of resources is 100 and a resource number is generated every 10 intervals, the corresponding candidate resource number sequence may be (10, 20, 30, 40, 50, 60, 70, 80, 90, 100).
[0076] It is worth noting that in the embodiment of the present invention, the preset resource number sequence generation standard can be adjusted according to actual business needs, and different current prediction tasks can correspond to different preset resource number sequence generation standards, and the embodiment of the present invention does not specifically limit this.
[0077] S2130, inputting the candidate resource number sequence and the current task description into a target monotonicity enhancement model to generate a target time consumption result corresponding to the current task description under each candidate resource number.
[0078] Specifically, after generating the candidate resource number sequence and the current task description, the candidate resource number sequence and the current task description can be input into the target monotonicity enhancement model. The target monotonicity enhancement model is used to predict the execution time corresponding to the current task description under the candidate resource number sequence, and the target timing results corresponding to the current task description under each candidate resource number are generated to achieve the prediction of the timing results and ensure the accuracy of the timing results.
[0079] S2140. Summarize and process the target time consumption result corresponding to the current task description based on the number of candidate resources to generate a time consumption result curve.
[0080] The time-consuming result curve may refer to a curve composed of the number of candidate resources and the corresponding target time-consuming results. For example, the number of candidate resources may be used as the horizontal axis of the time-consuming result curve, and the target time-consuming result corresponding to the number of candidate resources may be used as the vertical axis of the time-consuming result curve. Usually, a current task description corresponds to a time-consuming result curve, and each data point in the time-consuming result curve represents the target time-consuming result corresponding to a different number of candidate resources.
[0081] S2150: Determine the target number of resources in the candidate resource number sequence based on the inclination of the time consumption result curve, and visualize the target number of resources.
[0082] The inclination of the curve may refer to the slope of the time-consuming result curve. For example, if the preset monotonicity constraint corresponding to the target monotonicity enhancement model is monotonically decreasing, the inclination of the curve may be the slope of the curve descent.
[0083] The target number of resources may refer to the number of candidate resources corresponding to the maximum curve inclination. Continuing with the above example, if the preset monotonicity constraint corresponding to the target monotonicity enhancement model is monotonically decreasing, the target number of resources may refer to the number of candidate resources corresponding to the maximum descending slope.
[0084] Specifically, after generating the target time consumption results corresponding to the current task description under each candidate resource number, the target time consumption results corresponding to the current task description can be aggregated and processed according to the candidate resource number to generate a time consumption result curve, and then the slope of the time consumption result curve is evaluated, and the candidate resource number corresponding to the maximum descending slope is used as the target resource number, and the target resource number is visualized. In this way, the optimal number of resources is determined, providing an effective basis for subsequent system design and optimization work.
[0085] The technical solution of the embodiment of the present invention processes the task command line of the basic historical task data based on the data type of the target task data in the task command line to obtain the variable data set corresponding to the basic historical task data, normalizes the variable data set corresponding to the same basic historical task data and the actual task time result, generates the target historical task data corresponding to the basic historical task data, combines and processes the target historical task data corresponding to each basic historical task data in the basic historical task data set, and generates the target historical task data set. Then, the basic monotonicity enhancement model corresponding to the target historical task data set is obtained, and the basic monotonicity enhancement model is trained based on the target historical task data set to obtain the intermediate monotonicity enhancement model, current partial correlation coefficient and degree of freedom partial correlation coefficient corresponding to the current round, and the current partial correlation coefficient and degree of freedom partial correlation coefficient are compared based on the preset distribution standard to generate a distribution comparison result. If the distribution comparison result is a non-correlated result, the intermediate monotonicity enhancement model is used as the target monotonicity enhancement model corresponding to the basic monotonicity enhancement model. Further, the current task data corresponding to the current prediction task is obtained, and the task command line of the current task data is processed based on the data type of the target task data in the task command line to obtain the variable data set corresponding to the current task data, and the variable data set corresponding to the current task data is normalized to generate the current task description corresponding to the current prediction task. Finally, the candidate resource number sequence is determined based on the preset resource number sequence generation standard, and the candidate resource number sequence and the current task description are input into the target monotonicity enhancement model to generate the target time consumption result corresponding to the current task description under each candidate resource number, and the target time consumption result corresponding to the current task description is processed based on the candidate resource number. The time consumption result curve is generated, and the target resource number in the candidate resource number sequence is determined based on the curve inclination of the time consumption result curve, and the target resource number is displayed visually. Since the relationship between the given resources and time consumption of the task is predicted based on the monotonicity improvement method, it can avoid the inaccurate modeling caused by the pure data-driven method, and can also use the common laws between resources and time consumption, and the training stop mechanism is used to help determine the model stop training time to prevent overfitting. The problem of low accuracy and reliability of the program time consumption prediction results is solved, and accurate prediction of the program time consumption can be achieved, which improves the accuracy and reliability of the prediction results.
[0086] Figure 3The flowchart of an optional time-consuming prediction method based on a monotonicity enhancement model provided by an embodiment of the present invention is shown. Specifically, when the execution model training process is triggered according to a preset training cycle, first, a basic historical task data set is obtained, and the task command line of the basic historical task data is processed based on the data type of the target task data in the task command line contained in the basic historical task data to obtain a variable data set corresponding to the basic historical task data, and the variable data set and the actual task time-consuming result corresponding to the same basic historical task data are normalized to generate the target historical task data corresponding to the basic historical task data, and the target historical task data corresponding to each basic historical task data in the basic historical task data set are combined and processed to generate the target historical task data set, thereby realizing data cleaning. Further, a basic monotonicity enhancement model corresponding to the target historical task data set is obtained, and the basic monotonicity enhancement model is trained based on the target historical task data set to obtain the intermediate monotonicity enhancement model corresponding to the current round, the current partial correlation coefficient and the partial correlation coefficient of the degree of freedom, and the current partial correlation coefficient and the partial correlation coefficient of the degree of freedom are distributed and compared based on the preset distribution standard to generate a distribution comparison result. If the distribution comparison result is a relevant result, the intermediate monotonicity enhancement model continues to be trained; if the distribution comparison result is a non-relevant result, the intermediate monotonicity enhancement model is used as the target monotonicity enhancement model corresponding to the basic monotonicity enhancement model, a universal unique identification code is generated for the trained target monotonicity enhancement model, and the universal unique identification code is stored in the database. Further, the current task data corresponding to the current prediction task is obtained, and the task command line of the current task data is processed based on the data type of the target task data in the task command line to obtain the variable data set corresponding to the current task data, and the variable data set corresponding to the current task data is normalized to generate the current task description corresponding to the current prediction task, so as to achieve data cleaning. Finally, the candidate resource number sequence is determined based on the preset resource number sequence generation standard, and the target monotonicity enhancement model is determined based on the universal unique identification code. The candidate resource number sequence and the current task description are input into the target monotonicity enhancement model, and the target time consumption result corresponding to the current task description under each candidate resource number is generated, and the target time consumption result corresponding to the current task description is summarized and processed based on the candidate resource number, and a time consumption result curve is generated. Thus, the time consumption prediction of the software program is realized.
[0087] Embodiment 3
[0088] Figure 4 The schematic diagram of the structure of a time-consuming prediction device based on a monotonicity enhancement model provided in the third embodiment of the present invention. Figure 4 As shown, the device includes: a data acquisition module 310, a model training module 320 and a time consumption prediction module 330;
[0089] The data acquisition module 310 is used to acquire a target historical task data set and a basic monotonicity enhancement model corresponding to the target historical task data set; wherein the basic monotonicity enhancement model includes a preset monotonicity constraint;
[0090] A model training module 320 is used to train a basic monotonicity enhancement model based on the target historical task data set and a preset training stop mechanism to obtain a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model;
[0091] The time consumption prediction module 330 is used to perform time consumption prediction on the current task description based on the target monotonicity enhancement model, and generate a target time consumption result corresponding to the current task description.
[0092] The technical solution of the embodiment of the present invention is to obtain a target historical task data set and a basic monotonicity enhancement model corresponding to the target historical task data set. Then, the basic monotonicity enhancement model is trained based on the target historical task data set and a preset training stop mechanism to obtain a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model. Finally, the time consumption of the current task description is predicted based on the target monotonicity enhancement model to generate a target time consumption result corresponding to the current task description. Since the relationship between the given resources and time consumption of the task is predicted based on the monotonicity improvement method, it can avoid the inaccurate modeling caused by the pure data-driven method, and can also utilize the common laws between resources and time consumption, and use the training stop mechanism to help determine the model stop training time to prevent overfitting. The problem of low accuracy and reliability of the program time consumption prediction results is solved, and accurate prediction of the program time consumption can be achieved, which improves the accuracy and reliability of the prediction results.
[0093] Optionally, the data acquisition module 310 may be specifically used for:
[0094] Obtain a basic historical task data set; wherein the basic historical task data set includes each basic historical task data; each basic historical task data includes a task command line and an actual task time-consuming result;
[0095] Performing data processing on the task command line of the basic historical task data based on the data type of the target task data in the task command line to obtain a variable data set corresponding to the basic historical task data;
[0096] Normalize the variable data set and actual task time-consuming results corresponding to the same basic historical task data to generate target historical task data corresponding to the basic historical task data;
[0097] The target historical task data corresponding to each basic historical task data in the basic historical task data set are combined and processed to generate a target historical task data set.
[0098] Optionally, the data acquisition module 310 may be specifically used for:
[0099] Get the target task data in the task command line corresponding to the basic historical task data;
[0100] Determining the data type of the target task data based on a preset data type classification standard;
[0101] Perform variable conversion on the target task data based on preset variable conversion rules and the data type of the target task data to generate a target variable result corresponding to the target task data;
[0102] The target variable results corresponding to each target task data in the same task command line are processed based on a preset sequence format combination to generate a variable data set corresponding to the basic historical task data.
[0103] Optionally, the model training module 320 may be specifically used for:
[0104] The basic monotonicity enhancement model is trained based on the target historical task data set to obtain the intermediate monotonicity enhancement model, the current partial correlation coefficient and the degree of freedom partial correlation coefficient corresponding to the current round;
[0105] Performing distribution comparison on the current partial correlation coefficient and the partial correlation coefficient of degrees of freedom based on a preset distribution standard to generate a distribution comparison result;
[0106] If the distribution comparison result is a non-correlated result, the intermediate monotonicity enhancement model is used as the target monotonicity enhancement model corresponding to the basic monotonicity enhancement model.
[0107] Optionally, the time consumption prediction device based on the monotonicity enhanced model may also include: a current task description generation module, which is used to obtain current task data corresponding to the current prediction task before performing time consumption prediction on the current task description based on the target monotonicity enhanced model and generating a target time consumption result corresponding to the current task description; wherein the current task data includes a task command line; based on the data type of the target task data in the task command line, data processing is performed on the task command line of the current task data to obtain a variable data set corresponding to the current task data; and the variable data set corresponding to the current task data is normalized to generate a current task description corresponding to the current prediction task.
[0108] Optionally, the time consumption prediction module 330 may be specifically used for:
[0109] Determine a candidate resource number sequence based on a preset resource number sequence generation standard; wherein the candidate resource number sequence includes each candidate resource number;
[0110] The candidate resource number sequence and the current task description are input into the target monotonicity enhancement model to generate the target time consumption result corresponding to the current task description under each candidate resource number.
[0111] Optionally, the time consumption prediction device based on the monotonicity enhanced model may further include: a post-processing module, which is used to perform time consumption prediction on the current task description based on the target monotonicity enhanced model and generate a target time consumption result corresponding to the current task description, and then summarize and process the target time consumption result corresponding to the current task description based on the candidate resource number to generate a time consumption result curve; determine the target resource number in the candidate resource number sequence based on the inclination of the time consumption result curve, and visually display the target resource number.
[0112] The time consumption prediction device based on the monotonicity enhanced model provided in the embodiment of the present invention can execute the time consumption prediction method based on the monotonicity enhanced model provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0113] Embodiment 4
[0114] Figure 5 A schematic diagram of an electronic device 410 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0115] like Figure 5 As shown, the electronic device 410 includes at least one processor 420, and a memory connected to the at least one processor 420 in communication, such as a read-only memory (ROM) 430, a random access memory (RAM) 440, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 420 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 430 or the computer program loaded from the storage unit 490 to the random access memory (RAM) 440. In the RAM 440, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 420, the ROM 430, and the RAM 440 are connected to each other via a bus 450. An input / output (I / O) interface 460 is also connected to the bus 450.
[0116] Multiple components in the electronic device 410 are connected to the I / O interface 460, including: an input unit 470, such as a keyboard, a mouse, etc.; an output unit 480, such as various types of displays, speakers, etc.; a storage unit 490, such as a disk, an optical disk, etc.; and a communication unit 4100, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 4100 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0117] The processor 420 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 420 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 420 performs the various methods and processes described above, such as the time-consuming prediction method based on the monotonicity enhancement model.
[0118] The method includes:
[0119] Acquire a target historical task data set and a basic monotonicity enhancement model corresponding to the target historical task data set; wherein the basic monotonicity enhancement model includes a preset monotonicity constraint;
[0120] Based on the target historical task data set and a preset training stop mechanism, a basic monotonicity enhancement model is trained to obtain a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model;
[0121] Based on the target monotonicity enhancement model, a time consumption prediction is performed on the current task description to generate a target time consumption result corresponding to the current task description.
[0122] In some embodiments, the time-consuming prediction method based on the monotonicity enhancement model can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 490. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 410 via the ROM 430 and / or the communication unit 4100. When the computer program is loaded into the RAM 440 and executed by the processor 420, one or more steps of the time-consuming prediction method based on the monotonicity enhancement model described above can be performed. Alternatively, in other embodiments, the processor 420 can be configured to execute the time-consuming prediction method based on the monotonicity enhancement model by any other appropriate means (for example, by means of firmware).
[0123] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0125] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0126] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0127] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0128] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0129] The embodiment of the present application also discloses a computer program product, which includes a computer program, and when the computer program is executed by a processor, the time-consuming prediction method based on the monotonicity enhancement model provided in any embodiment of the present application is implemented. The program product and the time-consuming prediction method based on the monotonicity enhancement model disclosed in each embodiment of the present application belong to the same inventive concept, so it will not be repeated here.
[0130] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0131] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A time-consuming prediction method based on a monotonicity enhancement model, characterized in that: include: Acquire a target historical task data set and a basic monotonicity enhancement model corresponding to the target historical task data set; wherein the basic monotonicity enhancement model includes a preset monotonicity constraint; Based on the target historical task data set and a preset training stop mechanism, a basic monotonicity enhancement model is trained to obtain a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model; Based on the target monotonicity enhancement model, a time consumption prediction is performed on the current task description to generate a target time consumption result corresponding to the current task description.
2. The method according to claim 1, characterized in that The step of obtaining a target historical task dataset includes: Obtain a basic historical task data set; wherein the basic historical task data set includes each basic historical task data; each basic historical task data includes a task command line and an actual task time-consuming result; Performing data processing on the task command line of the basic historical task data based on the data type of the target task data in the task command line to obtain a variable data set corresponding to the basic historical task data; Normalize the variable data set and actual task time-consuming results corresponding to the same basic historical task data to generate target historical task data corresponding to the basic historical task data; The target historical task data corresponding to each basic historical task data in the basic historical task data set are combined and processed to generate a target historical task data set.
3. The method according to claim 2, characterized in that The step of performing data processing on the task command line of the basic historical task data based on the data type of the target task data in the task command line to obtain a variable data set corresponding to the basic historical task data includes: Get the target task data in the task command line corresponding to the basic historical task data; Determining the data type of the target task data based on a preset data type classification standard; Perform variable conversion on the target task data based on preset variable conversion rules and the data type of the target task data to generate a target variable result corresponding to the target task data; The target variable results corresponding to each target task data in the same task command line are processed based on a preset sequence format combination to generate a variable data set corresponding to the basic historical task data.
4. The method according to claim 1, characterized in that: The basic monotonicity enhancement model is trained based on the target historical task data set and a preset training stop mechanism to obtain a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model, including: The basic monotonicity enhancement model is trained based on the target historical task data set to obtain the intermediate monotonicity enhancement model, the current partial correlation coefficient and the degree of freedom partial correlation coefficient corresponding to the current round; Performing distribution comparison on the current partial correlation coefficient and the partial correlation coefficient of degrees of freedom based on a preset distribution standard to generate a distribution comparison result; If the distribution comparison result is a non-correlated result, the intermediate monotonicity enhancement model is used as the target monotonicity enhancement model corresponding to the basic monotonicity enhancement model.
5. The method according to claim 1, characterized in that Before predicting the time consumption of the current task description based on the target monotonicity enhancement model and generating the target time consumption result corresponding to the current task description, the method further includes: Obtaining current task data corresponding to the current prediction task; wherein the current task data includes a task command line; Performing data processing on the task command line of the current task data based on the data type of the target task data in the task command line to obtain a variable data set corresponding to the current task data; Normalize the variable data set corresponding to the current task data to generate the current task description corresponding to the current prediction task.
6. The method according to claim 1, characterized in that The step of predicting the time consumption of the current task description based on the target monotonicity enhancement model to generate a target time consumption result corresponding to the current task description includes: Determine a candidate resource number sequence based on a preset resource number sequence generation standard; wherein the candidate resource number sequence includes each candidate resource number; The candidate resource number sequence and the current task description are input into the target monotonicity enhancement model to generate the target time consumption result corresponding to the current task description under each candidate resource number.
7. The method according to claim 6, characterized in that After predicting the time consumption of the current task description based on the target monotonicity enhancement model and generating the target time consumption result corresponding to the current task description, the method further includes: Summarize and process the target time consumption results corresponding to the current task description based on the number of candidate resources to generate a time consumption result curve; The target number of resources in the candidate resource number sequence is determined based on the inclination of the time consumption result curve, and the target number of resources is visually displayed.
8. A time-consuming prediction device based on a monotonicity enhancement model, characterized in that: include: A data acquisition module, used to acquire a target historical task data set and a basic monotonicity enhancement model corresponding to the target historical task data set; wherein the basic monotonicity enhancement model includes a preset monotonicity constraint; A model training module, used to train a basic monotonicity enhancement model based on the target historical task data set and a preset training stop mechanism to obtain a target monotonicity enhancement model corresponding to the basic monotonicity enhancement model; The time consumption prediction module is used to perform time consumption prediction on the current task description based on the target monotonicity enhancement model, and generate a target time consumption result corresponding to the current task description.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the time consumption prediction method based on the monotonicity enhanced model described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the time consumption prediction method based on a monotonicity enhancement model described in any one of claims 1 to 7 when executed.