Application program optimization method and related device

By monitoring environmental information to judge task changes and using corresponding optimization models to generate optimal configuration parameters, the problem that offline optimization in the existing technology cannot cope with task changes is solved, and efficient online optimization of the application is achieved.

CN120066601APending Publication Date: 2025-05-30HUAWEI TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311641832.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-30
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

The parameter tuning method of existing applications mainly uses offline optimization, which cannot effectively deal with tasks changes in production environments, resulting in unsatisfactory optimization results.

Method used

By monitoring multiple environment information, we can determine whether the tasks running in the application have changed. If it has not changed, we use the first optimization model based on historical data to generate the optimal configuration parameters. If the task changes, we use the second optimization model based on the changed data to generate the optimal configuration parameters and apply them to the application.

Benefits of technology

It realizes online optimization during application operation, improves optimization effect and efficiency, and can dynamically respond to task changes without affecting the normal operation of the business.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066601A_ABST
    Figure CN120066601A_ABST
Patent Text Reader

Abstract

The invention provides an application program optimization method and a related device, the optimization method relates to the field of computers, and the application program optimization method comprises the following steps: obtaining multiple pieces of environment information; determining whether a task operated in the application program is changed or not according to the multiple pieces of environment information; if the task running in the application program does not change, a first optimization model is used for generating a first optimal configuration parameter, and the first optimization model is obtained based on data training corresponding to the unchanged task; if the task running in the application program changes, a second optimization model is used for generating a second optimal configuration parameter, and the second optimization model is obtained through data training corresponding to the changed task; and applying the first optimal configuration parameter or the second optimal configuration parameter to the application program. By adopting the application program optimization method provided by the invention, online optimization of the application program can be realized, the optimization effect is good, and the efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and in particular, to an application program optimization method and related devices. Background Art

[0002] In application software, there are generally a large number of parameters. These adjustable parameters control various aspects of the system operation. By optimizing these parameters, the execution efficiency of the application can be significantly improved, and at the same time, errors such as memory overflow and disk exhaustion can be reduced.

[0003] Currently, the parameter tuning method for application programs adopts offline optimization, that is, tuning parameters for the same offline task, and deploying the parameters obtained after tuning on the application program. However, in the actual production environment, during the operation of the application program, the running tasks are not fixed and may change. If the tasks change, the parameter optimization based on the tasks before the change will not have an ideal optimization effect for the changed tasks. Summary of the Invention

[0004] This application provides an application program optimization method and related devices. This method realizes the online optimization of the application program. By using the optimization method of this application, the optimization effect is good and the efficiency is high.

[0005] In a first aspect, this application provides an application program optimization method, including:

[0006] Determine whether the tasks running in the application program have changed according to multiple environment information;

[0007] If the tasks running in the application program have not changed, use a first optimization model to generate first optimal configuration parameters, and the first optimization model is trained based on the data corresponding to the unchanged tasks;

[0008] If the tasks running in the application program have changed, use a second optimization model to generate second optimal configuration parameters, and the second optimization model is trained based on the data corresponding to the changed tasks;

[0009] Apply the first optimal configuration parameters or the second optimal configuration parameters to the application program.

[0010] The present application provides an online optimization method for an application program. During the running of the application program, multiple environment information is obtained, and it is determined whether the tasks running in the application program have changed according to the multiple environment information. If the tasks running in the application program have not changed, the first optimal configuration parameters are generated through the first optimization model, and the first optimization model is trained based on the data corresponding to the unchanged tasks. If the tasks running in the application program have changed, it is necessary to first train the second optimization model based on the data corresponding to the changed tasks, and then use the second optimization model to generate the second optimal configuration parameters. Finally, the first optimal configuration parameters or the second optimal configuration parameters are applied to the application program. The online optimization method for the application program provided by the present application can optimize the application program during the running of the application program, without pausing the business in the application program and without affecting the normal operation of the business in the application program; during the optimization process, it is considered that the tasks running in the application program may change. For the situation where the running tasks change, the application program is optimized based on the changed tasks to generate the optimal configuration parameters. By using the optimization method provided by the present application, the optimization effect is better and the optimization efficiency is higher.

[0011] Based on the first aspect, in a possible implementation manner, the data corresponding to the unchanged tasks includes multiple configuration parameters when the unchanged tasks ran at a historical moment and multiple environment information obtained according to the multiple configuration parameters.

[0012] It can be understood that when the tasks running in the application program have not changed, the first optimization model can be trained based on the configuration parameters input into the application program when the task ran at a historical moment and the environment information obtained according to the configuration parameters.

[0013] Based on the first aspect, in a possible implementation manner, before using the second optimization model to generate the second optimal configuration parameters, the method further includes:

[0014] Determine multiple similar tasks similar to the changed tasks;

[0015] Determine the optimal configuration parameters of each similar task among the multiple similar tasks;

[0016] Train the second optimization model based on the optimal configuration parameters of each similar task and the multiple environment information when the changed tasks run, where the data corresponding to the changed tasks includes the optimal configuration parameters of each similar task among the multiple similar tasks and the multiple environment information when the changed tasks run.

[0017] When the tasks running in the application change, since the tasks have changed, the first optimization model trained based on the tasks before the change is not applicable to the tasks after the change. Therefore, it is necessary to train a second optimization model based on the tasks after the change. By determining multiple similar tasks similar to the tasks after the change, applying the optimal configuration parameters of the multiple similar tasks to the current tasks, and training the second optimization model based on multiple environment information during the operation of the current tasks and the optimal configuration parameters of the multiple similar tasks, the number of training times can be reduced, the training speed can be increased, and a better second optimization model can be obtained as soon as possible. In addition, when the tasks in the application change in this application, a second optimization model (new model) is trained according to the data corresponding to the tasks after the change, and the second optimal configuration parameters are generated through the second optimization model. Compared with obtaining the optimal configuration parameters through multiple rounds of learning and training by the first optimization model, the solution of this application has the characteristics of good optimization effect and high efficiency.

[0018] Based on the first aspect, in a possible implementation manner, determining whether the tasks running in the application change according to multiple environment information includes:

[0019] Set the time window to s, within the time window s, t configuration parameters are input into the application, and t environment information is generated by the tasks running in the application, where t is an integer greater than 1;

[0020] Determine whether the t environment information in the current time window and the t environment information in the previous time window meet the preset conditions;

[0021] If it is satisfied, the tasks running in the application have changed;

[0022] If it is not satisfied, the tasks running in the application have not changed.

[0023] It can be understood that if the tasks running in the application change, the difference in the obtained environment information is relatively large. By setting the time window, comparing the environment information obtained in the current time window with the environment information obtained in the previous time window, and judging whether the preset conditions are met, it is determined whether the tasks running in the application have changed.

[0024] Based on the first aspect, in a possible implementation manner, each environment information in the multiple environment information includes multiple indicators, and the multiple indicators are used to represent the operating system running environment and the application running environment; the preset conditions include a first condition and a second condition;

[0025] Determine whether the t environment information in the current time window and the t environment information in the previous time window meet the preset conditions. If it is satisfied, the tasks running in the application have changed. If it is not satisfied, the tasks running in the application have not changed, including:

[0026] Determine the mean value of each metric within the current time window based on t environmental information within the current time window; determine the mean value of each metric within the previous time window based on t environmental information within the previous time window; determine the difference between the mean values of each metric within the current time window and the previous time window; if the difference in the mean values of m1 or more metrics exceeds the first threshold, then the first condition is satisfied;

[0027] Determine the variance of each metric within the current time window based on t environmental information within the current time window; if the variance of m2 or more metrics exceeds the second threshold, then the second condition is satisfied;

[0028] 1) If both the first condition and the second condition are satisfied, then the tasks running in the application change;

[0029] 2) If neither the first condition nor the second condition is satisfied, then the tasks running in the application do not change;

[0030] 3) If one of the first condition and the second condition is satisfied, and after continuous comparison of j rounds of time windows, the result of each round of comparison is that one of the first condition and the second condition is satisfied, where j is the third threshold, then:

[0031] Run the optimal configuration of the task in the previous Nth time window on the current task to obtain verification environmental information; take the difference between the metrics in the verification environmental information and the metrics of the environmental information obtained according to the optimal configuration of the task in the previous Nth time window; if the difference in m3 or more metrics exceeds the fourth threshold, then the tasks running in the application change; otherwise, the tasks running in the application do not change;

[0032] 4) If one of the first condition and the second condition is satisfied, and after continuous comparison of i rounds of time windows, the results of the previous i rounds of comparison are that one of the first condition and the second condition is satisfied, and the result of the (i + 1)th round is different from the results of the previous i rounds, where i + 1 is less than or equal to the third threshold, then: Determine whether the tasks running in the application change according to the result of the (i + 1)th round according to 1) and 2).

[0033] It can be seen that the preset conditions include a first condition and a second condition. If the environmental information obtained in the current time window and the environmental information obtained in the previous time window meet these two conditions, it is determined that the tasks running in the application have changed; if neither of these two conditions is met, it is determined that the tasks have not changed; if one of the conditions is met but the number of rounds does not exceed the set third threshold, it is also determined that the tasks have not changed; if one of the conditions is met but the number of rounds exceeds the set third threshold, it is further determined whether the tasks have changed by applying the optimal configuration at the historical moment to the current tasks.

[0034] Based on the first aspect, in a possible implementation, the change of the tasks running in the application includes any one or more of the following:

[0035] 1) The nature of the task changes, and the nature of the task includes read tasks, write tasks, and other processing tasks;

[0036] 2) The content of the task operation changes;

[0037] 3) The quantity of the task operation content changes.

[0038] The change of the tasks includes the change of one or more of the nature of the task, the content of the task operation, and the quantity of the task operation content. Therefore, if one or more of the nature of the task, the content of the task operation, and the quantity of the task operation content change, it is determined that the tasks have changed.

[0039] In the second aspect, the present application provides an application optimization device, including:

[0040] A determination module, configured to determine whether the tasks running in the application have changed according to multiple environmental information;

[0041] An optimization module, configured to, if the tasks running in the application have not changed, generate first optimal configuration parameters using a first optimization model, where the first optimization model is trained based on the data corresponding to the unchanged tasks;

[0042] The optimization module is further configured to, if the tasks running in the application have changed, generate second optimal configuration parameters using a second optimization model, where the second optimization model is trained based on the data corresponding to the changed tasks;

[0043] An application module, configured to apply the first optimal configuration parameters or the second optimal configuration parameters to the application.

[0044] Based on the second aspect, in a possible implementation, the data corresponding to the unchanged tasks includes multiple configuration parameters when the unchanged tasks run at the historical moment and multiple environmental information obtained according to the multiple configuration parameters.

[0045] Based on the second aspect, in a possible implementation manner, the device further includes a warm start module.

[0046] The warm start module is used to: determine multiple similar tasks similar to the changed task; determine the optimal configuration parameters of each similar task among the multiple similar tasks;

[0047] The optimization module is used to train a second optimization model based on the optimal configuration parameters of each similar task and multiple environment information during the runtime of the changed task, where the data corresponding to the changed task includes the optimal configuration parameters of each similar task among the multiple similar tasks and multiple environment information during the runtime of the changed task.

[0048] Based on the second aspect, in a possible implementation manner, the determination module is used to:

[0049] Set the time window as s, include t configuration parameters input into the application within the time window s, and the tasks running in the application generate t environment information, where t is an integer greater than 1;

[0050] Determine whether the t environment information within the current time window and the t environment information within the previous time window meet the preset conditions;

[0051] If it is satisfied, the task running in the application has changed;

[0052] If it is not satisfied, the task running in the application has not changed.

[0053] Based on the second aspect, in a possible implementation manner, each of the multiple environment information includes multiple indicators, and the multiple indicators are used to represent the operating system running environment and the application running environment; the preset conditions include a first condition and a second condition;

[0054] The determination module is used to:

[0055] According to the t environment information within the current time window, determine the mean value of each indicator within the current time window; according to the t environment information within the previous time window, determine the mean value of each indicator within the previous time window; determine the difference between the mean values of each indicator within the current time window and the previous time window; if there are m1 items or more than m1 items of the difference between the mean values of the indicators exceeding the first threshold, the first condition is satisfied;

[0056] According to the t environment information within the current time window, determine the variance of each indicator within the current time window; if there are m2 items or more than m2 items of the variance of the indicators exceeding the second threshold, the second condition is satisfied;

[0057] 1) If both the first condition and the second condition are satisfied, the task running in the application has changed;

[0058] 2) If neither the first condition nor the second condition is satisfied, the tasks running in the application program remain unchanged;

[0059] 3) If one of the first condition and the second condition is satisfied, and after consecutive j rounds of comparison of time windows, the result of each round of comparison is that one of the first condition and the second condition is satisfied, where j is the third threshold, then: Run the optimal configuration of the task in the previous Nth time window on the current task to obtain verification environment information; Subtract the indicators in the verification environment information from the indicators of the environment information obtained according to the optimal configuration of the task in the previous Nth time window; If there are m3 or more items of the difference in indicators exceeding the fourth threshold, the tasks running in the application program change; Otherwise, the tasks running in the application program remain unchanged;

[0060] Run the optimal configuration of the task in the previous Nth time window on the current task to obtain verification environment information; Subtract the indicators in the verification environment information from the indicators of the environment information obtained according to the optimal configuration of the task in the previous Nth time window; If there are m3 or more items of the difference in indicators exceeding the fourth threshold, the tasks running in the application program change; Otherwise, the tasks running in the application program remain unchanged;

[0061] 4) If one of the first condition and the second condition is satisfied, and after consecutive i rounds of comparison of time windows, the results of the previous i rounds of comparison are all that one of the first condition and the second condition is satisfied, and the result of the (i + 1)th round is different from the results of the previous i rounds, where i + 1 is less than or equal to the third threshold, then: Determine whether the tasks running in the application program change according to the result of the (i + 1)th round according to 1) and 2).

[0062] Based on the second aspect, in a possible implementation, the change of the tasks running in the application program includes any one or more of the following:

[0063] 1) The nature of the task changes, and the nature of the task includes read tasks, write tasks, and other processing tasks;

[0064] 2) The content of the task operation changes;

[0065] 3) The quantity of the task operation content changes.

[0066] Each functional module included in the second aspect is used to implement the method described in the first aspect and any possible implementation manner of the first aspect.

[0067] In a third aspect, the present application provides a computing device cluster, including at least one computing device, at least one computing device includes a memory and a processor, and the processor of at least one computing device is configured to execute instructions stored in the memory of at least one computing device, so that the computing device cluster implements the method described in the first aspect and any possible implementation manner of the first aspect.

[0068] Fourthly, the present application provides a computer storage medium, including computer program instructions, which, when executed by a computing device cluster, cause the computing device cluster to execute the method as described in the first aspect and any possible implementation manner of the first aspect above.

[0069] Fifthly, the present application provides a computer program product, including program instructions, which, when executed by a computing device cluster, cause the computing device cluster to execute the method as described in the first aspect or any possible implementation manner of the first aspect above. The computer program product may be a software installation package. In the case where it is necessary to use the method provided by any possible design of the foregoing first aspect, the computer program product can be downloaded and executed on the computing device cluster to implement the method as described in the first aspect and any possible implementation manner of the first aspect.

[0070] Sixthly, the present application provides an intelligent network card, which is used to implement the method as described in the first aspect and any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 FIG. is a schematic diagram of a system architecture provided by the present application;

[0072] Figure 2 FIG. is a schematic diagram of the structure of an optimizer provided by the present application;

[0073] Figure 3 FIG. is a schematic flowchart of an application program optimization method provided by the present application;

[0074] Figure 4 FIG. is a schematic logic diagram for determining whether a task has changed provided by the present application;

[0075] Figure 5 FIG. is a schematic flowchart after a task running in an application program has changed provided by the present application;

[0076] Figure 6 FIG. is a schematic diagram of the structure of an application program optimization device provided by the present application;

[0077] Figure 7 FIG. is a schematic diagram of the structure of a computing device provided by the present application;

[0078] Figure 8 FIG. is a schematic diagram of the structure of a computing device cluster provided by the present application;

[0079] Figure 9 FIG. is a schematic diagram of the structure of another computing device cluster provided by the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0080] The embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the scope of protection of the present application.

[0081] It should be noted that the terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "the", and "said" used in the embodiments of the present application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0082] See Figure 1 , Figure 1 which is a schematic diagram of a system architecture provided by the present application. Figure 1 In the system, there are a client, an application, and an optimizer.

[0083] Among them, the application can be any application, such as a database, office software, social software, chat software, etc.

[0084] The optimizer is used to optimize the application. Specifically, the optimizer provides configuration parameters for the application, obtains environmental information and observation results from the application, then processes based on the environmental information and observation results to obtain the optimal configuration parameters of the application, and applies the optimal configuration parameters to the application to improve the performance of the application.

[0085] The client is used to input optimization settings and optimization goals to the optimizer. The optimization settings include, for example, any one or more of the optimization period, the space that the optimizer can optimize the application, the parameters to be optimized, etc. Among them, the meaning of the optimization period is the period for the optimizer to perform optimization operations on the application, and the meaning of the parameters to be optimized is which parameters in the application the optimizer can adjust and optimize to achieve the set optimization goal. The optimization goal can be, for example, to improve throughput, reduce latency, minimize resource consumption, etc. When the optimization goal is to reduce throughput, the observation result can be how much the throughput is, or the observation result can be the parameter representing the throughput; when the optimization goal is to reduce latency, the observation result can be the specific value of the latency or the parameter representing the latency.

[0086] Optionally, the optimizer can also output a visualization result to the client. The visualization result can be, for example, the observation result or data that can reflect the relevant observation result.

[0087] The present application provides an optimizer. See Figure 2 ,Figure 2 The figure is a schematic structural diagram of an optimizer provided by this application. The optimizer includes a determination module, a historical database, a warm start module, and an optimization module.

[0088] Among them, the determination module is used to determine whether the tasks running in the application have changed according to the environmental information. When the tasks have not changed, the optimization module obtains multiple pieces of environmental information, configuration parameters, and corresponding observation results from the historical database module. Then, the optimization module uses these data to establish a model to establish the mapping relationship between the environmental information, configuration parameters, and observation results. Through a certain number of learning and iteration times, a first optimization model is obtained, and the first optimization model is used to optimize the parameters of the application to obtain the first optimal configuration parameters. Among them, the explanations of the environmental information and observation results are specifically described in the method embodiments below and will not be elaborated here. For details, please refer to the descriptions of the method embodiments below. When the tasks have changed, the warm start module will determine multiple similar tasks similar to the changed tasks, determine the optimal configuration parameters of each similar task among the multiple similar tasks, train a second optimization model based on the optimal configuration parameters of each similar task and multiple pieces of environmental information during the operation of the changed tasks, and use the second optimization model to optimize the parameters of the application to obtain the second optimal configuration parameters. Among them, how to determine multiple similar tasks similar to the changed tasks is specifically described in the method embodiments below and will not be elaborated here. For details, please refer to the descriptions of the method embodiments below.

[0089] The historical database is used to store configuration parameters, environmental information obtained according to the configuration parameters, and observation results during the operation of the application. Among them, the configuration parameters, environmental information obtained according to the configuration parameters, and observation results are in one-to-one correspondence. The historical database is also used to store each task identity document (ID). Each time the optimizer iterates, there is a corresponding task ID. The task ID is corresponding to the configuration parameters, environmental information obtained according to the configuration parameters, and observation results, that is, each set of configuration parameters, environmental information, and observation results has a task ID. Only when the determination model determines that the task has changed, the task ID will change; otherwise, the task ID remains unchanged.

[0090] Optionally, the optimizer can exist in the form of a software program installation package. The optimizer installation package is installed on the device where the application is located, and the application is optimized through the optimizer installation package. Optionally, the optimizer can also exist in the form of a smart card or a hardware device, which is plugged in or integrated and deployed on the device where the application is located. The optimizer can also be set on a cloud server, and the user can use the optimization service of the optimizer through the cloud server, and so on. The optimizer can also exist in other forms, which are not listed one by one in this application. The form of the optimizer does not constitute a limitation to this solution.

[0091] Based on the above Figure 1 and Figure 2 the described system architecture, this application provides an application optimization method. Refer to Figure 3 , Figure 3 which is a schematic flowchart of an application optimization method provided by this application. The method is applied to an optimizer, and the method includes but is not limited to the following description.

[0092] S101. Obtain multiple pieces of environment information, where each piece of environment information includes operating system environment information and application program environment information.

[0093] Environment information refers to data that describes various indicators, characteristics, and working characteristics of the task execution environment, including operating system environment information and application software information.

[0094] Among them, the operating system environment information refers to data on various indicators and characteristics of the operating system in the task execution environment, providing data on the basic performance and resource utilization of the task execution environment. The operating system environment information includes but is not limited to any one or more of the central processing unit (CPU) utilization rate, memory usage, disk I / O, and network bandwidth. The application program environment information refers to data on various indicators, characteristics, and working characteristics of a specific software in the task execution environment, which can characterize the working characteristics of the task. The application program environment information includes but is not limited to any one or more of the built-in indicators of the software, running indicators, and log information.

[0095] For example, in the MySQL database scenario, the query response time, the number of connections, and the number of concurrently executed queries are important built-in monitoring indicators in the SQL database. The query response time reflects the time required for the database to process query requests. A higher response time may indicate that the database is overloaded or the query statement needs to be optimized. The number of connections represents the current number of connections established with the database. Too many connections may cause the database resources to be strained and affect performance. Monitoring the number of connections can help the optimizer determine whether it is necessary to adjust the size of the database connection pool. The number of concurrently executed queries represents the number of queries executed simultaneously. A higher number of concurrent queries may cause the database performance to decline. By monitoring the number of concurrently executed queries, the optimizer can adjust the database resource allocation to improve performance. Therefore, in the MySQL database scenario, these indicators can be used as application program environment information to better understand and optimize the performance and running status of the database.

[0096] For another example, in the Redis database scenario, memory usage and hit rate are important built-in monitoring metrics. Memory usage reflects the current memory size occupied by the database. Excessive memory usage may lead to performance degradation or memory overflow. The hit rate represents the proportion of successfully finding the required data in the cache. A higher hit rate means higher performance and efficiency. Therefore, in the Redis database scenario, by monitoring these metrics, we can better understand and optimize the performance and running status of the Redis database to improve the performance and response speed of the application.

[0097] For another example, in the Kafka database scenario, message processing rate and partition offset are key running metrics. The message processing rate reflects the speed at which the database processes messages. A higher processing rate means higher throughput and performance. The partition offset represents the position of messages in each partition. By monitoring the partition offset, we can understand data consistency. Therefore, in the Kafka database scenario, by monitoring these metrics, we can better understand and optimize the performance and running status of the Kafka database to improve the performance and reliability of the application.

[0098] For another example, in the Spark database scenario, task execution time and data processing rate are important log information metrics. The task execution time reflects the time required for each task to complete. A shorter execution time means higher efficiency and performance. The data processing rate represents the amount of data processed per second. A higher processing rate means higher throughput and performance. Therefore, in the Spark database scenario, by monitoring these metrics, we can better understand and optimize the performance and running status of the Spark database to improve the performance and data processing ability of the application.

[0099] In one implementation, when the optimizer optimizes the tasks running in the application, it can use an algorithm to generate configuration parameters. Since the application records the environmental information under each configuration parameter, when the configuration parameter is applied to the application, the optimizer can obtain the environmental information corresponding to the current configuration parameter from the application. It should be understood that this implementation is only a possible implementation of obtaining environmental information in the embodiments of the present application. The application does not make specific limitations on the way of obtaining environmental information.

[0100] S102. Determine whether the tasks running in the application have changed according to multiple pieces of environmental information.

[0101] Set a time window s. The size of the time window can be a fixed duration or the time required to input t configuration parameters into the application, run t configuration parameters in the application, and generate t pieces of environmental information, where t is an integer greater than 1. The application does not make specific limitations on the definition of the time window.

[0102] For example, five configuration parameters are input into the application, and these five configuration parameters are run in the application to generate five pieces of environment information. The time consumed in this process is used as a time window.

[0103] For another example, the optimizer obtains multiple configuration parameters through an algorithm, runs these multiple configuration parameters in the application to generate multiple environments. In this process, the time is divided into multiple time windows, and the size of each time window is 5 seconds.

[0104] The changes that occur to the tasks running in the application include any one or more of the following:

[0105] 1) The nature of the task changes, and the nature of the task includes read tasks, write tasks, and other processing tasks;

[0106] 2) The content of the task operation changes;

[0107] 3) The quantity of the content of the task operation changes.

[0108] For operations, for example, during the running process of the application, if it changes from a read task (read operation) to a write task (write operation), then the nature of the task has changed; for another example, during the running process of a database application, if it changes from originally reading 2 tables to reading 8 tables, then it can be understood that the content of the task operation has changed, or the quantity of the content of the task operation has changed; for another example, during the running process of an office software, if it changes from originally reading a document to reading an image, then the content of the task operation has changed. When the tasks in the application change including any one or more of the above changes, it can be considered that the tasks in the application have changed.

[0109] For how to determine that the tasks in the application have changed, refer to Figure 4 , Figure 4 which is the logic schematic diagram for determining whether a task has changed provided by this application.

[0110] Determine whether the t pieces of environment information in the current time window and the t pieces of environment information in the previous time window meet the preset conditions. If they meet, it is determined that the tasks running in the application have changed; if they do not meet, it is determined that the tasks running in the application have not changed.

[0111] Among them, each piece of environment information among the multiple pieces of environment information includes multiple indicators, and the multiple indicators are used to represent the operating system running environment and the application running environment. For example, one piece of environment information includes CPU utilization rate, memory usage, query response time, and the number of connections. The CPU utilization rate and memory usage are used to represent the operating system running environment, and the query response time and the number of connections are used to represent the application running environment.

[0112] It should be noted that the environmental information can be represented in the form of a vector. If the environmental information includes 20 indicators, it can also be said that the dimension of the environmental vector is 20.

[0113] The preset conditions include a first condition and a second condition.

[0114] The first condition is: based on t environmental information within the current time window, determine the mean value of each indicator within the current time window; based on t environmental information within the previous time window, determine the mean value of each indicator within the previous time window; determine whether there are m1 or more than m1 differences in the mean values of the indicators between the current time window and the previous time window that exceed the first threshold. Here, m1 is any non - negative integer, and the first threshold is any non - negative number. Regarding the magnitudes of m1 and the first threshold, this application does not make specific limitations.

[0115] The second condition is: based on t environmental information within the current time window, determine the variance of each indicator within the current time window; determine whether there are m2 or more than m2 variances of the indicators that exceed the second threshold. Here, m2 is any non - negative integer, and the second threshold is any non - negative number. Regarding the magnitudes of m2 and the second threshold, this application does not make specific limitations.

[0116] It should be noted that if there are m1 or more than m1 differences in the mean values of the indicators between the current time window and the previous time window that exceed the first threshold, the first condition is satisfied; otherwise, it is not. If there are m2 or more than m2 variances of the indicators that exceed the second threshold, the second condition is satisfied; otherwise, it is not.

[0117] For example, a time window includes 5 configuration parameters input into an application, and the tasks running in the application generate 5 environmental information. The value of m1 is 10, the first threshold is 3, and the dimension of the environmental vector is 20. Calculate the mean value of the environmental vector corresponding to the 5 configuration parameters in each dimension within the current time window; find the previous time window and calculate the mean value of the environmental vector corresponding to the 5 configuration parameters in each dimension within the previous time window. If there are 5 - dimensional differences in the mean values of the environmental vectors corresponding to the 5 configuration parameters between the current time window and the previous time window that exceed 3, it is determined that the first condition is not satisfied.

[0118] For another example, a time window includes seven configuration parameters input to an application, and the tasks running in the application generate seven pieces of environment information. The value of m1 is 10, the first threshold is 3, and the dimension of the environment vector is 20. Calculate the mean value of the environment vectors corresponding to the seven configuration parameters in each dimension on the current time window; find the previous time window and calculate the mean value of the environment vectors corresponding to the seven configuration parameters in each dimension on the previous time window. If the difference in the mean values of the environment vectors corresponding to the seven configuration parameters in each dimension within the current time window and the previous time window exceeds 3 in 15 dimensions, it is determined that the first condition is satisfied.

[0119] For another example, a time window includes ten configuration parameters input to an application, and the tasks running in the application generate ten pieces of environment information. The value of m2 is 6, the second threshold is 1, 3, and the dimension of the environment vector is 20. Calculate the variance of the ten configuration parameters in each dimension on the current time window. If the variance exceeds 1 in two dimensions, it is determined that the second condition is not satisfied.

[0120] For another example, a time window includes ten configuration parameters input to an application, and the tasks running in the application generate ten pieces of environment information. The value of m2 is 6, the second threshold is 1, 3, and the dimension of the environment vector is 20. Calculate the variance of the ten configuration parameters in each dimension on the current time window. If the variance exceeds 1 in ten dimensions, it is determined that the second condition is satisfied.

[0121] The specific determination rules are as follows:

[0122] (1) If both the above first condition and the above second condition are satisfied, it is determined that the tasks running in the application have changed;

[0123] (2) If neither the above first condition nor the above second condition is satisfied, it is determined that the tasks running in the application have not changed;

[0124] (3) If either the above first condition or the above second condition is satisfied, and after continuous comparison of j rounds of time windows, the result of each round of comparison is that either the above first condition or the above second condition is satisfied, then a replay mechanism detection needs to be performed to make a further judgment on the task. Here, j is the third threshold.

[0125] For example, the third threshold is 5. If either the above first condition or the above second condition is satisfied, and after continuous comparison of five rounds of time windows, the result of each round of comparison is that either the above first condition or the above second condition is satisfied, then a replay mechanism detection needs to be performed to make a further judgment on the task.

[0126] The process of the replay mechanism detection is as follows:

[0127] (a) Run the optimal configuration of the task in the previous Nth time window on the current task to obtain environmental information.

[0128] (b) Subtract the indicators in the environmental information from the indicators in the environmental information obtained according to the optimal configuration of the task in the previous N time windows.

[0129] (c) If there are m3 or more indicators whose differences exceed the fourth threshold, it is determined that the task running in the application has changed; otherwise, it is determined that the task running in the application has not changed.

[0130] For example, if any of the above first condition and the above second condition is satisfied, and after continuous comparison of 5 rounds of time windows, the result of each round of comparison is that any of the above first condition and the above second condition is satisfied, then find the optimal configuration of the task in the previous 4th (N = 4) time window, and then run the optimal configuration of the task on the current task to obtain a verification environment vector; subtract the verification environment vector from the environment vector obtained according to the optimal configuration parameters in the previous 4th (N = 4) time window in each dimension; if there are 10 dimensions whose differences exceed the fourth threshold, it is determined that the task running in the application has changed; otherwise, it is determined that the task running in the application has not changed.

[0131] (4) If one of the first condition and the second condition is satisfied, and after continuous comparison of i rounds of time windows, the results of the previous i rounds of comparison are all that one of the first condition and the second condition is satisfied, and the result of the (i + 1)th round is different from the results of the previous i rounds, where (i + 1) is less than or equal to the third threshold, then: according to the result of the (i + 1)th round, determine whether the task running in the application has changed according to 1) and 2). If the result of the (i + 1)th round is that both the first condition and the second condition are satisfied, the task running in the application has changed; if the result of the (i + 1)th round is that neither the first condition nor the second condition is satisfied, the task running in the application has not changed.

[0132] Each threshold in this application can be set to a specific value by the user according to specific applications, and this application does not limit the value of the threshold.

[0133] S103. If the task running in the application has not changed, use the first optimization model to generate the first optimal configuration parameters, and the first optimization model is trained based on the data corresponding to the unchanged task.

[0134] When the tasks running in the application remain unchanged, the optimizer establishes a first optimization model, which is obtained through machine learning based on multiple configuration parameters when the unchanged tasks were running at historical moments and multiple environment information obtained according to the multiple configuration parameters.

[0135] After obtaining the first optimization model, use the first optimization model to generate the first optimal configuration parameters.

[0136] During the online optimization process, in order to improve the user experience and reduce the recommendation of configurations with poor actual performance, it is necessary to screen the candidate configuration parameters and only retain those with better performance. This can reduce the interference to the user experience and improve the security of online optimization.

[0137] The input of the first optimization model is the environment information and configuration parameters, and the output is the predicted effect of the configuration parameters, which is represented by a probability distribution. When the task remains unchanged, input a certain configuration parameter and the current environment information into the first optimization model to obtain the probability distribution of the configuration parameter. According to the probability distribution of the configuration parameter, the mean and variance can be obtained. (Mean - 2 * standard deviation) can be compared with the fifth threshold. If it is less than the fifth threshold, then delete the configuration parameter and do not use it during the application optimization process. Among them, (Mean - 2 * standard deviation) represents a 95% confidence level. Here, (Mean - 2 * standard deviation) is just an example. In actual applications, higher or lower confidence levels can also be used, which is not limited here.

[0138] It should be noted that the method for screening out poor configuration parameters provided in this application is just one implementation method, and it can also be other methods, which are not specifically limited in this application.

[0139] S104. If the tasks running in the application change, use the second optimization model to generate the second optimal configuration parameters, and the second optimization model is trained based on the data corresponding to the changed tasks.

[0140] When the tasks running in the application change, the configuration parameters corresponding to the tasks before the change are not applicable to the changed tasks. If starting from scratch for optimization, the early effects cannot be guaranteed, and the optimization algorithm also requires certain observation results to have stable effects.

[0141] Therefore, after determining that the tasks running in the application have changed, perform a warm start operation in the warm start module. Among them, warm start means finding multiple tasks similar to the changed tasks, training the second optimization model with the optimal configurations of the similar tasks and their corresponding environments, so as to obtain the second optimal configuration parameters.

[0142] Operations to be performed when the tasks running in the application change are shown in Figure 5 , Figure 5 which is the schematic flowchart of the process after the tasks running in the application provided by this application change. The method includes but is not limited to the following description.

[0143] S1041. Determine multiple similar tasks similar to the changed task.

[0144] In one implementation, tasks can be obtained from the historical database, and then multiple tasks similar to the changed task can be determined from the obtained tasks. Regarding the source of the tasks, this application does not make specific limitations.

[0145] Compare the obtained tasks with the changed task in terms of similarity. In one implementation, a regression model can be used for task similarity comparison. The input of the regression model is two task environment vectors, and the output is the similarity of the tasks. Regarding the implementation of task similarity comparison, this application does not make specific limitations.

[0146] For example, the regression model is a Light Gradient Boosting Machine (LightGBM), the input is two task environment vectors, and the output is the similarity of the tasks.

[0147] It should be noted that since there is no historical data when the algorithm starts, when the number of historical tasks is less than N, the Euclidean distance can be used for task similarity comparison. For example, the value of N can be 10. Among them, the Euclidean distance refers to the distance between two points in a multi-dimensional space. Specifically, by calculating the sum of the squares of the differences between two samples in each dimension and then taking the square root, the Euclidean distance can be obtained. In this application, the environmental information is presented in the form of an environmental vector, that is, the environmental vector contains multiple dimensions. Calculate the sum of the squares of the differences between two samples in each dimension and then take the square root to obtain the Euclidean distance. Determine the task similarity according to the magnitude of the Euclidean distance.

[0148] Calculate the similarity between two tasks. For example, the similarity sim(i, j) between the i-th task and the j-th task is calculated as follows:

[0149]

[0150] where |D r | is the number of configuration parameters, and F(i, j) is the number of configuration pairs in which the observed result predictions of two tasks for multiple configuration parameters are consistent. The value of sim(i, j) is between [0, 1].

[0151] The calculation formula of F(i, j) is as follows:

[0152]

[0153] where M i is the first optimization model established for the i-th task, and M j is the first optimization model established for the j-th task, x k is the k-th configuration parameter, and x l is the 1st configuration parameter. is the exclusive NOR operator. In formula (2), ll represents judging the truth or falsehood of the proposition inside it. If the proposition inside it is true, then ll is 1; if the proposition inside it is false, then ll is 0, that is, if (M i (x k ) < M i (x l )) is the same as (M j (x k ) < M j (x l )), then ll is 1; if (M i (x k ) < M i (x l )) is different from (M j (x k ) < M j (x l )), then ll is 0.

[0154] Regarding the understanding of F(i, j), specifically, assume that 10 configuration parameters are obtained according to the algorithm. The 10 configuration parameters are respectively input into the task with task id 1 to obtain the environmental information of the 10 configuration parameters in the task with task id 1. The 10 configuration parameters are respectively input into the task with task id 2 to obtain the environmental information of the 10 configuration parameters in the task with task id 2. To verify the similarity between the task with task id 1 and the task with task id 2, the 10 configuration parameters and the environmental information in the task with task id 1 are input into the optimization model of the task with task id 1 to obtain the observation results of the 10 configuration parameters on the task with task id 1. The 10 configuration parameters and the environmental information in the task with task id 2 are input into the optimization model of the task with task id 2 to obtain the observation results of the 10 configuration parameters on the task with task id 2. The observation results of the 10 configuration parameters on the task with task id 1 are sorted, and the observation results of the 10 configuration parameters on the task with task id 2 are also sorted. The number of configuration pairs with consistent sorting results is the value of F(i, j).

[0155] For example, there are a total of 5 configuration parameters. After the optimization model of the first task predicts these 5 configuration parameters, 5 observation results are obtained. The configuration parameters are sorted according to the observation results, and the sorting result is "13425", where 1 refers to the number of the first configuration parameter, 2 refers to the number of the second configuration parameter, and so on, 5 refers to the number of the fifth configuration parameter; after the optimization model of the second task predicts these 5 configuration parameters, 5 observation results are obtained. The configuration parameters are sorted according to the observation results, and the sorting result is "14325". Among the two sorting results, the sorting of 1 and 2 is that 1 is in front of 2, the sorting of 1 and 3 is that 1 is in front of 3, the sorting of 1 and 4 is that 1 is in front of 4, the sorting of 1 and 5 is that 1 is in front of 5, the sorting of 2 and 3 is that 3 is in front of 2, the sorting of 2 and 4 is that 4 is in front of 2, the sorting of 2 and 5 is that 2 is in front of 5, the sorting of 3 and 4 is different: in the optimization model of the first task, 3 is in front of 4, in the optimization model of the second task, 3 is behind 4, the sorting of 3 and 5 is that 3 is in front of 5, the sorting of 4 and 5 is that 4 is in front of 5. Therefore, there are a total of 10 situations, among which 9 situations have the same sorting. The number of configuration pairs with the same sorting result in the sorting result is 9, that is, the value of F(i,j) is 9, and the value of sim(i,j) is 9 / 10.

[0156] S1042. Determine the optimal configuration parameters for each of the multiple similar tasks.

[0157] Multiple tasks are stored in the historical database, and each task has its corresponding optimal configuration parameters, environment information, and observation results. After determining that multiple tasks are similar to the changed task, obtain the optimal configuration parameters of each similar task among the multiple similar tasks from the database, where it is possible to determine which of the multiple configuration parameters corresponding to each similar task is the optimal configuration parameter according to the observation results.

[0158] S1043. Train a second optimization model based on the optimal configuration parameters of each similar task and multiple environment information during the operation of the changed task.

[0159] Run the optimal configuration parameters of each similar task on the changed task to obtain the environment information when each configuration parameter runs on the changed task. Train a second optimization model based on the optimal configuration parameters of each similar task and the environment information during the operation of the changed task.

[0160] S1044. Use the second optimization model to generate second optimal configuration parameters.

[0161] Execute the second optimization model for a certain number of iterations to generate second optimal configuration parameters.

[0162] S105. Apply the first optimal configuration parameters or the second optimal configuration parameters to the application program.

[0163] If the tasks running in the application do not change, the first optimal configuration parameters obtained from the first optimization model are applied to the application; if the tasks running in the application change, the second optimal configuration parameters obtained from the second optimization model are applied to the application.

[0164] The present application provides an online optimization method for an application. During the running of the application, multiple environment information is obtained, and it is determined whether the tasks running in the application have changed according to the multiple environment information. If the tasks running in the application do not change, the first optimization model is used to generate the first optimal configuration parameters, and the first optimization model is trained based on the data corresponding to the unchanged tasks. If the tasks running in the application change, it is necessary to first train the second optimization model based on the data corresponding to the changed tasks, and then use the second optimization model to generate the second optimal configuration parameters. Finally, the first optimal configuration parameters or the second optimal configuration parameters are applied to the application. The online optimization method for the application provided by the present application can optimize the application during the running of the application, without having to pause the services in the application, and does not affect the normal operation of the services in the application; during the optimization process, it is considered that the tasks running in the application may change. For the situation where the running tasks change, the application is optimized based on the changed tasks to generate the optimal configuration parameters. Using the optimization method provided by the present application, the optimization effect is better and the optimization efficiency is higher.

[0165] The above describes the method embodiments. Next, the device corresponding to the method embodiments is introduced.

[0166] See Figure 6 , Figure 6 which is a schematic structural diagram of an application optimization device 600 provided by the present application. The application optimization device 600 can be Figure 1 or Figure 2 an optimizer in the system architecture. The application optimization device 600 includes:

[0167] A determination module 610, configured to determine whether the tasks running in the application have changed according to multiple environment information;

[0168] An optimization module 620, configured to, if the tasks running in the application do not change, use the first optimization model to generate the first optimal configuration parameters, and the first optimization model is trained based on the data corresponding to the unchanged tasks;

[0169] The optimization module 620 is further configured to, if the tasks running in the application change, use the second optimization model to generate the second optimal configuration parameters, and the second optimization model is trained based on the data corresponding to the changed tasks;

[0170] An application module 630, configured to apply the first optimal configuration parameter or the second optimal configuration parameter to an application program.

[0171] In a possible implementation, the data corresponding to the unchanged tasks includes multiple configuration parameters when the unchanged tasks ran at a historical moment and multiple environment information obtained based on the multiple configuration parameters.

[0172] In a possible implementation, the apparatus further includes a warm start module 640, and the warm start module 640 is configured to: determine multiple similar tasks similar to the changed task; determine the optimal configuration parameter of each similar task among the multiple similar tasks;

[0173] The optimization module 620 is configured to train a second optimization model based on the optimal configuration parameters of each similar task and the multiple environment information when the changed task runs, wherein the data corresponding to the changed task includes the optimal configuration parameters of each similar task among the multiple similar tasks and the multiple environment information when the changed task runs.

[0174] In a possible implementation, the determination module 610 is configured to:

[0175] Set a time window as s, within the time window s, t configuration parameters are input into the application program, and the tasks running in the application program generate t environment information, where t is an integer greater than 1;

[0176] Determine whether the t environment information in the current time window and the t environment information in the previous time window meet a preset condition;

[0177] If it is satisfied, the tasks running in the application program have changed;

[0178] If it is not satisfied, the tasks running in the application program have not changed.

[0179] In a possible implementation, each of the multiple environment information includes multiple indicators, and the multiple indicators are used to represent the operating system running environment and the application program running environment; the preset condition includes a first condition and a second condition;

[0180] The determination module 610 is configured to:

[0181] According to the t environment information in the current time window, determine the mean value of each indicator in the current time window; according to the t environment information in the previous time window, determine the mean value of each indicator in the previous time window; determine the difference between the mean values of each indicator in the current time window and the previous time window; if there are m1 items or more than m1 items of the difference between the mean values of the indicators exceeding the first threshold, then the first condition is satisfied;

[0182] Based on t environmental information within the current time window, determine the variance of each metric within the current time window; if the variance of m2 or more metrics exceeds the second threshold, then the second condition is satisfied;

[0183] 1) If both the first condition and the second condition are satisfied simultaneously, then the tasks running in the application change;

[0184] 2) If neither the first condition nor the second condition is satisfied, then the tasks running in the application do not change;

[0185] 3) If any one of the first condition and the second condition is satisfied, and after continuous comparison of j rounds of time windows, the result of each round of comparison is that any one of the first condition and the second condition is satisfied, then:

[0186] Run the optimal configuration of the task in the previous Nth time window on the current task to obtain verification environmental information; take the difference between each metric in the verification environmental information and the environmental information obtained according to the optimal configuration of the task in the previous Nth time window; if the difference of m3 or more metrics exceeds the fourth threshold, then the tasks running in the application change; otherwise, the tasks running in the application do not change;

[0187] 4) If any one of the first condition and the second condition is satisfied, and after continuous comparison of i rounds of time windows, the results of the previous i rounds of comparison are that any one of the first condition and the second condition is satisfied, and the result of the (i + 1)th round is different from the results of the previous i rounds, where i + 1 is less than or equal to the third threshold, then: Determine whether the tasks running in the application change according to the result of the (i + 1)th round according to 1) and 2).

[0188] In a possible implementation, the change of the tasks running in the application includes any one or more of the following:

[0189] 1) The nature of the task changes, and the nature of the task includes read tasks, write tasks, and other processing tasks;

[0190] 2) The content of the task operation changes;

[0191] 3) The quantity of the task operation content changes.

[0192] Among them, the determination module 610, the optimization module 620, the application module 630, and the warm start module 640 can all be implemented by software or can be implemented by hardware. Exemplarily, next, taking the determination module 610 as an example, the implementation manner of the determination module 610 is introduced. Similarly, the implementation manners of the optimization module 620, the application module 630, and the warm start module 640 can refer to the implementation manner of the determination module 610.

[0193] The application optimization device 600 can be deployed on a computing device. As an example of a software functional unit, the determination module 610 may include code running on the computing device. Among them, the computing device may be a computing device in a cloud service. For example, the computing device may be a bare metal server, a virtual machine, a container, etc. Further, the computing device may be one or more. For example, the determination module 610 may include code running on multiple computing devices. It should be noted that the multiple computing devices used to run this code may be distributed in the same region or in different regions. Further, the multiple computing devices used to run this code may be distributed in the same availability zone (AZ) or in different AZs. Each AZ includes one data center or multiple geographically proximate data centers. Among them, generally one region may include multiple availability zones AZs.

[0194] Similarly, the multiple computing devices used to run this code may be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Among them, generally one VPC is set within one region. For cross-region communication between two VPCs within the same region and between VPCs in different regions, a communication gateway needs to be set in each VPC, and the interconnection between VPCs is realized through the communication gateway.

[0195] As an example of a hardware functional unit, the determination module 610 may include at least one computing device. Or, the determination module 610 may also be a device implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). Among them, the above PLD may be implemented by a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0196] The multiple computing devices included in the determination module 610 may be distributed in the same region or in different regions. The multiple computing devices included in the determination module 610 may be distributed in the same availability zone (AZ) or in different AZs. Similarly, the multiple computing devices included in the determination module 610 may be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Among them, the multiple computing devices may be any combination of computing devices such as servers, application-specific integrated circuits (ASICs), programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), and generic array logic (GALs).

[0197] It should be noted that in other embodiments, the determination module 610 may be used to execute any step in an application optimization method. The optimization module 620, the application module 630, and the warm start module 640 may all be used to execute any step in an application optimization method. The steps to be implemented by the determination module 610, the optimization module 620, the application module 630, and the warm start module 640 can be specified as needed. By implementing different steps in an application optimization method through the determination module 610, the optimization module 620, the application module 630, and the warm start module 640 respectively, all functions of the application optimization device 600 are realized.

[0198] See Figure 7 , Figure 7 FIG. is a schematic structural diagram of a computing device 700 provided in this application. The computing device 700 may be, for example, a bare-metal server, a virtual machine, a container, etc. The computing device 700 may be configured as an optimizer or an application optimization device 600. The computing device 700 includes: a bus 702, a processor 704, a memory 706, and a communication interface 708. The processor 704, the memory 706, and the communication interface 708 communicate with each other through the bus 702. It should be understood that this application does not limit the number of processors and memories in the computing device 700.

[0199] The bus 702 may be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation, Figure 7 only one line is shown in, but it does not mean that there is only one bus or one type of bus. The bus 702 may include a path for transmitting information between various components of the computing device 700 (for example, the memory 706, the processor 704, the communication interface 708).

[0200] The processor 704 may include any one or more of processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0201] The memory 706 may include a volatile memory, such as a random access memory (RAM). The processor 704 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).

[0202] The executable program code is stored in the memory 706, and the processor 704 executes the executable program code to respectively implement the functions of the foregoing determination module 610, optimization module 620, application module 630, and warm start module 640, thereby implementing an application program optimization method. That is, instructions for executing an application program optimization method are stored on the memory 706.

[0203] The communication interface 708 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 700 and other devices or a communication network.

[0204] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device may also be a device such as a desktop computer or a laptop computer.

[0205] As Figure 8 shown, Figure 8 is a schematic structural diagram of a computing device cluster provided by the present application. The computing device cluster includes at least one computing device 700. Instructions for executing an application program optimization method that are the same may be stored in the memory 706 in one or more of the computing devices 700 in the computing device cluster.

[0206] In some possible implementations, the memory 706 of one or more computing devices 700 in the computing device cluster may also store some instructions for executing an application optimization method respectively. In other words, the combination of one or more computing devices 700 can be used to jointly execute the instructions of an application optimization method.

[0207] It should be noted that the memories 706 in different computing devices 700 in the computing device cluster may store different instructions, which are respectively used to execute partial functions of the computing device 700. That is to say, the instructions stored in the memories 706 of different computing devices 700 can implement the functions of one or more of the determination module 610, the optimization module 620, the application module 630, and the warm start module 640.

[0208] In some possible implementations, one or more computing devices in the computing device cluster can be connected through a network. Among them, the network can be a wide area network or a local area network, etc. Figure 9 A possible implementation is shown. As Figure 9 shown, two computing devices 700A and 700B are connected through a network. Specifically, they are connected to the network through the communication interfaces in each computing device. In this type of possible implementation, the memory 706 in the computing device 700A stores the instructions for executing the function of the determination module 610. At the same time, the memory 706 in the computing device 700B stores the instructions for executing the functions of the optimization module 620, the application module 630, and the warm start module 640. Among them, the determination module 610 in the computing device 700A is used to determine whether the tasks running in the application program have changed, and the optimization module 620 and the warm start module 640 in the computing device 700B are used to generate optimal configuration parameters in the case of determining that the tasks running in the application program have changed or not, and the application module 630 is used to apply the generated optimal configuration parameters to the application program.

[0209] It should be understood that Figure 9 the functions of the computing device 700A shown in

[0210] can also be completed by multiple computing devices 700, or the computing device cluster includes multiple computing devices with the same functions as the computing device 700A. Similarly, the functions of the computing device 700B can also be completed by multiple computing devices 700, or the computing device cluster includes multiple computing devices with the same functions as the computing device 700B. Figure 8 and Figure 9The connection mode of the computing device cluster. Different from this, in the memory 706 of one or more computing devices 700 in the computing device cluster, there may be stored different instructions for executing an application program optimization method. In some possible implementation manners, in the memory 706 of one or more computing devices 700 in the computing device cluster, there may also be respectively stored partial instructions for executing an application program optimization method. In other words, the combination of one or more computing devices 700 can jointly execute the instructions for executing an application program optimization method.

[0211] This application provides an intelligent network card, and the intelligent network card is used to execute the instructions of an application program optimization method in the foregoing method embodiment.

[0212] The embodiment of this application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can run on a computing device or be stored in any available medium. When the computer program product runs on at least one computing device, at least one computing device is caused to execute an application program optimization method.

[0213] The embodiment of this application also provides a computer-readable storage medium. The computer-readable storage medium may be any available medium that a computing device can store or a data storage device such as a data center including one or more available media. The available medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive), etc. The computer-readable storage medium includes instructions, and the instructions instruct a computing device or a computing device cluster to execute an application program optimization method.

[0214] The foregoing embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the protection scope of the technical solutions of the embodiments of the present invention.

Claims

1. An application optimization method, characterized in that, it includes: Determine whether the tasks running in the application have changed according to multiple environment information; If the tasks running in the application have not changed, use the first optimization model to generate the first optimal configuration parameters, and the first optimization model is trained based on the data corresponding to the unchanged tasks; If the tasks running in the application have changed, use the second optimization model to generate the second optimal configuration parameters, and the second optimization model is trained based on the data corresponding to the changed tasks; Apply the first optimal configuration parameters or the second optimal configuration parameters to the application.

2. The method according to claim 1, characterized in that, The data corresponding to the unchanged tasks includes multiple configuration parameters when the unchanged tasks ran at historical moments and multiple environment information obtained according to the multiple configuration parameters.

3. The method according to claim 1 or 2, characterized in that, Before using the second optimization model to generate the second optimal configuration parameters, the method further includes: Determine multiple similar tasks similar to the changed tasks; Determine the optimal configuration parameters of each similar task among the multiple similar tasks; The second optimization model is trained based on the optimal configuration parameters of each similar task and multiple environment information when the changed tasks run, wherein the data corresponding to the changed tasks includes the optimal configuration parameters of each similar task among the multiple similar tasks and multiple environment information when the changed tasks run.

4. The method according to any one of claims 1 to 3, characterized in that, The determination of whether the tasks running in the application have changed according to multiple environment information includes: Set the time window as s, and within the time window s, t configuration parameters are input into the application, and the tasks running in the application generate t environment information, where t is an integer greater than 1; Determine whether the t environment information in the current time window and the t environment information in the previous time window meet the preset conditions; If so, the tasks running in the application have changed; If not, the tasks running in the application have not changed.

5. The method according to claim 4, characterized in that, Each environment information among the multiple environment information includes multiple indicators, and the multiple indicators are used to represent the operating system running environment and the application running environment; the preset conditions include a first condition and a second condition; The determination of whether the t environment information in the current time window and the t environment information in the previous time window meet the preset conditions, if so, the tasks running in the application have changed, if not, the tasks running in the application have not changed, includes: Determine the mean value of each metric within the current time window based on t environmental information within the current time window; determine the mean value of each metric within the previous time window based on t environmental information within the previous time window; determine the difference between the mean values of each metric within the current time window and the previous time window; if the difference in the mean values of m1 or more metrics exceeds the first threshold, then the first condition is satisfied; Determine the variance of each metric within the current time window based on the t environmental information within the current time window; if the variance of m2 or more metrics exceeds the second threshold, then the second condition is satisfied; 1) If both the first condition and the second condition are satisfied simultaneously, then the tasks running in the application program have changed; 2) If neither the first condition nor the second condition is satisfied, then the tasks running in the application program have not changed; 3) If one of the first condition and the second condition is satisfied, and after continuous comparison of j rounds of time windows, the result of each round of comparison is that one of the first condition and the second condition is satisfied, where j is the third threshold, then: Run the optimal configuration of the task in the previous Nth time window on the current task to obtain verification environmental information; subtract the metrics in the verification environmental information from the metrics of the environmental information obtained according to the optimal configuration of the task in the previous Nth time window; if the difference in m3 or more metrics exceeds the fourth threshold, then the tasks running in the application program have changed; otherwise, the tasks running in the application program have not changed; 4) If one of the first condition and the second condition is satisfied, and after continuous comparison of i rounds of time windows, the results of the previous i rounds of comparison are that one of the first condition and the second condition is satisfied, and the result of the (i + 1)th round is different from the results of the previous i rounds, where (i + 1) is less than or equal to the third threshold, then: Determine whether the tasks running in the application program have changed according to the result of the (i + 1)th round in accordance with 1), 2), and 3).

6. According to the method according to any one of claims 1 to 5, characterized in that, The change in the tasks running in the application program includes any one or more of the following: 1) The nature of the task changes, and the nature of the task includes read tasks, write tasks, and other processing tasks; 2) The content of the task operation changes; 3) The quantity of the task operation content changes.

7. An application program optimization device, characterized in that, comprising: A determination module for determining whether the tasks running in the application program have changed based on multiple environmental information; An optimization module for, if the tasks running in the application program have not changed, using a first optimization model to generate first optimal configuration parameters, where the first optimization model is trained based on data corresponding to the unchanged tasks; The optimization module is further configured to, if the tasks running in the application change, generate second optimal configuration parameters using a second optimization model, where the second optimization model is trained based on data corresponding to the changed tasks; An application module, configured to apply the first optimal configuration parameters or the second optimal configuration parameters to the application.

8. The apparatus according to claim 7, wherein, The data corresponding to the unchanged tasks includes multiple configuration parameters when the unchanged tasks ran at historical moments and multiple environment information obtained based on the multiple configuration parameters.

9. The apparatus according to claim 7 or 8, wherein, The apparatus further includes a warm start module, The warm start module is configured to: determine multiple similar tasks similar to the changed task; determine the optimal configuration parameters of each similar task among the multiple similar tasks; The optimization module is configured to train the second optimization model based on the optimal configuration parameters of each similar task and multiple environment information when the changed task runs, where the data corresponding to the changed task includes the optimal configuration parameters of each similar task among the multiple similar tasks and multiple environment information when the changed task runs.

10. The apparatus according to any one of claims 7 to 9, wherein, The determination module is configured to: Set a time window as s, include t configuration parameters input into the application within the time window s, and the tasks running in the application generate t environment information, where t is an integer greater than 1; Determine whether the t environment information within the current time window and the t environment information within the previous time window meet a preset condition; If so, the tasks running in the application change; If not, the tasks running in the application have not changed.

11. The apparatus according to claim 10, wherein, Each of the multiple environment information includes multiple indicators, and the multiple indicators are used to represent the operating system running environment and the application running environment; the preset condition includes a first condition and a second condition; The determination module is configured to: According to the t environment information within the current time window, determine the mean value of each indicator within the current time window; according to the t environment information within the previous time window, determine the mean value of each indicator within the previous time window; determine the difference between the mean values of each indicator within the current time window and the previous time window; if there are m1 items or more than m1 items of the difference between the mean values of the indicators exceeding a first threshold, the first condition is met; According to the t environment information within the current time window, determine the variance of each indicator within the current time window; if there are m2 items or more than m2 items of the variance of the indicators exceeding a second threshold, the second condition is met; 1) If both the first condition and the second condition are met, the tasks running in the application change; 2) If neither the first condition nor the second condition is met, the tasks running in the application have not changed; 3) If one of the first condition and the second condition is satisfied, and after continuous comparison of j time windows, the result of each round of comparison is that one of the first condition and the second condition is satisfied, where j is the third threshold, then: Run the optimal configuration of the task in the previous N time windows on the current task to obtain verification environment information; subtract the indicators in the verification environment information from the indicators of the environment information obtained according to the optimal configuration of the task in the previous N time windows; if the difference in m3 or more indicators exceeds the fourth threshold, the task running in the application program has changed; otherwise, the task running in the application program has not changed; 4) If one of the first condition and the second condition is satisfied, and after continuous comparison of i time windows, the results of the previous i rounds of comparison are all that one of the first condition and the second condition is satisfied, and the result of the (i + 1)-th round is different from the results of the previous i rounds, where i + 1 is less than or equal to the third threshold, then: Determine whether the task running in the application program has changed according to the result of the (i + 1)-th round according to 1) and 2).

12. The device according to any one of claims 7 to 11, characterized in that The change of the task running in the application program includes any one or more of the following: 1) The nature of the task changes, and the nature of the task includes read task, write task, and other processing tasks; 2) The content of the task operation changes; 3) The quantity of the task operation content changes.

13. A computing device cluster, characterized in that It includes at least one computing device, the at least one computing device includes a memory and a processor, and the processor of the at least one computing device is used to execute the instructions stored in the memory of the at least one computing device, so that the computing device cluster implements the method according to any one of claims 1 to 6.

14. A computer storage medium, characterized in that It includes computer program instructions, and when the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 1 to 6.