Parameter configuration method and device, computer equipment, readable storage medium and computer program product
By obtaining and analyzing the characteristics of Spark applications, and using performance prediction models and multi-layer perceptrons to optimize configuration parameters, the problem of poor accuracy caused by the complexity of configuration parameters in traditional technology is solved, and the operating performance of the Spark platform is improved.
Patent Information
- Application Number
- CN202410752699.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-09-10
AI Technical Summary
In traditional technology, Spark configuration parameters are numerous and have complex interrelationships, which results in poor accuracy in manually determining configuration parameters that match the application, making it difficult to improve the performance of Spark running programs.
By obtaining the code characteristics, application data characteristics, candidate configuration parameters, environment characteristics and scheduler characteristics of the application, we use the performance prediction model and the tower-structured multi-layer perceptron to determine the parameter value area and perform parameter selection, and optimize the configuration parameters to Improve performance.
It improves the accuracy of parameter configuration of the data analysis platform, enables the selection of parameter value areas that are more suitable for the application from a wide range of candidate configuration parameters, and improves the operating performance of the Spark platform.
Smart Images

Figure CN118626167A
Abstract
Description
Technical Field
[0001] The present application relates to the field of information retrieval technology, and in particular to a parameter configuration method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the rapid development of digital technology, a variety of big data analysis platforms have emerged. Among them, the Spark platform is one of the most widely used big data processing systems. The running programs on the big data platform Spark usually have to process a large amount of data, and it is necessary to set appropriate system operating parameters to improve the performance of the running programs.
[0003] In traditional technologies, users understand the characteristics of the application to be processed by Spark, dynamically adjust configuration parameters according to the characteristics of the application, observe the performance of the application and perform tuning to achieve configuration parameter settings that match the application.
[0004] However, in traditional technologies, since there are many Spark configuration parameters and the relationships between them are relatively complex, the accuracy of manually determining the configuration parameters that match the application is poor. Summary of the invention
[0005] Based on this, it is necessary to provide a parameter configuration method, apparatus, computer device, computer-readable storage medium and computer program product to address the above technical issues.
[0006] In a first aspect, the present application provides a parameter configuration method, comprising:
[0007] Obtaining code features, application data features, multiple sets of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of an application in a data analysis platform;
[0008] Determining a parameter value region according to the plurality of groups of candidate configuration parameters, the code features, the application data features, and the performance prediction model;
[0009] Parameter selection is performed on the parameter value area based on a tower-structured multilayer perceptron, the code features, the scheduler features, the candidate configuration parameter features and the environment features to obtain the target parameters corresponding to the application in the data analysis platform.
[0010] In one embodiment, determining the parameter value region according to the multiple groups of candidate configuration parameters, the code features, the application data features and the performance prediction model includes:
[0011] Processing the code features, application data features and candidate configuration parameters according to the performance prediction model, and establishing a mapping relationship between the code features, the application data features and the candidate configuration parameters;
[0012] Taking the code features and the application data features in each group of the mapping relationships as constraints, calculating the parameter values of each group of the candidate configuration parameters to obtain the initial parameter values corresponding to the candidate configuration parameters;
[0013] A parameter value region is determined according to the running time of the application program under each set of the candidate configuration parameters and the application data and the initial parameter value corresponding to each set of the candidate configuration parameters.
[0014] In one embodiment, the processing of the code features, the application data features and the candidate configuration parameters according to the performance prediction model to establish a mapping relationship between the code features and the application data features and the candidate configuration parameters includes:
[0015] Extract the code features according to the text feature extraction method to obtain the code weight;
[0016] The code weight, application data features and candidate configuration parameters are processed according to the performance prediction model, and a mapping relationship between the code features, the application data features and the candidate configuration parameters is established.
[0017] In one embodiment, determining the parameter value area according to the running time of the application under each group of the candidate configuration parameters and the application data and the initial parameter value corresponding to each group of the candidate configuration parameters includes:
[0018] Sorting the running time of the application under each group of the candidate configuration parameters and application data, and determining the candidate configuration parameters whose running time is less than a preset threshold in the sorting result as target candidate configuration parameters;
[0019] An average configuration value of the target candidate configuration parameter is calculated, and a parameter value range is determined according to the average configuration value.
[0020] In one embodiment, the step of obtaining code features, application data features, multiple groups of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of an application program in a data analysis platform includes:
[0021] Obtain code data, application data, multiple sets of candidate configuration parameters, candidate configuration parameter data, environment data, and scheduler data of an application program in a data analysis platform;
[0022] The code data is segmented into stages to obtain a plurality of stage-level codes, and for each of the stage-level codes, the stage-level code is embedded according to a token embedding matrix to obtain a code feature;
[0023] The nodes and edges in the scheduler data are respectively embedded according to the node embedding matrix and the adjacency matrix to obtain scheduler features; the nodes include the data frames of the application data, and the edges include the application operations of the application;
[0024] Performing statistics on the application data according to preset dimensional features to obtain application data features;
[0025] Each group of the candidate configuration parameters and the environmental data are array-embedded to obtain candidate configuration parameter features and environmental features.
[0026] In one embodiment, the multi-layer perceptron based on the tower structure, the code features, the scheduler features, the candidate configuration parameter features and the environment features perform parameter selection on the parameter value area to obtain the target parameters corresponding to the application in the data analysis platform, including:
[0027] Screening the candidate configuration parameters according to the parameter value region to obtain multiple groups of target candidate configuration parameters;
[0028] For each group of the target candidate configuration parameters, predict each stage-level code based on a tower-structured multilayer perceptron, the code features, the scheduler features, the candidate configuration parameter features and the environment features to obtain performance results corresponding to each stage-level code;
[0029] Summarizing the performance results under each group of the target candidate configuration parameters to obtain the target performance results corresponding to each group of the target candidate configuration parameters;
[0030] A target parameter is determined among the target candidate configuration parameters based on the target performance result.
[0031] In a second aspect, the present application also provides a parameter configuration device, including:
[0032] An acquisition module, used to acquire code features, application data features, multiple sets of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of an application program in a data analysis platform;
[0033] A determination module, configured to determine a parameter value region based on the plurality of groups of candidate configuration parameters, the code features, the application data features, and the performance prediction model;
[0034] A selection module is used to perform parameter selection on the parameter value area based on a tower-structured multi-layer perceptron, the code features, the scheduler features, the candidate configuration parameter features and the environment features to obtain the target parameters corresponding to the application in the data analysis platform.
[0035] In one of the embodiments, the determination module is specifically used to process the code features, application data features and candidate configuration parameters according to the performance prediction model, and establish a mapping relationship between the code features and the application data features and the candidate configuration parameters;
[0036] Taking the code features and the application data features in each group of the mapping relationships as constraints, calculating the parameter values of each group of the candidate configuration parameters to obtain the initial parameter values corresponding to the candidate configuration parameters;
[0037] A parameter value region is determined according to the running time of the application program under each set of the candidate configuration parameters and the application data and the initial parameter value corresponding to each set of the candidate configuration parameters.
[0038] In one of the embodiments, the determination module is specifically used to extract the code features according to a text feature extraction method to obtain a code weight;
[0039] The code weight, application data features and candidate configuration parameters are processed according to the performance prediction model, and a mapping relationship between the code features, the application data features and the candidate configuration parameters is established.
[0040] In one of the embodiments, the determination module is specifically used to sort the running time of the application under each group of the candidate configuration parameters and application data, and determine the candidate configuration parameter whose running time is less than a preset threshold as the target candidate configuration parameter in the sorting result;
[0041] An average configuration value of the target candidate configuration parameter is calculated, and a parameter value range is determined according to the average configuration value.
[0042] In one of the embodiments, the acquisition module is specifically used to acquire code data, application data, multiple groups of candidate configuration parameters, candidate configuration parameter data, environment data and scheduler data of an application in a data analysis platform;
[0043] The code data is segmented into stages to obtain a plurality of stage-level codes, and for each of the stage-level codes, the stage-level code is embedded according to a token embedding matrix to obtain a code feature;
[0044] The nodes and edges in the scheduler data are respectively embedded according to the node embedding matrix and the adjacency matrix to obtain scheduler features; the nodes include the data frames of the application data, and the edges include the application operations of the application;
[0045] Performing statistics on the application data according to preset dimensional features to obtain application data features;
[0046] Each group of the candidate configuration parameters and the environmental data are array-embedded to obtain candidate configuration parameter features and environmental features.
[0047] In one of the embodiments, the selection module is specifically used to screen the candidate configuration parameters according to the parameter value region to obtain multiple groups of target candidate configuration parameters;
[0048] For each group of the target candidate configuration parameters, predict each stage-level code based on a tower-structured multilayer perceptron, the code features, the scheduler features, the candidate configuration parameter features and the environment features to obtain performance results corresponding to each stage-level code;
[0049] Summarizing the performance results under each group of the target candidate configuration parameters to obtain the target performance results corresponding to each group of the target candidate configuration parameters;
[0050] A target parameter is determined among the target candidate configuration parameters based on the target performance result.
[0051] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0052] Obtaining code features, application data features, multiple sets of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of an application in a data analysis platform;
[0053] Determining a parameter value region according to the plurality of groups of candidate configuration parameters, the code features, the application data features, and the performance prediction model;
[0054] Parameter selection is performed on the parameter value area based on a tower-structured multilayer perceptron, the code features, the scheduler features, the candidate configuration parameter features and the environment features to obtain the target parameters corresponding to the application in the data analysis platform.
[0055] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0056] Obtaining code features, application data features, multiple sets of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of an application in a data analysis platform;
[0057] Determining a parameter value region according to the plurality of groups of candidate configuration parameters, the code features, the application data features, and the performance prediction model;
[0058] Parameter selection is performed on the parameter value area based on a tower-structured multilayer perceptron, the code features, the scheduler features, the candidate configuration parameter features and the environment features to obtain the target parameters corresponding to the application in the data analysis platform.
[0059] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0060] Obtaining code features, application data features, multiple sets of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of an application in a data analysis platform;
[0061] Determining a parameter value region according to the plurality of groups of candidate configuration parameters, the code features, the application data features, and the performance prediction model;
[0062] Parameter selection is performed on the parameter value area based on a tower-structured multilayer perceptron, the code features, the scheduler features, the candidate configuration parameter features and the environment features to obtain the target parameters corresponding to the application in the data analysis platform.
[0063] The above parameter configuration method, device, computer equipment, computer readable storage medium and computer program product obtain the code features, application data features, candidate configuration parameter features of multiple groups of candidate configuration parameters, environmental features and scheduler features of the application in the data analysis platform; in the multiple groups of candidate configuration parameters, the parameter value area is determined according to the code features, application data features and performance prediction model; the parameter value area is selected based on the tower-structured multi-layer perceptron, code features, scheduler features, candidate configuration parameter features and environmental features to obtain the target parameters corresponding to the application in the data analysis platform. By adopting this method, the parameter value area is determined in the candidate configuration parameters through the performance prediction model, code features and application data features, and a parameter value area that is more adaptable to the application can be selected from a wide range of candidate configuration parameters. In the parameter value area, the code features, scheduler features and environmental features are combined by the multi-layer perceptron to analyze the target parameters corresponding to the application in the data analysis platform, which can improve the accuracy of parameter configuration of the data analysis platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments of the present application or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0065] Figure 1 A schematic diagram of a flow chart of a parameter configuration method in an embodiment;
[0066] Figure 2 A schematic diagram of a flow chart of a step of determining a parameter value region in one embodiment;
[0067] Figure 3 A schematic diagram of a process for constructing a mapping relationship for a performance prediction model in one embodiment;
[0068] Figure 4 A schematic flow chart of specific steps for determining a parameter value region in another embodiment;
[0069] Figure 5 A schematic diagram of a process for obtaining characteristic data in one embodiment;
[0070] Figure 6 A schematic diagram of a flow chart of a parameter selection step of a multilayer perceptron in one embodiment;
[0071] Figure 7 It is a structural block diagram of a parameter configuration device in one embodiment;
[0072] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0073] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0074] In one embodiment, Figure 1 As shown, a parameter configuration method is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0075] Step 102, obtaining code features, application data features, multiple sets of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of the application in the data analysis platform.
[0076] In the embodiment of the present application, the data analysis platform may be a Spark platform for processing big data. On the Spark platform, users need to set a large number of configuration parameters of the Spark platform when submitting an application. There are hundreds of configuration parameters of the Spark platform, and different parameter combinations have different effects on the performance of the application.
[0077] Applications can be data cleaning, transformation, aggregation, and analysis programs for big data processing. For example, enterprises can use the Spark platform to quickly process large amounts of application data and extract valuable information from the application data.
[0078] The terminal obtains the application to be run on the analysis platform, the application data that the application requests to be processed, and multiple sets of candidate configuration parameters, environmental data and scheduler data, and extracts the code features of the application, the application data features of the application data, the candidate configuration parameter features, the environmental features and the scheduler features from the above data. The detailed process of feature extraction for the input data is described in detail in the following embodiments.
[0079] Among them, code features may include the class loading status of the application's code blocks during operation and the characteristics of the stage-level code; application data features may include the number of rows, columns, number of iterations and partitioning of input data; the adjustable range of candidate configuration parameter feature parameters or the characteristics of default parameters, as well as the impact on the performance of the data analysis platform; environmental features include the characteristics of the resource environment provided by the terminal or system for the data analysis platform; scheduler features may be Resilient Distributed Datasets (RDDs) or DataFrames, as well as the characteristics of the directed acyclic graph formed by the application's operations.
[0080] Step 104 , determining a parameter value region based on multiple groups of candidate configuration parameters, code features, application data features, and performance prediction models.
[0081] In the embodiment of the present application, the terminal determines the best parameter value region based on information of multiple sets of candidate configuration parameters, code features, application data features, and performance prediction models, and can find the best parameter configuration range by analyzing the relationship between various features and performance. The terminal uses historical performance data and feature data to establish a performance prediction model, and predicts the performance corresponding to different parameter values by analyzing the performance under different parameter configurations, and determines the best parameter value region by comparing the results of multiple sets of candidate configuration parameters, code features, application data features, and performance prediction models, which parameter value region can enable the application to achieve the best performance under given application data.
[0082] Step 106, performing parameter selection on the parameter value region based on the tower-structured multi-layer perceptron, code features, scheduler features, candidate configuration parameter features, and environment features, to obtain target parameters corresponding to the application in the data analysis platform.
[0083] In the embodiment of the present application, the terminal comprehensively considers the code features, scheduler features, candidate configuration parameter features and environmental features of the application program through a multi-layer perceptron based on a tower structure, and uses a multi-layer perceptron based on a tower structure to learn the complex features of the input data through nonlinear transformations of multiple hidden layers. The tower structure is a structure in which the number of neurons in each hidden layer decreases in sequence to optimize parameters, thereby obtaining the optimal parameter configuration of the application program in the data analysis platform. Optionally, the user can execute the Spark application program using the recommended parameter values and collect execution feedback. Based on the feedback, the trained model is fine-tuned by updating.
[0084] In the above parameter configuration method, the parameter value range is determined in the candidate configuration parameters through the performance prediction model, code features and application data features, and a parameter value range that is more adaptable to the application can be selected from a large range of candidate configuration parameters. In this parameter value range, the code features, scheduler features and environment features are combined through a multi-layer perceptron to analyze the target parameters corresponding to the application in the data analysis platform, which can improve the accuracy of parameter configuration of the data analysis platform.
[0085] In an exemplary embodiment, Figure 2 As shown, step 104 includes steps 202 to 206. Among them:
[0086] Step 202: Process the code features, application data features, and candidate configuration parameters according to the performance prediction model, and establish a mapping relationship between the code features, application data features, and the candidate configuration parameters.
[0087] In the embodiment of the present application, the performance prediction model includes an adaptive model based on random forest regression. The terminal predicts the performance under different parameter configurations through the performance prediction model, and converts the relationship between code features, application data features and candidate configuration parameters into a computable mapping relationship. The performance prediction model takes the code features and application data features learned in the training process as an input whole, which is relative to the mapping relationship between the candidate configuration parameters, and constructs the mapping relationship between the code features, application data features and candidate configuration parameters of the current application based on the mapping relationship and the application and application data submitted by the current user.
[0088] Step 204: Taking the code features and application data features in each group of mapping relationships as constraints, the parameter values of each group of candidate configuration parameters are calculated to obtain initial parameter values corresponding to the candidate configuration parameters.
[0089] In an embodiment of the present application, a mapping relationship between code features, application data features and candidate configuration parameters corresponding to an application constructed by a terminal is used to calculate the optimal parameter values for each group of candidate configuration parameters. The initial parameter values are parameter values calculated during the optimization parameter configuration process, representing a starting point under the current environment (for example, a specific application, data set and hardware configuration), which can effectively search for the optimal solution in the parameter space and serve as the initial value for subsequent parameter optimization processes.
[0090] Step 206 : determining a parameter value region according to the running time of the application program under each set of candidate configuration parameters and the application data and the initial parameter value corresponding to each set of candidate configuration parameters.
[0091] In an embodiment of the present application, the terminal randomly selects multiple groups of Spark parameter configurations based on a stratified sampling method (sampling probability = usage frequency of different parameter values / total frequency), determines the parameter value area according to the running time of the application under each group of candidate configuration parameters and application data, and the initial parameter values corresponding to each group of candidate configuration parameters, and determines the reasonable range of the parameter value area by analyzing the running performance of each group of configuration parameters under different data conditions.
[0092] Among them, in the training process of the performance prediction model, the training process can be an offline training based on a small range of sample data. In a given limited training sample, the mapping relationship between code features, application data features and candidate configuration parameters is learned to predict the running performance of a given application under different groups of candidate configuration parameters, and then the model parameters are optimized based on feedback, so that the performance prediction model can predict the parameter value region of interest and program performance on a large data set by migrating the knowledge learned from a small-scale data set to a large-scale data set. Based on the calculated parameter value region of the application, the performance prediction model to be trained is fine-tuned to obtain domain-invariant feature representation, thereby updating the model parameters of the performance prediction model and achieving better performance on the target program. In the model application process, firstly, a set of candidate parameter configurations are identified through adaptive candidate generation of the performance prediction model, thereby identifying the parameter value region that may contain a good configuration of the given application, and the parameter adjustment overhead can be reduced by filtering out a large number of candidate parameters; then, the performance of the application under each set of candidate configuration parameters is estimated through the trained performance prediction model; the user will use the recommended parameter values to execute the Spark application and collect execution feedback. Finally, in daily applications, the terminal fine-tunes the trained performance parameter model through adaptive model update based on feedback.
[0093] In an optional embodiment, for parameter space analysis, the terminal can determine the possible value range and interval for each candidate configuration parameter, construct a parameter space, and determine a reasonable range of the parameter based on the parameter type (numerical, discrete, etc.) and prior knowledge to ensure that the area contains possible optimization points.
[0094] For parameter value region division, the terminal divides the parameter space into multiple sub-regions, each of which represents a range of possible parameter values. The terminal can divide the regions according to the actual application running time and effect to ensure that the parameter combination in each sub-region can achieve a certain performance improvement in the application.
[0095] For regional optimization strategies, the terminal can design regional optimization strategies, determine the method of searching for the optimal parameter combination in each sub-region, and use genetic algorithms, grid search, Bayesian optimization and other methods to perform parameter optimization search in each sub-region to obtain the best configuration parameter combination.
[0096] For cross-region search, the terminal can consider the interrelationships between different regions and design cross-region search strategies to ensure a more comprehensive exploration of parameter value regions. And by setting the connectivity or constraints between parameter value regions, more complex search strategies can be introduced to improve the efficiency and accuracy of optimization.
[0097] In this embodiment, the initial parameter value can be used as the starting point of the optimization algorithm to determine the direction and range of the parameter search. The parameter optimization process can be quickly started by calculating the initial parameter value, and the parameter value can be gradually adjusted to find the optimal solution. During the optimization process, in order to find the best parameter configuration, the defined parameter value range is expected to constrain the parameter value range. According to the application submitted by the user, a search space corresponding to a smaller parameter value range is predicted based on the performance prediction model, thereby improving the accuracy of the parameter configuration.
[0098] In an exemplary embodiment, Figure 3 As shown, step 202 includes steps 302 to 304. Among them:
[0099] Step 302: extract the code features according to the text feature extraction method to obtain the code weight.
[0100] In an embodiment of the present application, the code feature is a vectorized representation in the form of an embedded matrix. The terminal assigns weights to each word contained in the code feature based on the statistical method TF-IDF (Term Frequency - Inverse Document Frequency), characterizes the importance of each feature word in the code block, and obtains the code weight as a vector expression of the code feature.
[0101] Step 304: Process the code weight, application data features, and candidate configuration parameters according to the performance prediction model, and establish a mapping relationship between the code features, application data features, and the candidate configuration parameters.
[0102] In the embodiment of the present application, the terminal uses a performance prediction model to process the code weight, application data features and candidate configuration parameters, and establishes a mapping relationship between the code features, application data features and candidate configuration parameters. The performance prediction model can be a regression model, a classification model or other machine learning model. In the embodiment of the present application, the performance prediction model adopts a random forest regression model (RFR, Random Forest Regressor). Through the random forest regression model, the complex relationship between code features, application data features and configuration parameters can be revealed, thereby predicting the performance under different configuration parameters.
[0103] In this embodiment, by extracting code features as code weights, the mapping relationship between code features, application data features and candidate configuration parameters can be effectively established, providing a basis for subsequent parameter configuration optimization and performance prediction, and improving the accuracy of parameter configuration of the data analysis platform.
[0104] In an exemplary embodiment, Figure 4 As shown, step 206 includes steps 402 to 404. Among them:
[0105] Step 402: sort the running time of the application program under each group of candidate configuration parameters and application data, and determine the candidate configuration parameters whose running time is less than a preset threshold in the sorting result as target candidate configuration parameters.
[0106] In an embodiment of the present application, for an application that has not been run by the data analysis platform (cold start), the terminal first runs the application data based on a portion of application data that is an order of magnitude smaller. The terminal runs the application based on the small order of magnitude application data and each set of candidate configuration parameters, and records the running time of the application under each set of candidate configuration parameters.
[0107] The terminal sorts the running time of the application corresponding to each group of candidate configuration parameters from small to large, and determines the preset threshold according to the proportion in the sorting result. For example, the first 40% of the shortest running time is used as the preset threshold, and the candidate configuration parameters corresponding to this part of the running time are determined as the target candidate configuration parameters. The target candidate configuration parameters represent that the current application performs better on small-scale application data and become the initial choice in the cold start situation.
[0108] Step 404: Calculate the average configuration value of the target candidate configuration parameter, and determine the parameter value range according to the average configuration value.
[0109] In an embodiment of the present application, the terminal traverses the target candidate configuration parameters, averages the values of each parameter, and obtains an average configuration value, wherein the average configuration value may be the arithmetic mean or weighted average of each target candidate configuration parameter. Based on the calculated average configuration value of the target candidate configuration parameters, the terminal may preliminarily determine the boundary of the parameter value region, and then obtain the parameter value region, which defines the parameter value range allowed in the parameter space during the parameter configuration process to constrain the scope of the parameter search. Optionally, the terminal may determine the upper and lower limits or range of the parameter value region based on the average configuration value and a certain tolerance to ensure that the performance of the parameter configuration within this region meets the requirements. For multiple parameters that need to be adjusted, the terminal may comprehensively consider the average configuration values of each parameter, and appropriately expand or reduce the range of the parameter value region to better cover possible optimal solutions.
[0110] In this embodiment, suitable target candidate configuration parameters are preliminarily determined to provide a reference for subsequent performance optimization and adjustment of new applications. The average configuration value of the target candidate configuration parameters is used to determine the parameter value range to narrow the scope of parameter search and improve the accuracy of parameter configuration.
[0111] In an exemplary embodiment, Figure 5 As shown, step 102 includes steps 502 to 510. Among them:
[0112] Step 502, obtaining applications, application data, multiple sets of candidate configuration parameters, candidate configuration parameter data, environment data and scheduler data in the data analysis platform.
[0113] In an embodiment of the present application, the terminal obtains an application and application data corresponding to the application, executes the application, and extracts code features based on the execution status of the application. For different configuration parameter combinations, the terminal can pre-define multiple groups of candidate configuration parameters and record the specific settings of each group of parameters. The parameter data can be obtained from configuration files, database tables or other setting documents. For environmental data, the operating environment information of the data analysis platform is obtained, including the operating system version, hardware configuration, software environment, etc., and environmental data is obtained through system information tools or configuration management tools, such as operating system commands, monitoring tools, etc. For scheduler data, the terminal can obtain data used for task scheduling and execution management through scheduler management tools, scheduler interfaces, etc., including node information and task dependencies in the scheduler.
[0114] Step 504, segment the code data into stages to obtain a plurality of stage-level codes, and embed the stage-level code according to the token embedding matrix to obtain code features for each stage-level code.
[0115] In an embodiment of the present application, the terminal first uses tooling technology to split an application instance into several stage-level instances. For each application, the terminal uses a pre-set Java agent jar file to modify the bytecode of the Spark core package, such as org (apache or spark or rdd), api, mllib, and graphix. The jar file monitors the class of the Spark core package when it is loaded at each stage, and stores the code in a hash table. After the application is executed, the application log is parsed to extract the stage-level code. Therefore, the tooling captures the operations of each stage and obtains more informative features to obtain the stage-level code.
[0116] After obtaining the stage-level code, the terminal uses a token embedding matrix to represent the stage-level code. The token embedding matrix is obtained by concatenating the token embeddings, i.e., C i ∈R D×N , where D is the embedding size of each code token, for example, N = 1000 is the maximum number of tokens at each stage, and padding (i.e., adding zeros) is performed on short codes to obtain code features.
[0117] Step 506: embed the nodes and edges in the scheduler data according to the node embedding matrix and the adjacency matrix to obtain scheduler features.
[0118] The nodes include data frames of application data, and the edges include application operations of the application programs.
[0119] In the embodiment of the present application, the terminal extracts the stage-level scheduler DAG by parsing the event log file. The stage-level DAG scheduler consists of a set of labeled nodes and directed edges. The nodes represent resilient distributed datasets (RDDs) or DataFrames, and the edges represent the operations to be applied. Therefore, in order to fully capture the semantics of the DAG and enhance the predictive power, the terminal uses a node embedding matrix to represent the nodes and an adjacency matrix to represent the edges, that is, G i ={V i ,A i}. The node embedding matrix is given by V i ∈R |V|×(S+1) Represented as , where |V| is the number of nodes in the DAG and S is the embedding size of each node. To increase generalization ability, an out-of-vocabulary token (labeled as ovv) is added to handle atomic operations that have not been seen in the test application.
[0120] Step 508: Count the application data according to the preset dimensional features to obtain application data features.
[0121] In an embodiment of the present application, the terminal performs statistical analysis on the application data according to preset dimensional features to obtain a characteristic representation of the application data, which is used to describe the characteristics and information of the application data, wherein the preset dimensional features may be the number of rows, columns, iterations, and partitions of the application data.
[0122] Step 510, embed each group of candidate configuration parameters and environmental data into an array to obtain candidate configuration parameter features and environmental features.
[0123] In an embodiment of the present application, the terminal embeds each group of candidate configuration parameters and environmental data into an array to obtain a representation of the candidate configuration parameter characteristics and environmental characteristics, which are used to describe the expression of the configuration parameters and environmental information in the model.
[0124] In this embodiment, by converting various types of data into corresponding feature representation forms, important feature information and reference basis are provided for parameter configuration of the data analysis platform, thereby improving the accuracy of the parameter configuration.
[0125] In an exemplary embodiment, Figure 6 As shown, step 106 includes steps 602 to 608. Among them:
[0126] Step 602: Screen candidate configuration parameters according to parameter value regions to obtain multiple groups of target candidate configuration parameters.
[0127] In an embodiment of the present application, the terminal screens each parameter in the parameter value area, excludes parameter values that do not meet the conditions, and comprehensively considers the combination of various parameters to screen out candidate configuration parameter combinations in the parameter value area to obtain multiple groups of target candidate configuration parameters.
[0128] Step 604, for each set of target candidate configuration parameters, predict each stage-level code based on the tower-structured multi-layer perceptron, code features, scheduler features, candidate configuration parameter features and environment features to obtain performance results corresponding to each stage-level code.
[0129] In an embodiment of the present application, the terminal predicts the performance of each stage-level code based on a tower-structured multi-layer perceptron (MLP) model, combining code features, scheduler features, candidate configuration parameter features and environmental features, to obtain performance results corresponding to each stage-level code.
[0130] The training of the multilayer perceptron based on the tower structure is to train the base learners in the multilayer perceptron based on the feedback output of the performance prediction model based on the sample data in the training set, and select the adjusted sampled parameters to distribute and train the next base learner. Each base learner corrects the error of the previously trained base learner, and after a finite number of iterations, a trained multilayer perceptron based on the tower structure is obtained. The multilayer perceptron based on the tower structure finally outputs the configuration parameters of the data analysis platform corresponding to the application.
[0131] Step 606: Summarize the performance results under each set of target candidate configuration parameters to obtain the target performance results corresponding to each set of target candidate configuration parameters.
[0132] In an embodiment of the present application, the terminal integrates the performance results of each stage-level code under each set of target candidate configuration parameters, including performance indicators such as running time and resource occupancy, and summarizes the performance results of each stage-level code under each set of candidate configuration parameters to calculate a comprehensive performance result. The comprehensive performance result reflects the efficiency and performance of each target candidate configuration parameter for the application program operation.
[0133] Step 608: Determine target parameters among target candidate configuration parameters based on the target performance result.
[0134] In the embodiment of the present application, the terminal analyzes the performance results of each group of target candidate configuration parameters to determine the optimal parameter combination, i.e., the target parameters. Optionally, the terminal can display the performance comparison of different configuration parameter combinations through visualization means such as charts and graphs to intuitively present the performance results of each group of target candidate configuration parameters.
[0135] In this embodiment, the performance results are predicted according to the target candidate configuration parameters in the parameter value area, and the optimal configuration parameter combination is determined, so as to optimize the configuration parameters of the data analysis platform and obtain the target configuration parameters.
[0136] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0137] Based on the same inventive concept, the embodiment of the present application also provides a parameter configuration device for implementing the parameter configuration method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more parameter configuration device embodiments provided below can refer to the limitations on the parameter configuration method above, and will not be repeated here.
[0138] In an exemplary embodiment, Figure 7 As shown, a parameter configuration device 700 is provided, comprising: an acquisition module 701, a determination module 702 and a selection module 703, wherein:
[0139] An acquisition module 701 is used to acquire code features, application data features, multiple sets of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of an application program in a data analysis platform;
[0140] A determination module 702, configured to determine a parameter value region based on multiple sets of candidate configuration parameters, code features, application data features, and performance prediction models;
[0141] The selection module 703 is used to select parameters in the parameter value area based on the tower-structured multi-layer perceptron, code features, scheduler features, candidate configuration parameter features and environment features to obtain the target parameters corresponding to the application in the data analysis platform.
[0142] In one embodiment, the determination module 702 is specifically used to process the code features, application data features and candidate configuration parameters according to the performance prediction model, and establish a mapping relationship between the code features and application data features and the candidate configuration parameters;
[0143] Taking the code features and application data features in each set of mapping relationships as constraints, calculating the parameter values of each set of candidate configuration parameters to obtain the initial parameter values corresponding to the candidate configuration parameters;
[0144] The parameter value area is determined according to the running time of the application program under each set of candidate configuration parameters and application data and the initial parameter value corresponding to each set of candidate configuration parameters.
[0145] In one embodiment, the determination module 702 is specifically used to extract the code features according to the text feature extraction method to obtain the code weight;
[0146] The code weight, application data features and candidate configuration parameters are processed according to the performance prediction model, and a mapping relationship between the code features, application data features and the candidate configuration parameters is established.
[0147] In one embodiment, the determination module 702 is specifically used to sort the running time of the application under each group of candidate configuration parameters and application data, and determine the candidate configuration parameter whose running time is less than a preset threshold in the sorting result as the target candidate configuration parameter;
[0148] The average configuration value of the target candidate configuration parameter is calculated, and the parameter value range is determined according to the average configuration value.
[0149] In one embodiment, the acquisition module 701 is specifically used to acquire code data, application data, multiple sets of candidate configuration parameters, candidate configuration parameter data, environment data, and scheduler data of an application program in a data analysis platform;
[0150] The code data is segmented into stages to obtain multiple stage-level codes. For each stage-level code, the stage-level code is embedded according to the token embedding matrix to obtain the code feature.
[0151] The nodes and edges in the scheduler data are respectively embedded according to the node embedding matrix and the adjacency matrix to obtain scheduler features; the nodes include data frames of application data, and the edges include application operations of the application program;
[0152] Count the application data according to the preset dimension features to obtain the application data features;
[0153] Each group of candidate configuration parameters and environmental data is embedded into an array to obtain candidate configuration parameter features and environmental features.
[0154] In one of the embodiments, the selection module 703 is specifically used to screen the candidate configuration parameters according to the parameter value region to obtain multiple groups of target candidate configuration parameters;
[0155] For each set of target candidate configuration parameters, the codes at each stage are predicted based on the tower-structured multi-layer perceptron, code features, scheduler features, candidate configuration parameter features, and environment features, and the performance results corresponding to the codes at each stage are obtained.
[0156] Summarize the performance results under each set of target candidate configuration parameters to obtain the target performance results corresponding to each set of target candidate configuration parameters;
[0157] Target parameters are determined among target candidate configuration parameters based on the target performance results.
[0158] Each module in the above parameter configuration device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.
[0159] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store code features, application data features, multiple groups of candidate configuration parameters, candidate configuration parameter features, environmental features, scheduler features and target parameters. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a parameter configuration method is implemented.
[0160] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0161] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0162] Obtaining code features, application data features, multiple sets of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of an application in a data analysis platform;
[0163] Determine parameter value regions based on multiple sets of candidate configuration parameters, code features, application data features, and performance prediction models;
[0164] Based on the tower-structured multi-layer perceptron, code features, scheduler features, candidate configuration parameter features and environment features, parameter selection is performed on the parameter value area to obtain the corresponding target parameters of the application in the data analysis platform.
[0165] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0166] Processing code features, application data features, and candidate configuration parameters according to the performance prediction model, and establishing a mapping relationship between code features, application data features, and candidate configuration parameters;
[0167] Taking the code features and application data features in each set of mapping relationships as constraints, calculating the parameter values of each set of candidate configuration parameters to obtain the initial parameter values corresponding to the candidate configuration parameters;
[0168] The parameter value area is determined according to the running time of the application program under each set of candidate configuration parameters and application data and the initial parameter value corresponding to each set of candidate configuration parameters.
[0169] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0170] Extract code features according to the text feature extraction method to obtain code weights;
[0171] The code weight, application data features and candidate configuration parameters are processed according to the performance prediction model, and a mapping relationship between the code features, application data features and the candidate configuration parameters is established.
[0172] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0173] Sorting the running time of the application under each group of candidate configuration parameters and application data, and determining the candidate configuration parameters whose running time is less than a preset threshold in the sorting result as target candidate configuration parameters;
[0174] The average configuration value of the target candidate configuration parameter is calculated, and the parameter value range is determined according to the average configuration value.
[0175] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0176] Obtain code data, application data, multiple sets of candidate configuration parameters, candidate configuration parameter data, environment data, and scheduler data of an application program in a data analysis platform;
[0177] The code data is segmented into stages to obtain multiple stage-level codes. For each stage-level code, the stage-level code is embedded according to the token embedding matrix to obtain the code feature.
[0178] The nodes and edges in the scheduler data are respectively embedded according to the node embedding matrix and the adjacency matrix to obtain scheduler features; the nodes include data frames of application data, and the edges include application operations of the application program;
[0179] Count the application data according to the preset dimension features to obtain the application data features;
[0180] Each group of candidate configuration parameters and environmental data is embedded into an array to obtain candidate configuration parameter features and environmental features.
[0181] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0182] The candidate configuration parameters are screened according to the parameter value region to obtain multiple groups of target candidate configuration parameters;
[0183] For each set of target candidate configuration parameters, the codes at each stage are predicted based on the tower-structured multi-layer perceptron, code features, scheduler features, candidate configuration parameter features, and environment features, and the performance results corresponding to the codes at each stage are obtained.
[0184] Summarize the performance results under each set of target candidate configuration parameters to obtain the target performance results corresponding to each set of target candidate configuration parameters;
[0185] Target parameters are determined among target candidate configuration parameters based on the target performance results.
[0186] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0187] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0188] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0189] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0190] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0191] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A parameter configuration method, characterized in that: The method comprises: Obtaining code features, application data features, multiple sets of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of an application in a data analysis platform; Determining a parameter value region according to the plurality of groups of candidate configuration parameters, the code features, the application data features, and the performance prediction model; Parameter selection is performed on the parameter value area based on a tower-structured multilayer perceptron, the code features, the scheduler features, the candidate configuration parameter features and the environment features to obtain the target parameters corresponding to the application in the data analysis platform.
2. The method according to claim 1, characterized in that The determining of the parameter value region according to the plurality of groups of candidate configuration parameters, the code features, the application data features and the performance prediction model comprises: Processing the code features, application data features and candidate configuration parameters according to the performance prediction model, and establishing a mapping relationship between the code features, the application data features and the candidate configuration parameters; Taking the code features and the application data features in each group of the mapping relationships as constraints, calculating the parameter values of each group of the candidate configuration parameters to obtain the initial parameter values corresponding to the candidate configuration parameters; A parameter value region is determined according to the running time of the application program under each set of the candidate configuration parameters and the application data and the initial parameter value corresponding to each set of the candidate configuration parameters.
3. The method according to claim 2, characterized in that The processing of the code features, the application data features and the candidate configuration parameters according to the performance prediction model to establish a mapping relationship between the code features, the application data features and the candidate configuration parameters includes: Extract the code features according to the text feature extraction method to obtain the code weight; The code weight, application data features and candidate configuration parameters are processed according to the performance prediction model, and a mapping relationship between the code features, the application data features and the candidate configuration parameters is established.
4. The method according to claim 2, characterized in that: The determining of the parameter value area according to the running time of the application under each group of the candidate configuration parameters and the application data and the initial parameter value corresponding to each group of the candidate configuration parameters includes: Sorting the running time of the application under each group of the candidate configuration parameters and application data, and determining the candidate configuration parameters whose running time is less than a preset threshold in the sorting result as target candidate configuration parameters; An average configuration value of the target candidate configuration parameter is calculated, and a parameter value range is determined according to the average configuration value.
5. The method according to claim 1, characterized in that The method of obtaining code features, application data features, multiple groups of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of an application program in a data analysis platform includes: Obtain code data, application data, multiple sets of candidate configuration parameters, candidate configuration parameter data, environment data, and scheduler data of an application program in a data analysis platform; The code data is segmented into stages to obtain a plurality of stage-level codes, and for each of the stage-level codes, the stage-level code is embedded according to a token embedding matrix to obtain a code feature; The nodes and edges in the scheduler data are respectively embedded according to the node embedding matrix and the adjacency matrix to obtain scheduler features; the nodes include the data frames of the application data, and the edges include the application operations of the application; Performing statistics on the application data according to preset dimensional features to obtain application data features; Each group of the candidate configuration parameters and the environmental data are array-embedded to obtain candidate configuration parameter features and environmental features.
6. The method according to claim 1, characterized in that The multi-layer perceptron based on the tower structure, the code features, the scheduler features, the candidate configuration parameter features and the environment features perform parameter selection on the parameter value area to obtain the target parameters corresponding to the application in the data analysis platform, including: Screening the candidate configuration parameters according to the parameter value region to obtain multiple groups of target candidate configuration parameters; For each group of the target candidate configuration parameters, predict each stage-level code based on a tower-structured multilayer perceptron, the code features, the scheduler features, the candidate configuration parameter features and the environment features to obtain performance results corresponding to each stage-level code; Summarizing the performance results under each group of the target candidate configuration parameters to obtain the target performance results corresponding to each group of the target candidate configuration parameters; A target parameter is determined among the target candidate configuration parameters based on the target performance result.
7. A parameter configuration device, characterized in that: The device comprises: An acquisition module, used to acquire code features, application data features, multiple sets of candidate configuration parameters, candidate configuration parameter features, environment features, and scheduler features of an application program in a data analysis platform; A determination module, configured to determine a parameter value region based on the plurality of groups of candidate configuration parameters, the code features, the application data features, and the performance prediction model; A selection module is used to perform parameter selection on the parameter value area based on a tower-structured multi-layer perceptron, the code features, the scheduler features, the candidate configuration parameter features and the environment features to obtain the target parameters corresponding to the application in the data analysis platform.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
