Method, device, equipment and storage medium for determining operation running time
Through distributed gradient enhancement analysis technology, the corresponding relationship between the characteristic information of the operational time and the operational time is established, which solves the problems of high analysis difficulty and low accuracy in the existing technology, and realizes efficient and accurate operational time analysis, reducing the Impact on the business.
Patent Information
- Application Number
- CN202210234459.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-10
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2042-03-10
AI Technical Summary
When the analysis job runs for a long time, the data volume is large and the analysis is difficult, resulting in low accuracy. Comprehensive data collection is required to affect business stability and cannot consider the interference factors at the current moment.
By obtaining historical data of the target job, extracting feature information, performing data statistics and distributed gradient enhancement analysis, establishing the correspondence between feature information and run time, and automatically analyzing the impact of different feature factors on the job run time, reducing the impact on the business.
It improves the accuracy and efficiency of job run time analysis, reduces the impact on the business, and can consider the interference factors at the current moment to provide accurate predictions.
Smart Images

Figure CN114610590B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and relate to but are not limited to a method, device, equipment and computer-readable storage medium for determining the running time of a job. Background Art
[0002] A job is a collection of work that a user requires a computer system to do during a transaction or a transaction process. The running time of a job is affected by many factors, such as the number of machines in the cluster running the job, the submission time and running time of the job, etc.
[0003] At present, when analyzing the impact of different factors on the running time of a job, statistical methods are usually used to manually adjust the number of machines in each time period to observe the impact of the adjusted number of machines on the running time of the job. In other words, it is necessary to manually adjust the values of different influencing factors and collect data comprehensively. The values of the influencing factors must be controlled and adjusted at every moment of every day for analysis.
[0004] Obviously, the amount of data in the manual analysis method in the relevant technology is too large and the analysis is difficult. Therefore, the accuracy of the analysis of the operation time of the operation under the influence of different factors is low. Summary of the invention
[0005] The embodiments of the present application provide a method, apparatus, device and storage medium for determining the running time of a job, which are applied at least in the field of artificial intelligence technology, and can obtain an accurate correspondence between feature information and running time, so as to accurately and efficiently analyze the impact of different feature information on the running time of the job based on the correspondence, thereby improving the efficiency and accuracy of the analysis.
[0006] The technical solution of the embodiment of the present application is implemented as follows:
[0007] The present application provides a method for determining the running time of a job, the method comprising:
[0008] Obtain historical data of a target job within a preset historical time period; determine characteristic information of a preset type from the historical data; perform data statistics on the characteristic information to obtain statistical characteristic information; based on the historical running time in the historical data, perform distributed gradient enhancement analysis on the characteristic information and the statistical characteristic information to obtain a corresponding relationship between the characteristic information and the running time; based on the corresponding relationship, determine the job running time of the job to be analyzed under the target characteristic information.
[0009] The present application provides a device for determining a job running time, the device comprising:
[0010] An acquisition module is used to acquire historical data of a target job within a preset historical time period; a first determination module is used to determine characteristic information of a preset type from the historical data; a data statistics module is used to perform data statistics on the characteristic information to obtain statistical characteristic information; an analysis module is used to perform distributed gradient enhancement analysis on the characteristic information and the statistical characteristic information based on the historical running time in the historical data to obtain a corresponding relationship between the characteristic information and the running time; a second determination module is used to determine the job running time of the job to be analyzed under the target characteristic information based on the corresponding relationship.
[0011] The present application provides a device for determining a job running time, including:
[0012] The memory is used to store executable instructions; the processor is used to implement the above-mentioned method for determining the running time of a job when executing the executable instructions stored in the memory.
[0013] An embodiment of the present application provides a computer program product or a computer program, which includes executable instructions, and the executable instructions are stored in a computer-readable storage medium; wherein the processor of the job running time determination device reads the executable instructions from the computer-readable storage medium, and when executing the executable instructions, the above-mentioned job running time determination method is implemented.
[0014] An embodiment of the present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute the executable instructions to implement the above-mentioned method for determining the running time of a job.
[0015] The embodiments of the present application have the following beneficial effects:
[0016] By extracting feature information of a preset type from the historical data of the acquired target job within a preset historical time period, and obtaining statistical feature information through statistics, a distributed gradient enhancement analysis is performed on the feature information and the statistical feature information based on the historical running time in the historical data. The correspondence between the feature information and the running time can be accurately obtained. In this way, based on the corresponding relationship, the influence of different feature factors on the running time of the job can be accurately and efficiently analyzed, thereby improving the efficiency and accuracy of the analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is an overall framework diagram for determining the running time of a job in the related art;
[0018] Figure 2 This is an optional architecture diagram of a system for determining the job running time provided in an embodiment of the present application;
[0019] Figure 3It is a structural schematic diagram of a device for determining the operation running time provided in an embodiment of the present application;
[0020] Figure 4 This is an optional flowchart of a method for determining the job running time provided in an embodiment of the present application;
[0021] Figure 5 This is another optional flowchart of the method for determining the job running time provided in an embodiment of the present application;
[0022] Figure 6 This is another optional flowchart of the method for determining the job running time provided in the embodiment of the present application;
[0023] Figure 7 It is a process framework diagram of a method for determining a job running time provided in an embodiment of the present application;
[0024] Figure 8 It is a schematic diagram of the implementation process of extracting feature information from historical data corresponding to a cluster provided in an embodiment of the present application;
[0025] Fig. 9 It is a schematic diagram of the prediction implementation process of the model provided in the embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0027] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as those commonly understood by those skilled in the art of the technical field of the embodiments of the present application. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0028] Before explaining the method for determining the job running time according to the embodiment of the present application, the method in the related art is first described.
[0029] In related technologies, engineers usually use statistical methods to manually adjust the number of machines in the cluster in each time period to see the impact of the number of machines on the job running time. After a large number of machine number and job running time mapping statistics are completed in the early stage, the number of machines is adjusted according to the statistical data to determine the job running time. Figure 1 It is an overall framework diagram for determining the running time of a job in the related technology, such as Figure 1 As shown, for N different jobs (including job 1, job 2, ... job N), the N jobs are run through cluster 101 at different times, wherein the original cluster 101 includes n machines, and finally the running time 102 of each job is obtained.
[0030] For example, at a certain time t1, the number of machines in cluster 101 is manually adjusted to n-1, and the running time of each job is recorded and observed to see whether it is within an acceptable range; if so, the above steps are repeated to continue to manually adjust the number of machines in cluster 101 until the running time of the job is unacceptable. In this way, through statistical analysis, the number of machines that should be reduced at time t1 can be obtained. Furthermore, by repeating the above process, the number of machines that should be reduced at different times of the day can also be obtained.
[0031] However, the methods in the related art have the following disadvantages: it is necessary to collect data comprehensively in the actual system, that is, to control variables at every moment of the day to adjust the number of machines to analyze the impact of the number of machines on the running time of the job. However, due to the large number, it is difficult to analyze. In addition, daily clusters need to run relatively stably. Constantly changing the number of machines for data collection will have a serious impact on the business and even affect the company's profitability, which is not worth the loss. Moreover, the methods in the related art can only count historical rules and cannot take into account the interference factors at the current moment. For example, if the number of jobs at the current moment increases dramatically compared to the same moment in the past, accurate analysis cannot be performed.
[0032] Based on the above methods in the related art and the above problems, an embodiment of the present application provides a method for determining the running time of a job. This method does not require comprehensive data collection through artificial intelligence learning, but only requires sampling and collecting part of the historical data. There is no need to manually analyze these historical data, but instead it is automatically learned by artificial intelligence. Moreover, since only sampling and collecting part of the data is required, the impact on the business is greatly reduced. In addition, the method for determining the running time of a job in an embodiment of the present application solves the interference problem at the current moment by adding the situation of other jobs submitted to the machine at the time of the job to the characteristics of the job.
[0033] In the method for determining the job running time provided in the embodiment of the present application, first, the historical data of the target job within a preset historical time period is obtained; from the historical data, the characteristic information belonging to the preset type is determined; and the characteristic information is statistically analyzed to obtain statistical characteristic information; then, based on the historical running time in the historical data, the characteristic information and the statistical characteristic information are subjected to distributed gradient enhancement analysis to obtain the corresponding relationship between the characteristic information and the running time; finally, based on the corresponding relationship, the job running time of the job to be analyzed under the target characteristic information is determined. In this way, since the characteristic information and the statistical characteristic information are subjected to distributed gradient enhancement analysis, the corresponding relationship between the characteristic information and the running time can be accurately obtained, so that based on the corresponding relationship, the influence of different characteristic factors on the job running time can be accurately and efficiently analyzed, thereby improving the efficiency and accuracy of the analysis.
[0034] The following describes an exemplary application of the operation operation duration determination device of the embodiment of the present application. The operation operation duration determination device provided by the embodiment of the present application can be implemented as a terminal or a server. In one implementation, the operation operation duration determination device provided by the embodiment of the present application can be implemented as a laptop, a tablet computer, a desktop computer, a mobile device (e.g., a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable gaming device), an intelligent robot, an intelligent home appliance, and an intelligent vehicle-mounted device, etc., any terminal with operation operation requirements and data processing functions; In another implementation, the operation operation duration determination device provided by the embodiment of the present application can also be implemented as a server, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms. The terminal and the server can be directly or indirectly connected by wired or wireless communication, which is not limited in the embodiment of the present application. Below, an exemplary application of the operation operation duration determination device when it is implemented as a server will be described.
[0035] See also Figure 2 , Figure 2It is an optional architecture diagram of the job running time determination system provided in the embodiment of the present application. In order to realize the normal operation of supporting any job and accurately predict the job running time of the job under the target feature information, at least an operating system is installed on the terminal, in which the job is an execution unit handed over to the operating system by a computer operator (or a program called a job scheduler). In the embodiment of the present application, the job running time determination system 10 includes at least a terminal 100, a network 200 and a server 300, wherein the server 300 constitutes the job running time determination device of the embodiment of the present application. The terminal 100 is connected to the server 300 via the network 200, and the network 200 can be a wide area network or a local area network, or a combination of the two. During the operation process, the terminal 100 can collect and store historical data during the operation process.
[0036] When it is necessary to determine the job running time of the job to be analyzed under the target characteristic information, the server 300 can obtain the historical data of the target job sent by the terminal 100 in the preset historical time period through the network 200. Here, the target job can be the same job as the job to be analyzed, or it can be a different job. After obtaining the historical data of the target job in the preset historical time period, the server determines the characteristic information of the preset type from the historical data; performs data statistics on the characteristic information to obtain statistical characteristic information; based on the historical running time in the historical data, performs distributed gradient enhancement analysis on the characteristic information and the statistical characteristic information to obtain the corresponding relationship between the characteristic information and the running time; and determines the job running time of the job to be analyzed under the target characteristic information based on the corresponding relationship. After obtaining the job running time, the server 300 can count the job running time to obtain a job running time analysis table, and send the job running time analysis table to the terminal 100 through the network 200, or the job running time can be used as the response result of the job running time analysis request and returned to the terminal 100 through the network 200.
[0037] The method for determining the job running time provided in the embodiment of the present application can also be based on a cloud platform and implemented through cloud technology. For example, the above-mentioned server 300 can be a cloud server, and the cloud server determines the feature information of a preset type from the historical data, or the cloud server performs data statistics on the feature information to obtain statistical feature information, or the cloud server performs distributed gradient enhancement analysis on the feature information and the statistical feature information based on the historical running time in the historical data to obtain the corresponding relationship between the feature information and the running time, or the cloud server determines the job running time of the job to be analyzed under the target feature information based on the corresponding relationship.
[0038] In some embodiments, a cloud storage may be provided, and the corresponding relationship between the characteristic information and the running time may be stored in the cloud storage, or the running time of the job to be analyzed under the target characteristic information may be stored in the cloud storage. In this way, when the running time of the job to be analyzed is analyzed again later, the running time of the job to be analyzed under the target characteristic information may be directly obtained from the cloud storage; or, when the running time of the job to be analyzed under other characteristic information is analyzed later, the corresponding relationship between the characteristic information and the running time may be obtained from the cloud storage, and the running time of the job to be analyzed under other characteristic information may be determined based on the obtained corresponding relationship.
[0039] It should be noted here that cloud technology refers to a hosting technology that unifies hardware, software, network and other resources in a wide area network or local area network to achieve data computing, storage, processing and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool that can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, picture websites and more portal websites. With the high development and application of the Internet industry, in the future, each item may have its own identification mark, and all need to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data require strong system backing support, which can only be achieved through cloud computing.
[0040] The method for determining the job running time provided in the embodiment of the present application also relates to the field of artificial intelligence technology, and distributed gradient enhancement analysis of feature information and statistical feature information is implemented through artificial intelligence technology, that is, a composite tree model can be obtained through training with artificial intelligence technology. Alternatively, artificial intelligence can also be used to predict the job running time of the job to be analyzed under the target feature information, that is, the trained composite tree model is used to predict the job running time of the job to be analyzed under the target feature information. The implementation process of training the composite tree model and the distributed gradient enhancement analysis process of the feature information and statistical feature information will be described in detail below.
[0041] Figure 3 is a schematic diagram of the structure of a device for determining the operation running time provided in an embodiment of the present application, Figure 3The job running time determination device shown includes: at least one processor 310, a memory 350, at least one network interface 320 and a user interface 330. The various components in the job running time determination device are coupled together via a bus system 340. It is understood that the bus system 340 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 340 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 340 is not used in the embodiment of the present invention. Figure 3 Various buses are labeled as bus system 340 .
[0042] The processor 310 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0043] The user interface 330 includes one or more output devices 331 that enable presentation of media content, and one or more input devices 332 .
[0044] The memory 350 may be removable, non-removable or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drive, optical disk drive, etc. The memory 350 may optionally include one or more storage devices physically away from the processor 310. The memory 350 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memory. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 350 described in the embodiment of the present application is intended to include any suitable type of memory. In some embodiments, the memory 350 can store data to support various operations, and examples of these data include programs, modules, and data structures or subsets or supersets thereof, as exemplarily described below.
[0045] Operating system 351, including system programs for processing various basic system services and performing hardware-related tasks, such as framework layer, core library layer, driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0046] A network communication module 352, for reaching other computing devices via one or more (wired or wireless) network interfaces 320, exemplary network interfaces 320 include: Bluetooth, Wireless Compatibility Authentication (WiFi), and Universal Serial Bus (USB);
[0047] The input processing module 353 is used to detect one or more user inputs or interactions from one of the one or more input devices 332 and translate the detected inputs or interactions.
[0048] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 3 A job running time determination device 354 stored in the memory 350 is shown. The job running time determination device 354 can be a job running time determination device in a job running time determination device, which can be software in the form of a program and a plug-in, etc., including the following software modules: an acquisition module 3541, a first determination module 3542, a data statistics module 3543, an analysis module 3544 and a second determination module 3545. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.
[0049] In other embodiments, the device provided in the embodiments of the present application can be implemented in hardware. As an example, the device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the job running time determination method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.
[0050] The job running time determination method provided in each embodiment of the present application can be executed by a job running time determination device, wherein the job running time determination device can be any terminal with job running requirements and data processing functions, or it can also be a server, that is, the job running time determination method provided in each embodiment of the present application can be executed by a terminal, or it can be executed by a server, or it can also be executed by interaction between a terminal and a server.
[0051] See also Figure 4 , Figure 4 This is an optional flow chart of a method for determining the job running time provided in an embodiment of the present application. Figure 4 The steps shown are explained, and it should be noted that Figure 4 The method for determining the job running time in the example is explained by taking the server as the execution subject.
[0052] Step S401, obtaining historical data of a target job within a preset historical time period.
[0053] Here, the target job can be any execution unit in the terminal operating system, that is, it can be any job that can be executed in the operating system, wherein a job refers to a collection of tasks that a computer user requires the operating system to do for the user during a computer login process. The job includes a set of commands, each command is a job step, and a job step refers to each relatively independent task in the job.
[0054] A job is composed of a series of orderly steps. The completion of a job goes through four stages: job submission, job acceptance, job execution, and job completion. Multiple different processes may be run when executing a job. In the embodiment of the present application, the job running time to be determined is the duration of the job execution stage.
[0055] The method for determining the job running time of the embodiment of the present application can also be applied to a batch processing system, in which a job is the basic unit for occupying memory. That is, the batch processing system uses a job as a unit to load programs and data into the memory for execution.
[0056] In some embodiments, the target job is a job that has been run in the operating system and has historical running data, and the historical running data of the target job within a preset historical time period can be collected to obtain historical data. The preset historical time period can be any period of time before the current moment, such as the previous week, the previous day, the previous hour, etc.
[0057] It should be noted that the target job in the embodiment of the present application and the job to be analyzed for which the job running time needs to be predicted can be the same job, or can be different jobs, or can be similar jobs. When the target job and the job to be analyzed are the same job, the embodiment of the present application does not strictly distinguish between the names of the target job and the job to be analyzed. It can be considered that the job indicated in any embodiment of the present application can be both the target job and the job to be analyzed.
[0058] Step S402: determining characteristic information of a preset type from historical data.
[0059] Here, the preset type may be a manually preset data type, for example, characteristic information of the target job's own attribute characteristics, the target job's submission time, the cluster characteristics running the target job, and the characteristics of other jobs during the target job's running time.
[0060] In some embodiments, there is no limitation on the preset type, and feature information that can characterize the running process characteristics or running features of the target job is feature information of the preset type, or feature information that can distinguish the running process of the target job from other jobs can also be feature information of the preset type.
[0061] In the embodiment of the present application, multiple feature information of a preset type can be determined from the historical data. The feature information of the preset type constitutes the feature of the target job, and each feature information includes at least one feature data.
[0062] Step S403: Perform data statistics on the characteristic information to obtain statistical characteristic information.
[0063] Here, data statistics refers to calculating the average value, maximum value, minimum value, and other statistical values of the feature data of the same type in the feature information. For example, the average value, maximum value, and minimum value of the number of other jobs within a period of time can be counted, or the average value, maximum value, and minimum value of the number of machine cores used by other jobs within a period of time can be counted.
[0064] In the embodiment of the present application, the statistical feature information constitutes the statistical features of the target job, and the statistical feature information includes at least one statistical value.
[0065] Step S404: Based on the historical running time in the historical data, a distributed gradient enhancement analysis is performed on the feature information and the statistical feature information to obtain a corresponding relationship between the feature information and the running time.
[0066] In the embodiment of the present application, the historical data of the target job within the preset historical time period also includes the historical running time of the target job under the characteristic information. It should be noted that when the characteristic information is different, the running time of the target job is different. Therefore, the collected historical data can be multiple, that is, multiple historical data of the target job within the preset historical time period can be collected, and each historical data has a set of characteristic information of a preset type. Distributed gradient enhancement analysis can be performed in a loop based on each historical data in turn to obtain the final corresponding relationship between the characteristic information and the running time.
[0067] In the embodiment of the present application, based on the historical running time in the historical data, the feature information and the statistical feature information are subjected to distributed gradient enhancement analysis, and the historical running time can be used as the basis for judging the analysis result, and the correspondence between the feature information obtained by the analysis and the running time is reversely verified. That is to say, by performing distributed gradient enhancement analysis on the feature information and the statistical feature information, the correspondence between the feature information and the running time is obtained, and then the correspondence between the currently obtained feature information and the running time is verified according to the historical running time in the historical data. If the verification result shows that the correspondence between the currently obtained feature information and the running time is an accurate correspondence, the process of further performing cyclic analysis based on the historical data is stopped; if the verification result shows that the correspondence between the currently obtained feature information and the running time is not an accurate correspondence, then further cyclic analysis is performed based on another historical data.
[0068] Distributed gradient enhancement analysis refers to the process of using multiple distributed analysis units to judge whether feature information and statistical feature information meet preset conditions one by one, so that each analysis unit obtains an analysis result, and finally the analysis results of multiple analysis units are superimposed to enhance the accuracy of the analysis result, thereby obtaining the final result. For example, the distributed gradient enhancement analysis process can be implemented using a composite tree model including multiple decision trees, wherein each decision tree constitutes an analysis unit, and each decision tree analyzes and judges at least one feature data in the feature information and statistical feature information to determine whether the feature data meets the preset conditions, and then splits the root node of the decision tree into two leaf nodes, and obtains the weight value of each leaf node in the splitting process, and determines the weight value as the analysis result of the corresponding leaf node, that is, according to the weight value of each leaf node, the corresponding running time of the target job on the leaf node can be determined.
[0069] It should be noted that in the composite tree model, a tree can be grown by continuously adding decision trees and continuously splitting features. Each time a decision tree is added, a new function is actually learned to fit the residual of the previous prediction. In the composite tree model, which decision tree calculates which feature data can be randomly assigned. For example, if the previous decision tree does not predict well, the next decision tree will improve on the previous decision tree. The two decision trees have a certain order of precedence, so the next decision tree is modified according to the prediction effect of the previous decision tree.
[0070] Step S405, based on the corresponding relationship, determine the job running time of the job to be analyzed under the target characteristic information. In the embodiment of the present application, after determining the corresponding relationship between the characteristic information and the running time, the job running time of the job to be analyzed under the target characteristic information can be determined based on the corresponding relationship. Here, the target characteristic information can be manually set characteristic information, and the target characteristic information is different from the characteristic information in the historical data.
[0071] For example, you can obtain feature information from historical data, and modify the number of machines in the cluster in the feature information to obtain a new number of machines. The new number of machines is used as the target feature information, and based on the new number of machines, the job running time of the job to be analyzed is determined. In other words, the job running time of the job to be analyzed is analyzed under the condition of the new number of machines.
[0072] The method for determining the operation duration of a job provided in the embodiment of the present application extracts characteristic information of a preset type from the historical data of the acquired target job within a preset historical time period, and obtains statistical characteristic information by statistics, thereby accurately obtaining the corresponding relationship between the characteristic information and the operation duration based on the historical operation duration in the historical data. In this way, the influence of different characteristic factors on the operation duration of the job can be accurately and efficiently analyzed based on the corresponding relationship, thereby improving the efficiency and accuracy of the analysis. Furthermore, since the statistical characteristic information is taken into account when analyzing the corresponding relationship, the regular information in the characteristic information of the target job can be taken into account, and the relationship between the regular information in the characteristic information and the data can be combined to improve the accuracy of the determined corresponding relationship, thereby further improving the accuracy of the determined operation duration of the job to be analyzed.
[0073] In some embodiments, the job running time determination system includes at least a terminal and a server. The user can run any job such as a target job and a job to be analyzed through the terminal. After the terminal runs the target job, the running data during this running process can be collected to obtain the historical data of the target job during this running process. The server can be a server of the job running time determination application, which is used to perform analysis based on the collected historical data to obtain the corresponding relationship between the characteristic information of the job and the running time. The following will be combined with the scenario in which the job running time determination system includes a terminal and a server to explain the job running time determination method provided in the embodiment of the present application.
[0074] Figure 5 is another optional flow chart of the method for determining the job running time provided in the embodiment of the present application, such as Figure 5 As shown, the method comprises the following steps:
[0075] Step S501: The terminal runs a target job within a preset historical time period to generate historical data.
[0076] Here, the historical data refers to all operation data of the terminal running the target job within a preset historical time period.
[0077] Step S502: The terminal collects historical data and stores the historical data.
[0078] In the process of the terminal running the target job, historical data can be collected and stored in the storage unit, so that when the historical data is needed later, the historical data can be obtained from the storage unit. In the embodiment of the present application, each feature data in the historical data can have a data label, and the data label can be used to distinguish whether the corresponding feature data belongs to a preset type.
[0079] Step S503: the server receives a job running time analysis request sent by the terminal.
[0080] Here, the job running time analysis request is used to analyze the job running time of the job to be analyzed under the target feature information, wherein the job running time analysis request at least includes the job identifier and the target feature information of the job to be analyzed.
[0081] Step S504: the server responds to the job running time analysis request and receives the historical data sent by the terminal.
[0082] In the embodiment of the present application, the server responds to the job running time analysis request to determine the job running time of the job to be analyzed under the target feature information, including the following two implementation scenarios:
[0083] In the first implementation scenario, the correspondence between the feature information and the running time has been determined, that is, the correspondence between the feature information and the running time has been determined. Therefore, the running time of the job to be analyzed under the target feature information can be determined directly based on the correspondence between the feature information and the running time.
[0084] In the second implementation scenario, the correspondence between the characteristic information and the running time has not yet been determined, that is, there is no correspondence between the characteristic information and the running time. Therefore, the historical data sent by the terminal can be received, and the correspondence between the characteristic information and the running time can be further determined based on the historical data, and then the job running time of the job to be analyzed under the target characteristic information can be determined based on the correspondence between the characteristic information and the running time.
[0085] It should be noted that the embodiment of the present application is described by taking the above-mentioned second implementation scenario as an example.
[0086] In step S505, the server selects the target job's own attribute characteristics, the target job's submission time, the cluster characteristics running the target job, and the characteristics of other jobs during the target job's running time from the historical data. Here, the own attribute characteristics, submission time, cluster characteristics, and characteristics of other jobs constitute the above-mentioned characteristic information belonging to the preset type.
[0087] In some embodiments, each feature data in the historical data has a data tag, and the embodiment of the present application can distinguish whether the corresponding feature data belongs to a preset type through the data tag. In other words, through the data tag, feature data such as its own attribute characteristics, submission time, cluster characteristics, and characteristics of other operations are filtered out from the historical data.
[0088] Step S506 , the server obtains a feature set corresponding to multiple other jobs within a specific time period during the running time of the target job.
[0089] Since the jobs in the cluster have some periodic rules, such as the trend of each day is roughly the same, and there are slight differences between weekends and non-weekends. Therefore, the embodiment of the present application also needs to construct some new feature information based on the original feature information of the preset type, so that the corresponding relationship between the feature information and the running time can be better determined by combining the connection in the feature data.
[0090] In an embodiment of the present application, a feature set corresponding to multiple other operations within a specific time period is obtained, where the specific time period refers to any sub-time period in a preset historical time period, that is, the specific time period belongs to the preset historical time period, and the length of the specific time period is less than or equal to the length of the preset historical time period.
[0091] Step S507 , the server performs statistical analysis on the feature data in the feature set to obtain a statistical value of the number of other jobs, a statistical value of the number of machine cores used by other jobs, and a statistical value of memory used by other jobs.
[0092] Here, statistical analysis includes but is not limited to calculating the average, maximum and minimum values. The statistical values of the number of other jobs, the statistical values of the number of machine cores used by other jobs, and the statistical values of the memory used by other jobs constitute statistical feature information. The statistical values of the number of other jobs include but are not limited to: the average, maximum and minimum values of the number of other jobs in a specific time period; the statistical values of the number of machine cores used by other jobs include but are not limited to: the average, maximum and minimum values of the number of machine cores used by other jobs in a specific time period; the statistical values of the memory used by other jobs include but are not limited to: the average, maximum and minimum values of the memory used by other jobs in a specific time period.
[0093] In some embodiments, the submission time of the target job includes at least one of the following: a submission date value, a submission hour value, and a submission minute value. Here, the submission date value refers to the day of the week corresponding to the submission time of the target job, the submission hour value refers to the hour of the day when the submission time of the target job is submitted, and the submission minute value refers to the minute when the submission time of the target job is submitted. Correspondingly, the method may also include the following steps S11 to S14 (not shown in the figure):
[0094] Step S11, based on the submission date value, submission hour value and submission minute value, the own attribute characteristics, submission time, cluster characteristics and characteristics of other jobs are aggregated in sequence to obtain the aggregated own attribute characteristics, aggregated submission time, aggregated cluster characteristics and aggregated characteristics of other jobs.
[0095] Here, based on the submission date value, the own attribute characteristics, submission time, cluster characteristics and characteristics of other jobs are aggregated respectively, and the own attribute characteristics, submission time, cluster characteristics and characteristics of other jobs corresponding to the same submission date value are aggregated together respectively to form the aggregated own attribute characteristics, aggregated submission time, aggregated cluster characteristics and aggregated characteristics of other jobs, that is, the own attribute feature set, submission time set, cluster feature set and feature set of other jobs corresponding to the same submission date value are obtained.
[0096] Based on the submitted hour value, the own attribute characteristics, submission time, cluster characteristics and characteristics of other jobs are aggregated respectively, and the own attribute characteristics, submission time, cluster characteristics and characteristics of other jobs corresponding to the same submitted hour value are aggregated together to form the aggregated own attribute characteristics, aggregated submission time, aggregated cluster characteristics and aggregated characteristics of other jobs, that is, the own attribute feature set, submission time set, cluster feature set and feature set of other jobs corresponding to the same submitted hour value are obtained.
[0097] Based on the submission minute value, the own attribute characteristics, submission time, cluster characteristics and characteristics of other jobs are aggregated respectively, and the own attribute characteristics, submission time, cluster characteristics and characteristics of other jobs corresponding to the same submission minute value are aggregated together to form the aggregated own attribute characteristics, aggregated submission time, aggregated cluster characteristics and aggregated characteristics of other jobs, that is, the own attribute feature set, submission time set, cluster feature set and feature set of other jobs corresponding to the same submission minute value are obtained.
[0098] Step S12, based on the submission date value, statistical analysis is performed on the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics and the aggregated characteristics of other jobs in turn, and the first change rules of the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics and the aggregated characteristics of other jobs in the date dimension are obtained.
[0099] Here, statistical analysis includes but is not limited to calculating the average, maximum and minimum values. Based on the submission date value, statistical analysis is performed on the aggregated self-attribute features, the aggregated submission time, the aggregated cluster features and the aggregated features of other jobs in sequence. It can be that the set of self-attribute features corresponding to the same submission date value is statistically analyzed to obtain the variation law of the aggregated self-attribute features in the date dimension; the set of submission time corresponding to the same submission date value is statistically analyzed to obtain the variation law of the aggregated submission time in the date dimension; the set of cluster features corresponding to the same submission date value is statistically analyzed to obtain the variation law of the aggregated cluster features in the date dimension; the feature set of other jobs corresponding to the same submission date value is statistically analyzed to obtain the variation law of the aggregated other jobs in the date dimension. The four variation laws here constitute the first variation law.
[0100] Step S13, based on the submission hour value, statistical analysis is performed on the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics and the aggregated characteristics of other jobs in turn, and the corresponding second change rules of the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics and the aggregated characteristics of other jobs in the hour dimension are obtained.
[0101] Here, statistical analysis also includes but is not limited to calculating the average, maximum and minimum values. Based on the submitted hourly value, statistical analysis is performed on the aggregated self-attribute features, the aggregated submission time, the aggregated cluster features and the aggregated features of other jobs in sequence. It can be that the set of self-attribute features corresponding to the same submitted hourly value is statistically analyzed to obtain the variation law of the aggregated self-attribute features in the hourly dimension; the set of submission time corresponding to the same submitted hourly value is statistically analyzed to obtain the variation law of the aggregated submission time in the hourly dimension; the set of cluster features corresponding to the same submitted hourly value is statistically analyzed to obtain the variation law of the aggregated cluster features in the hourly dimension; the feature set of other jobs corresponding to the same submitted hourly value is statistically analyzed to obtain the variation law of the aggregated other jobs in the hourly dimension. The four variation laws here constitute the second variation law.
[0102] Step S14, based on the submission minute value, statistical analysis is performed on the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics, and the aggregated characteristics of other jobs in turn, and the third change rules of the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics, and the aggregated characteristics of other jobs in the minute dimension are obtained accordingly.
[0103] Here, statistical analysis also includes but is not limited to calculating the average, maximum and minimum values. Based on the submitted minute value, statistical analysis is performed on the aggregated self-attribute features, the aggregated submission time, the aggregated cluster features and the aggregated features of other jobs in sequence. It can be that the set of self-attribute features corresponding to the same submitted minute value is statistically analyzed to obtain the variation law of the aggregated self-attribute features in the minute dimension; the set of submission time corresponding to the same submitted minute value is statistically analyzed to obtain the variation law of the aggregated submission time in the minute dimension; the set of cluster features corresponding to the same submitted minute value is statistically analyzed to obtain the variation law of the aggregated cluster features in the minute dimension; the feature set of other jobs corresponding to the same submitted minute value is statistically analyzed to obtain the variation law of the aggregated other jobs in the minute dimension. The four variation laws here constitute the third variation law.
[0104] In the embodiment of the present application, at least one of the first change rule, the second change rule, and the third change rule also constitutes statistical feature information. That is, the statistical feature information may only include: the number of other jobs, the number of machine cores used by other jobs, and the memory used by other jobs; or, the statistical feature information may include: the number of other jobs, the number of machine cores used by other jobs, the memory used by other jobs, at least one of the first change rule, the second change rule, and the third change rule.
[0105] In some embodiments, after obtaining feature information and statistical feature information, since some features may be invalid features, invalid features need to be eliminated. In the embodiments of the present application, the following methods can be used to eliminate invalid features:
[0106] Determine the fluctuation value and variance of each feature data in the feature information and the statistical feature information; determine the feature data whose fluctuation value is less than the fluctuation threshold and whose variance is less than the variance threshold as the target elimination data; and eliminate the target elimination data from the feature information and the statistical feature information.
[0107] Step S508: The server performs distributed gradient enhancement analysis on the feature information and the statistical feature information based on the historical running time in the historical data to obtain a corresponding relationship between the feature information and the running time.
[0108] Step S509: the server obtains the job to be analyzed and target feature information sent by the terminal.
[0109] Step S510: The server determines the job running time of the job to be analyzed under the target feature information based on the corresponding relationship.
[0110] In an embodiment of the present application, since statistical feature information is taken into account when analyzing the correspondence, regular information in the feature information of the target job can be taken into account. Combined with the relationship between the regular information in the feature information and the data, the accuracy of the determined correspondence can be improved, thereby improving the accuracy of the determined job running time of the job to be analyzed.
[0111] Figure 6 This is another optional flow chart of the method for determining the job running time provided in the embodiment of the present application, such as Figure 6 As shown, the method comprises the following steps:
[0112] Step S601: The terminal runs a target job within a preset historical time period to generate historical data.
[0113] Step S602: The terminal collects historical data and stores the historical data.
[0114] Step S603: the server receives a job running time analysis request sent by the terminal.
[0115] Step S604: the server responds to the job running time analysis request and receives the historical data sent by the terminal.
[0116] Step S605: The server determines characteristic information of a preset type from the historical data.
[0117] Step S606: The server performs data statistics on the characteristic information to obtain statistical characteristic information.
[0118] Step S607: The server performs vectorization processing on the feature information and statistical feature information to obtain a sample feature vector.
[0119] Here, any vectorization processing method can be used to vectorize the feature information and the statistical feature information respectively, to obtain a feature information vector and a statistical feature information vector respectively, and then the feature information vector and the statistical feature information vector are vector-concatenated to form a sample feature vector.
[0120] Step S608: The server inputs the sample feature vector into the composite tree model.
[0121] After the server inputs the sample feature vector into the composite tree model, the predicted running time of the target job is determined by the composite tree model, and the model parameters in the composite tree model are further reversely updated to obtain a trained composite tree model, that is, the corresponding relationship between the feature information and the running time is obtained. In other words, by training the composite tree model, a trained composite tree model is obtained, and the trained composite tree model can characterize the corresponding relationship between the feature information and the running time, that is, the trained composite tree model can accurately predict the running time of the job to be analyzed under the target feature information.
[0122] In some embodiments, the feature information and statistical feature information can be determined as sample data, and the sample data can be vectorized to obtain a sample feature vector; the historical running time can be determined as a sample label of the sample data. Finally, the sample feature vector and sample label can be input into the composite tree model.
[0123] The following is an explanation of the training process of the composite tree model, wherein the training process of the composite tree model includes the following steps S609 to S611:
[0124] Step S609: Perform distributed gradient enhancement analysis based on feature information and statistical feature information through a composite tree model to obtain a predicted running time of the target job.
[0125] In some embodiments, the feature information and statistical feature information include at least two sub-feature information. For example, the sub-feature information can be any one of the self-attribute feature, submission time, cluster feature, feature of other jobs, number statistics of other jobs, number statistics of machine cores used by other jobs, memory statistics used by other jobs, first change rule, second change rule and third change rule. In addition, the composite tree model includes at least one decision tree. Correspondingly, step S609 can be implemented by following steps S6091 to S6092 (not shown in the figure): step S6091, based on each sub-feature information in at least two sub-feature information, split the nodes in each decision tree in the composite tree model, and obtain two leaf nodes and the weight value of each leaf node. Step S6092, determine the predicted running time of the target job according to the weight values of all leaf nodes to which the target job belongs.
[0126] In an embodiment of the present application, the weight values of all leaf nodes to which the target job belongs can be added to obtain the total weight of the target job, and then the running time corresponding to the total weight can be calculated according to the corresponding relationship between the weight and the running time, which is the predicted running time of the target job.
[0127] Step S610, input the predicted running time and the historical running time into a preset loss model to obtain a loss result.
[0128] Step S611, according to the loss result, the model parameters in the composite tree model are modified to obtain a trained composite tree model, wherein the trained composite tree model can characterize the corresponding relationship between the feature information and the running time.
[0129] The training process of the composite tree model includes the process of splitting the nodes in the decision tree in the composite tree model. In order to ensure the prediction effect of the composite tree model (such as computational efficiency and prediction accuracy), it is necessary to effectively control the process of node splitting. In the embodiment of the present application, the node splitting process in the decision tree can be controlled in the following ways:
[0130] Based on at least two sub-feature information, a grid search method is used to determine the height threshold of each decision tree in the composite tree model, the leaf number threshold of each decision tree, and the learning rate threshold of the composite tree model; and when at least one of the following conditions is met, node splitting of the nodes in the decision tree is stopped: the height of any decision tree in the composite tree model is greater than or equal to the height threshold, the number of leaves of any decision tree in the composite tree model is greater than or equal to the leaf number threshold, and the learning rate of the composite tree model is greater than or equal to the learning rate threshold.
[0131] Step S612: the server obtains the job to be analyzed and target feature information sent by the terminal.
[0132] Step S613: The server determines the job running time of the job to be analyzed under the target feature information based on the corresponding relationship.
[0133] In some embodiments, step S613 may be implemented by any one of the following methods:
[0134] Method 1: Obtain target feature information of the job to be analyzed, then input the target feature information into the composite tree model, and determine the job running time of the job to be analyzed under the target feature information through the composite tree model.
[0135] In the embodiment of the present application, a composite tree model is trained, and the trained composite tree model can accurately predict the job running time of the job to be analyzed under the target feature information. Since the node splitting and control of the decision tree in the composite tree model are performed based on the feature information and statistical feature information of the target node when the composite tree model is trained, the composite tree model learned based on the feature information and statistical feature information can accurately predict the job running time of the job to be analyzed under the target feature information.
[0136] Method 2: The job to be analyzed and the target job are the same job; the characteristic information and statistical characteristic information constitute the characteristic data set of the target job. The characteristic data in the characteristic data set can be modified to obtain the modified characteristic data; wherein the modified characteristic data constitutes the test data set; then, the modified characteristic data in the test data set is determined as the target characteristic information of the job to be analyzed; the target characteristic information is input into the composite tree model, and the operation running time of the job to be analyzed under the target characteristic information is determined by the composite tree model.
[0137] In an embodiment of the present application, the feature data in the feature data set may be modified by modifying the number of machines in the feature data set to obtain a new number of machines, and then determining the new number of machines as the test data in the test data set.
[0138] In the embodiment of the present application, the pre-trained composite tree model is used to accurately predict the job running time of the job to be analyzed under the test data in the test data set. Since the node splitting and control of the decision tree in the composite tree model are performed based on the feature information and statistical feature information of the target node when the composite tree model is trained, the composite tree model learned based on the feature information and statistical feature information can accurately predict the job running time of the job to be analyzed under the test data in the test data set.
[0139] The following is an exemplary application of an embodiment of the present application in an actual application scenario. An embodiment of the present application provides a method for determining the operation duration of a job, which is a method for predicting the operation duration of a job to be analyzed under different numbers of machines and at different times based on artificial intelligence technology, and is used to analyze the impact of different numbers of machines and different times on the operation duration, so as to find the optimal number of machines within the tolerable range of the operation duration at different times, thereby achieving the purpose of reducing the number of machines and reducing the machine operating costs.
[0140] The solution of the embodiment of the present application is to extract the characteristic information of the target job and the label of the target job (i.e., the historical running time) from the historical data (i.e., historical data), and input it into a specific model (e.g., a composite tree model) after appropriate processing to learn the relationship between the characteristic information and the label of the job. After the learning is completed, the characteristic information of a certain job can be modified, such as modifying the time when the job is submitted to sub2, modifying the number of machines in the cluster at that time to q2, and then using the model to predict the job running time t2 of the job under the new characteristic information. By analyzing t2 and the original running time t1 of the job, the engineer can decide whether to adjust the number of machines to q2 at the time sub2, thereby reducing the number of machines to achieve the purpose of reducing operating costs.
[0141] The solution of the embodiment of the present application can be applied to the machine operation of a cluster. It predicts the job running time under different numbers of machines and at different times based on artificial intelligence technology, and is used to analyze the impact of different numbers of machines on the job running time at different times, and find the optimal number of machines within the tolerable range of job running time at different times.
[0142] Figure 7 is a flow chart of a method for determining the job running time provided in an embodiment of the present application, such as Figure 7 As shown, the method comprises the following steps:
[0143] Step S701 , extracting characteristic information and labels of a job (the job here may be a target job) from existing historical data to obtain a data set related to the job.
[0144] In step S701, the characteristic information and label of the job are extracted. In the implementation process, the characteristic information can be extracted from the historical data of the cluster, such as Figure 8 The figure is a schematic diagram of the implementation process of extracting feature information from the historical data corresponding to the cluster provided by the embodiment of the present application. When a specific job is submitted to run in a cluster of a specific fixed size at a specific time, taking into account the situation of other jobs at that time, it can be considered that the running time of the job can almost be learned and predicted. Therefore, the feature information that affects the running time of the job is roughly divided into the following four categories:
[0145] The first category: job characteristics 801 (i.e., job attribute characteristics), including the number of machine cores required to run the job (core_demand) and the required memory size (memory_demand);
[0146] The second category: the job submission time 802, including the day of the week (week), hour (hour), and minute (minute) of the time;
[0147] The third category: cluster features 803, including the number of machines in the cluster (cnt_machine), the total number of cores in the cluster (core_total), and the total memory in the cluster (memory_total);
[0148] The fourth category: features 804 of other jobs at this moment, including the number of other jobs (cnt_jobs), the number of machine cores used by other jobs (core_used), and the amount of memory used (memory_used).
[0149] In some embodiments, in addition to the existing feature information of the above four types of data, the operations in the cluster have some periodic rules, such as the trend of each day is roughly the same, and there are slight differences between weekends and non-weekends. Therefore, the embodiment of the present application creates the following two types of feature information based on the original features, so that the model can better learn the connection between them:
[0150] The fifth category: historical information within a short period of time. For example, the statistics of the features of other jobs within the first two hours of the job running, including the average, maximum, and minimum values. That is, this step adds a total of 3*3 features: the average, maximum, and minimum values of the number of other jobs (cnt_job), the average, maximum, and minimum values of the number of machine cores used by other jobs (core_used), and the average, maximum, and minimum values of the amount of memory used (memory_used);
[0151] The sixth category: aggregate features, including: a. Aggregation based on {week, hour, minute} (for example, group by operation), statistics on the average, maximum, and minimum values of the four types of original features, and the regular information of the historical data of the original features (i.e., the first change law, the second change law, and the third change law) as new features;
[0152] b. Perform aggregation based on {week, hour} (for example, perform a group by operation), calculate the average, maximum, and minimum values of the four types of original features, and use the regular information of the historical data of the original features as new features.
[0153] Finally, after adding new feature information, some of the feature information may be invalid, so feature elimination is required: for some feature information with small fluctuations and small variances, the model will believe that the impact of the feature information on the result is almost 0, so it is directly eliminated.
[0154] Step S702, build a model, and input the data set of the job into the model for supervised learning, determine the relationship between feature information and labels (that is, the corresponding relationship between feature information and running time), and obtain a trained model.
[0155] In the embodiment of the present application, in the model selection process, a composite tree model in machine learning can be selected for supervised learning. For example, the composite tree model can be an XGBoost model. The XGBoost model uses training data x containing multiple feature information. i , to predict the target variable , that is, to learn the relationship between the feature information and the job running time based on the feature information of the job. The model can be expressed as the following formula (1):
[0156]
[0157] Among them, θ is the parameter learned by the model; x i represents the training data corresponding to the i-th type of feature information. For example, i can be any positive integer from 1 to 6. Then x i Corresponding to any of the above six types of feature information, each type of feature information has multiple training data, x ij Represents the jth training data in the i-th category feature information.
[0158] The objective function for self-optimization during model learning is the following formula (2):
[0159]
[0160] Where L(θ) is the loss function, measured by the mean square error, which is the following formula (3):
[0161]
[0162] Among them, Ω(Θ) is a regular term, which is used to control the complexity of the model and prevent the model from overfitting. i Indicates the label of the job, that is, the actual running time of the job.
[0163] In the embodiment of the present application, the model can be a composite tree model, that is, a job sample is divided to the left or to the right by stacking trees, and finally reaches the leaf node, so as to make a prediction. The prediction implementation process of the model is as follows: Fig. 9 shown.
[0164] exist Fig. 9In the model prediction process shown, there are 5 job samples on the left (job 1, job 2, job 3, job 4 and job 5). Now we want to predict the job running time of these 5 jobs. These 5 jobs are now divided into leaf nodes. Different weight items are assigned to different leaf nodes. Positive numbers represent the time that needs to be added to the job running time of this job under the influence of this situation, and negative numbers are the opposite, that is, the time that needs to be subtracted. Therefore, the combination of leaf nodes and weights can be used to comprehensively judge how much job running time this job actually needs. The weight of the leaf node where job 3 of tree 1 above is +1, but the effect of using a single decision tree is generally not very good. Usually, an integrated method is used, that is, if the effect of one tree is not very good, add another tree. Look at tree 2 on the right side of the legend. The difference between tree 2 and tree 1 on the left is that tree 2 uses another feature information week. In addition to these feature information, you can also consider using the partition attribute of submission time. The two trees jointly determine the running time of the current job. The weight of job3 in tree 1 is +1, and the weight in tree 2 is +0.9. Therefore, the final weight of job 3 is +1.9, which is the predicted running time of the job.
[0165] Fig. 9 Only two decision trees are used as an example. In fact, there can be more complex weak classifiers that can be combined into a strong classifier. The iterative relationship between decision trees is shown in the following formula (4). Each tree is superimposed on the original one to ensure that the effect is improved:
[0166]
[0167] Among them, f t (x i ) is the model tree of the t-th superposition. Each time it is added, we try to reduce the loss function until convergence.
[0168] In the embodiment of the present application, the model training process includes the following steps:
[0169] Step 1: Data preprocessing of feature information, that is, normalizing features related to values, is more conducive to model learning. Discrete-related feature information, such as the feature of the day of the week, needs to be discretized, otherwise the model will learn the relationship between the values in the feature information incorrectly.
[0170] Step 2: After the feature information data is preprocessed, the feature information is vectorized, and the feature vector (i.e., sample feature vector) and the corresponding label are input into the model. The input of the model is a series of feature vectors and the label corresponding to the feature vector. The model will learn a set of model parameters based on the relationship between the feature information and the label.
[0171] Step 3: Use the grid search method to determine the optimal parameters for the height, number of leaves, and learning rate of the decision tree in the model.
[0172] Step 4: Use cross-validation methods to ensure that every piece of data has been validated by the model, making the performance of the optimized model as reliable as possible.
[0173] After the above four steps of training, a trained model is obtained, which can predict the running time of the job based on the input feature information.
[0174] Step S703 , modify the characteristics of the job (the job here may be the job to be analyzed, wherein the job to be analyzed and the target job may be the same job), for example, the number of machines, to obtain a test set.
[0175] The goal of the embodiment of the present application is to obtain the job running time after the number of machines changes. Therefore, after the parameters of the model have been learned, the characteristic information of the number of machines of the job can be modified (after the number of machines changes, the number of cores and memory will also change accordingly), and then the characteristic information is input into the trained model to let the model predict the job running time of the job after the number of machines changes.
[0176] In this step, the cluster features corresponding to each job, including the number of machines (cnt_machine), the total number of cores (core_total), and the total memory (memory_total), are modified. If you need to know the job running time of jobs under n cluster features, n feature information is generated. Finally, each job will generate different n features to obtain the test set of the job.
[0177] Step S704: Input the test set in step S703 as the job feature into the trained model to predict the label corresponding to the job (i.e., the running time of the job under the new feature). This can determine how much the running time of the job will change after the number of machines is modified, and whether it is still within the tolerable range.
[0178] In this step, the test set generated in step S703 is input into the trained model to obtain the required job running time corresponding to each feature information. At this point, the relationship between the number of machines in the cluster and the job running time can be obtained, so that the job running time will exceed the tolerance range when the number of machines is reduced to a certain value.
[0179] The method for determining the operation duration of a job provided in the embodiment of the present application introduces artificial intelligence technology to learn the relationship between the characteristic information of the job in the system and the operation duration of the job, so that engineers have an intuitive understanding of the impact of the number of machines in the cluster on the operation duration of the job, which is more convenient for the operation of the number of machines and helps to reduce machine costs. In addition, it combines the historical information in the cluster and the data information of a short period of time in the past. In terms of historical laws, it has more comprehensive information supplements compared to the practices in related technologies, and the data is more valuable for reference. At the same time, when predicting the operation duration of a job, the method of the embodiment of the present application adds the influence of other jobs at the current moment, so that the model can give immediate corrections to this part of the interference, and the obtained data is more valuable for reference.
[0180] It should be noted that the feature extraction part in the above step S701 of the embodiment of the present application uses only part of the relevant feature information due to the limited data obtained. When new relevant features can be collected, they can also be added to the solution of the embodiment of the present application. In the model selection in the above step S702, not only the XGBoost model can be used for learning, but also the LightGBM model in machine learning, the multilayer perceptron (MLP, MultilayerPerceptron) in the neural network, the long short-term memory network (LSTM, LongShort-TermMemory) in the deep neural network in the neural network, and other models can be used instead.
[0181] It can be understood that in the embodiments of the present application, the content involving user information, such as the characteristic information and statistical characteristic information of the target job, the job running time of the job to be analyzed, etc., if it involves data related to user information or enterprise information, when the embodiments of the present application are applied to specific products or technologies, it is necessary to obtain user permission or consent, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0182] The following is a description of an exemplary structure of the job running time determination device 354 provided in the embodiment of the present application implemented as a software module. In some embodiments, for example, Figure 3As shown, the job running time determination device 354 includes: an acquisition module 3541, which is used to obtain historical data of the target job within a preset historical time period; a first determination module 3542, which is used to determine characteristic information of a preset type from the historical data; a data statistics module 3543, which is used to perform data statistics on the characteristic information to obtain statistical characteristic information; an analysis module 3544, which is used to perform distributed gradient enhancement analysis on the characteristic information and the statistical characteristic information based on the historical running time in the historical data to obtain the corresponding relationship between the characteristic information and the running time; a second determination module 3545, which is used to determine the job running time of the job to be analyzed under the target characteristic information based on the corresponding relationship.
[0183] In some embodiments, the first determination module is also used to: filter out, from the historical data, the inherent attribute characteristics of the target job, the submission time of the target job, the cluster characteristics running the target job, and the characteristics of other jobs within the running time of the target job; and determine the inherent attribute characteristics, the submission time, the cluster characteristics, and the characteristics of the other jobs as characteristic information of a preset type.
[0184] In some embodiments, the data statistics module is also used to: for a specific time period in the running time of the target job, obtain a feature set corresponding to multiple other jobs within the specific time period; perform statistical analysis on the feature data in the feature set to obtain the number statistics of other jobs, the number statistics of machine cores used by other jobs, and the memory statistics used by other jobs; wherein the number statistics of other jobs, the number statistics of machine cores used by other jobs, and the memory statistics used by other jobs constitute the statistical feature information.
[0185] In some embodiments, the submission time of the target job includes at least one of the following: a submission date value, a submission hour value, and a submission minute value; the data statistics module is also used to: based on the submission date value, the submission hour value, and the submission minute value, respectively, perform aggregation processing on the own attribute characteristics, the submission time, the cluster characteristics, and the characteristics of the other jobs in sequence to obtain the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics, and the aggregated characteristics of the other jobs; based on the submission date value, perform statistical analysis on the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics, and the aggregated characteristics of the other jobs in sequence to obtain the first change rules of the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics, and the aggregated characteristics of the other jobs in the date dimension respectively; based on the submission hour value, perform statistical analysis on the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics, and the aggregated characteristics of the other jobs in sequence to obtain the first change rules of the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics, and the aggregated characteristics of the other jobs in the date dimension respectively. value, statistically analyze the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics, and the characteristics of other jobs after aggregation in turn, and obtain the second change law of the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics, and the characteristics of other jobs after aggregation in the hour dimension respectively; based on the submission minute value, statistically analyze the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics, and the characteristics of other jobs after aggregation in turn, and obtain the third change law of the aggregated own attribute characteristics, the aggregated submission time, the aggregated cluster characteristics, and the characteristics of other jobs after aggregation in the minute dimension respectively; wherein, at least one of the first change law, the second change law, and the third change law constitutes the statistical feature information.
[0186] In some embodiments, the device also includes: a data determination module, used to determine the fluctuation value and variance of each feature data in the feature information and the statistical feature information; determine the feature data whose fluctuation value is less than the fluctuation threshold and the variance is less than the variance threshold as target elimination data; and a data elimination module, used to eliminate the target elimination data from the feature information and the statistical feature information.
[0187] In some embodiments, the analysis module is also used to: vectorize the feature information and the statistical feature information to obtain a sample feature vector; input the sample feature vector into a composite tree model; perform distributed gradient enhancement analysis based on the feature information and the statistical feature information through the composite tree model to obtain a predicted running time of the target job; input the predicted running time and the historical running time into a preset loss model to obtain a loss result; based on the loss result, correct the model parameters in the composite tree model to obtain a trained composite tree model, wherein the trained composite tree model can characterize the correspondence between the feature information and the running time.
[0188] In some embodiments, the feature information and the statistical feature information include at least two sub-feature information; the composite tree model includes at least one decision tree; the analysis module is also used to: perform node splitting on the nodes in each decision tree in the composite tree model based on each sub-feature information in the at least two sub-feature information in turn, to obtain two leaf nodes and a weight value for each leaf node; and determine the predicted running time of the target job based on the weight values of all leaf nodes to which the target job belongs.
[0189] In some embodiments, the device also includes: a threshold determination module, which is used to determine the height threshold of each decision tree in the composite tree model, the leaf number threshold of each decision tree and the learning rate threshold of the composite tree model using a grid search method based on the at least two sub-feature information; a control module, which is used to stop splitting nodes in the decision tree when at least one of the following conditions is met: the height of any decision tree in the composite tree model is greater than or equal to the height threshold, the number of leaves of any decision tree in the composite tree model is greater than or equal to the leaf number threshold, and the learning rate of the composite tree model is greater than or equal to the learning rate threshold.
[0190] In some embodiments, the second determination module is further used to: obtain target feature information of the job to be analyzed; input the target feature information into the composite tree model, and determine the job running time of the job to be analyzed under the target feature information through the composite tree model.
[0191] In some embodiments, the job to be analyzed and the target job are the same job; the feature information and the statistical feature information constitute a feature data set of the target job; the second determination module is also used to: modify the feature data in the feature data set to obtain modified feature data; wherein the modified feature data constitutes a test data set; determine the modified feature data in the test data set as the target feature information of the job to be analyzed; input the target feature information into the composite tree model, and determine the job running time of the job to be analyzed under the target feature information through the composite tree model.
[0192] It should be noted that the description of the device of the embodiment of the present application is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment, so it is not repeated. For technical details not disclosed in the embodiment of the device, please refer to the description of the method embodiment of the present application for understanding.
[0193] The embodiment of the present application provides a computer program product or a computer program, which includes an executable instruction, which is a computer instruction; the executable instruction is stored in a computer-readable storage medium. When the processor of the job running time determination device reads the executable instruction from the computer-readable storage medium and the processor executes the executable instruction, the job running time determination device executes the above method of the embodiment of the present application.
[0194] The embodiment of the present application provides a storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the method provided by the embodiment of the present application, for example, Figure 4 The method shown.
[0195] In some embodiments, the storage medium can be a computer-readable storage medium, for example, a ferroelectric random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a compact disk-read-only memory (CD-ROM); it can also be various devices including one or any combination of the above memories.
[0196] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0197] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborative files (e.g., files storing one or more modules, subroutines, or code portions). As an example, executable instructions may be deployed to be executed on a computing device (which may be a job runtime determination device), or on multiple computing devices located at one location, or on multiple computing devices distributed at multiple locations and interconnected by a communication network.
[0198] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A method for determining the running time of a job, characterized in that: The method comprises: Obtain historical data of the target job within a preset historical time period; Determine characteristic information of a preset type from the historical data, wherein the characteristic information of the preset type includes: the characteristic attributes of the target job itself, the submission time of the target job, the characteristics of the cluster running the target job, and the characteristics of other jobs during the running time of the target job; Performing data statistics on the characteristic information to obtain statistical characteristic information; Based on the historical running time in the historical data, a distributed gradient enhancement analysis is performed on the feature information and the statistical feature information to obtain a corresponding relationship between the feature information and the historical running time; Based on the corresponding relationship, the following processing is iteratively performed until the job running time of the job to be analyzed is not within the tolerable range of the target job, so as to determine the number of machines that need to be reduced: Modify the number of machines in the cluster feature included in the feature information to a new number of machines, and modify the submission time of the target job to obtain target feature information; wherein, when the number of machines in the cluster feature is n, modify the number of machines to n-1; Based on the corresponding relationship, the job running time of the job to be analyzed under the target characteristic information is determined, and it is determined whether the job running time is within a tolerable range of the target job.
2. The method according to claim 1, characterized in that: The performing data statistics on the characteristic information to obtain statistical characteristic information includes: For a specific time period in the running time of the target job, obtaining a feature set corresponding to multiple other jobs in the specific time period; Performing statistical analysis on the feature data in the feature set to obtain a statistical value of the number of other jobs, a statistical value of the number of machine cores used by other jobs, and a statistical value of memory used by other jobs; The statistical value of the number of other jobs, the statistical value of the number of machine cores used by the other jobs, and the statistical value of the memory used by the other jobs constitute the statistical feature information.
3. The method according to claim 2, characterized in that The submission time of the target job includes at least one of the following: a submission date value, a submission hour value, and a submission minute value; The performing data statistics on the characteristic information to obtain statistical characteristic information further includes: Based on the submission date value, the submission hour value, and the submission minute value, the own attribute feature, the submission time, the cluster feature, and the features of the other jobs are aggregated in sequence to obtain aggregated own attribute features, aggregated submission time, aggregated cluster features, and aggregated features of the other jobs; Based on the submission date value, statistical analysis is performed on the aggregated self-attribute features, the aggregated submission time, the aggregated cluster features, and the aggregated features of other jobs in sequence, and first change rules of the aggregated self-attribute features, the aggregated submission time, the aggregated cluster features, and the aggregated features of other jobs in the date dimension are obtained accordingly; Based on the submission hour value, statistical analysis is performed on the aggregated self-attribute features, the aggregated submission time, the aggregated cluster features, and the aggregated features of other jobs in sequence, and corresponding second variation rules of the aggregated self-attribute features, the aggregated submission time, the aggregated cluster features, and the aggregated features of other jobs in the hour dimension are obtained; Based on the submission minute value, statistical analysis is performed on the aggregated self-attribute features, the aggregated submission time, the aggregated cluster features, and the aggregated features of other jobs in sequence, and corresponding third change rules of the aggregated self-attribute features, the aggregated submission time, the aggregated cluster features, and the aggregated features of other jobs in the minute dimension are obtained; Among them, at least one of the first change rule, the second change rule and the third change rule constitutes the statistical feature information.
4. The method according to claim 1, characterized in that: The method further comprises: Determine the fluctuation value and variance of each feature data in the feature information and the statistical feature information; Determine the feature data whose fluctuation value is less than the fluctuation threshold and whose variance is less than the variance threshold as target elimination data; The target elimination data is eliminated from the feature information and the statistical feature information.
5. The method according to claim 1, characterized in that The performing distributed gradient enhancement analysis on the feature information and the statistical feature information based on the historical running time in the historical data to obtain a corresponding relationship between the feature information and the running time includes: Performing vectorization processing on the feature information and the statistical feature information to obtain a sample feature vector; Inputting the sample feature vector into a composite tree model; Performing distributed gradient enhancement analysis based on the feature information and the statistical feature information through the composite tree model to obtain a predicted running time of the target job; Inputting the predicted running time and the historical running time into a preset loss model to obtain a loss result; According to the loss result, the model parameters in the composite tree model are modified to obtain a trained composite tree model, wherein the trained composite tree model can characterize the corresponding relationship between the feature information and the running time.
6. The method according to claim 5, characterized in that The feature information and the statistical feature information include at least two sub-feature information; the composite tree model includes at least one decision tree; The step of performing distributed gradient enhancement analysis based on the feature information and the statistical feature information by the composite tree model to obtain the predicted running time of the target job includes: Based on each of the at least two sub-feature information, split the nodes in each decision tree in the composite tree model to obtain two leaf nodes and a weight value of each leaf node; The predicted running time of the target job is determined according to the weight values of all leaf nodes to which the target job belongs.
7. The method according to claim 6, characterized in that The method further comprises: Based on the at least two sub-feature information, a height threshold of each decision tree in the composite tree model, a leaf number threshold of each decision tree, and a learning rate threshold of the composite tree model are determined using a grid search method; When at least one of the following conditions is met, node splitting of the nodes in the decision tree is stopped: The height of any decision tree in the composite tree model is greater than or equal to the height threshold, the number of leaves of any decision tree in the composite tree model is greater than or equal to the leaf number threshold, and the learning rate of the composite tree model is greater than or equal to the learning rate threshold.
8. The method according to claim 5, characterized in that The determining, based on the corresponding relationship, the job running time of the job to be analyzed under the target feature information includes: Acquire the target feature information of the job to be analyzed; The target feature information is input into the composite tree model, and the operation running time of the job to be analyzed under the target feature information is determined by the composite tree model.
9. The method according to claim 5, characterized in that The job to be analyzed and the target job are the same job; the feature information and the statistical feature information constitute a feature data set of the target job; The determining, based on the corresponding relationship, the job running time of the job to be analyzed under the target feature information includes: Modifying the feature data in the feature data set to obtain modified feature data; wherein the modified feature data constitutes a test data set; Determine the modified feature data in the test data set as the target feature information of the job to be analyzed; The target feature information is input into the composite tree model, and the operation running time of the job to be analyzed under the target feature information is determined by the composite tree model.
10. A device for determining the operation time of a job, characterized in that: The device comprises: An acquisition module is used to acquire historical data of a target job within a preset historical time period; A first determination module is used to determine characteristic information of a preset type from the historical data, wherein the characteristic information of the preset type includes: the property characteristics of the target job itself, the submission time of the target job, the characteristics of the cluster running the target job, and the characteristics of other jobs during the running time of the target job; A data statistics module, used for performing data statistics on the characteristic information to obtain statistical characteristic information; The analysis module is used to perform distributed gradient enhancement analysis on the feature information and the statistical feature information based on the historical running time in the historical data to obtain a corresponding relationship between the feature information and the historical running time; based on the corresponding relationship, iteratively perform the following processing until the job running time of the job to be analyzed is not within the tolerable range of the target job, so as to determine the number of machines that need to be reduced: modify the number of machines in the cluster feature included in the feature information to a new number of machines, and modify the submission time of the target job to obtain the target feature information; wherein, when the number of machines in the cluster feature is n, the number of machines is modified to n-1; The second determination module is used to determine the job running time of the job to be analyzed under the target characteristic information based on the corresponding relationship, and determine whether the job running time is within a tolerable range of the target job.
11. A device for determining the operation time of a job, characterized in that: include: A memory for storing executable instructions; The processor is used to implement the method for determining the job running time described in any one of claims 1 to 9 when executing the executable instructions stored in the memory.
12. A computer-readable storage medium, characterized in that: Executable instructions are stored, which are used to cause the processor to execute the executable instructions to implement the method for determining the job running time described in any one of claims 1 to 9.
13. A computer program product comprising computer executable instructions or a computer program, characterized in that: When the computer executable instructions or computer programs are executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Cloud workflow task execution time prediction method based on limit gradient improvement
CN109981749A
Hybrid prediction method for layer analysis response time in territorial space information service cloud platform
CN113344257A