A parameter optimization method, device, equipment and medium

Through screening, classification and automatic optimization methods, the optimal values ​​of Linux system kernel parameters are determined, solving the problems of traditional optimization relying on experience and low efficiency, achieving efficient and accurate parameter optimization, and reducing labor costs.

CN115016835BActive Publication Date: 2024-10-18INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210592996.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-27
Publication Date
2024-10-18
Estimated Expiration
2042-05-27

AI Technical Summary

Technical Problem

Traditional Linux system kernel parameter optimization relies on the experience of R&D personnel, which is inefficient and costly. Moreover, enumerating all possible parameter values ​​takes a long time, resulting in inaccurate determination of optimal parameters.

Method used

By obtaining the default values ​​of all parameters, filter out the parameters to be optimized, classify them according to the default values, match the preset parameter types and adjustment strategies, and perform automatic optimization to determine the optimal parameter values.

Benefits of technology

It realizes automatic parameter optimization without relying on the experience of R&D personnel, improves efficiency and accuracy, saves labor costs, and has strong stability and versatility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115016835B_ABST
    Figure CN115016835B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of computer technology, and in particular to a parameter optimization method, device, equipment and medium. The method comprises: obtaining the default values ​​of all parameters, and filtering out the parameters to be optimized from all parameters based on the default values ​​of each parameter; classifying each parameter to be optimized based on the default values ​​to obtain the parameter type corresponding to each parameter to be optimized; matching the target parameter adjustment strategy for the parameter type corresponding to each parameter to be optimized based on the correspondence between the preset parameter type and the parameter adjustment strategy; performing automatic optimization based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized. The solution of the present invention does not need to rely on the experience of R&D personnel, realizes automatic screening of parameters that can be optimized, and automatically finds the optimal parameters quickly according to the preset parameter adjustment strategy, has strong stability and versatility, and greatly saves labor costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a parameter optimization method, device, equipment and medium. Background Art

[0002] Linux, the full name of GNU / Linux, is a free to use and freely disseminated UNIX-like operating system. Its kernel was first released by Linus Benedict Torvalds on October 5, 1991. It is mainly inspired by the Minix operating system and the Unix operating system. It is a multi-user, multi-tasking, multi-threaded and multi-CPU (Central Processing Unit)-based operating system. The Linux system has as many as hundreds of kernel parameters, and the optimal parameter values ​​of some parameters are tens of thousands or even hundreds of thousands of times the default values. How to deeply optimize the kernel parameters of the Linux system so that the server can match different applications such as databases and middleware to achieve the ultimate performance is a difficult task.

[0003] At present, the kernel parameter optimization of traditional Linux systems mainly relies on the experience of R&D personnel, or enumerates all possible parameter values, and then verifies the performance corresponding to each possible parameter value and determines the optimal parameters through analysis. However, the above method has the following defects: on the one hand, the different experiences of each R&D personnel lead to inaccurate optimal parameters; on the other hand, enumerating all possibilities takes a long time to verify, which is inefficient and costly. Therefore, it is urgent to improve the existing parameter determination method. Summary of the invention

[0004] In view of this, it is necessary to provide a parameter optimization method, device, equipment and medium to address the above technical problems.

[0005] According to a first aspect of the present invention, a parameter optimization method is provided, the method comprising:

[0006] Get the default values ​​of all parameters, and filter out the parameters to be optimized from all parameters based on the default values ​​of each parameter;

[0007] Classifying each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized;

[0008] Matching a target parameter adjustment strategy to the parameter type corresponding to each parameter to be optimized based on the correspondence between the preset parameter type and the parameter adjustment strategy;

[0009] Automatic optimization is performed based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized.

[0010] In some embodiments, the step of selecting the parameter to be optimized from all parameters based on the default value of each parameter includes:

[0011] For each parameter, do the following:

[0012] Compare the default value with the range corresponding to the numerical value and the range corresponding to the character respectively;

[0013] In response to the default value falling within the range corresponding to the value, the parameter corresponding to the default value is used as the parameter to be optimized;

[0014] In response to the default value falling within the range corresponding to the character, the parameter corresponding to the default value is used as a parameter that does not need to be optimized.

[0015] In some embodiments, the step of classifying each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized includes:

[0016] For each parameter to be optimized, perform the following operations:

[0017] In response to the default value being equal to zero or equal to one, confirming that the parameter to be optimized is of Boolean type;

[0018] In response to the default value being greater than one and less than or equal to the first preset value, confirming that the parameter to be optimized is a short integer type;

[0019] In response to the default value being greater than a second preset value, it is confirmed that the parameter to be optimized is a long integer type, wherein the second preset value is greater than the first preset value.

[0020] In some embodiments, the correspondence between the preset parameter type and the parameter adjustment strategy includes: a Boolean type corresponds to a first parameter adjustment strategy, a short integer type corresponds to a second parameter adjustment strategy, and a long integer type corresponds to a third parameter adjustment strategy;

[0021] Among them, the first parameter adjustment strategy is to adopt the default value when the automatic optimization is performed for the first time, and to invert the default value when the automatic optimization is performed for the second time; the second parameter adjustment strategy is to adopt the default value when the automatic optimization is performed for the first time, and to multiply the previous parameter value by the first preset multiple when the automatic optimization is performed again subsequently; the third parameter adjustment strategy is to adopt the default value when the automatic optimization is performed for the first time, and to multiply the previous parameter value by the second preset multiple when the automatic optimization is performed again subsequently, wherein the second preset multiple is greater than the first preset multiple.

[0022] In some embodiments, the step of performing automatic optimization based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized includes:

[0023] In response to the target parameter adjustment strategy being the first parameter adjustment strategy, the parameter value adopted in the test with the higher test result of the two automatic optimization tests is used as the optimal parameter value;

[0024] In response to the target parameter adjustment strategy being the second parameter adjustment strategy or the third parameter adjustment strategy, the following steps are performed after each automatic optimization is completed:

[0025] Compare the test results of this automatic optimization execution with the test results of the previous automatic optimization execution;

[0026] If the test result of the current automatic optimization is higher than the test result of the previous automatic optimization, the new parameter value is reconfirmed based on the target adjustment strategy, and the automatic optimization is performed again based on the new parameter value;

[0027] If the test result of the current automatic optimization execution is lower than or equal to the test result of the previous automatic optimization execution, the parameter value used in the previous automatic optimization execution is used as the optimal parameter value.

[0028] In some embodiments, if the test score of the current automatic optimization execution is lower than or equal to the test score of the previous automatic optimization execution, before executing the step of using the parameter value used in the previous automatic optimization execution as the optimal parameter value, the method further includes:

[0029] At least once, a fourth parameter adjustment strategy is used to determine a new parameter value, and automatic optimization is performed again based on the new parameter value, wherein the fourth parameter adjustment strategy is to reduce the first preset multiple used by the second parameter adjustment strategy or to reduce the second preset multiple used by the third parameter adjustment strategy and multiply the parameter value used in the previous automatic optimization;

[0030] If the test result corresponding to the new parameter value determined at a certain time is higher than the test result of the previous automatic optimization, the new parameter value determined at a certain time is used as the optimal parameter value.

[0031] In some embodiments, the method is applied to a Linux system, and all the parameters are kernel parameters of the Linux system.

[0032] According to a second aspect of the present invention, there is provided a parameter optimization device, the device comprising:

[0033] A screening module is configured to obtain the default values ​​of all parameters and screen out the parameters to be optimized from all parameters based on the default value of each parameter;

[0034] A classification module, configured to classify each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized;

[0035] A matching module configured to match a target parameter adjustment strategy for a parameter type corresponding to each parameter to be optimized based on a correspondence between a preset parameter type and a parameter adjustment strategy;

[0036] The optimization module is configured to perform automatic optimization based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized.

[0037] According to a third aspect of the present invention, there is further provided a computer device, the computer device comprising:

[0038] at least one processor; and

[0039] The memory stores a computer program that can be run on the processor. When the processor executes the program, the parameter optimization method described above is performed. The method includes the following steps:

[0040] Get the default values ​​of all parameters, and filter out the parameters to be optimized from all parameters based on the default values ​​of each parameter;

[0041] Classifying each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized;

[0042] Matching a target parameter adjustment strategy to the parameter type corresponding to each parameter to be optimized based on the correspondence between the preset parameter type and the parameter adjustment strategy;

[0043] Automatic optimization is performed based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized.

[0044] According to a fourth aspect of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the aforementioned parameter optimization method is executed. The method comprises:

[0045] Get the default values ​​of all parameters, and filter out the parameters to be optimized from all parameters based on the default values ​​of each parameter;

[0046] Classifying each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized;

[0047] Matching a target parameter adjustment strategy to the parameter type corresponding to each parameter to be optimized based on the correspondence between the preset parameter type and the parameter adjustment strategy;

[0048] Automatic optimization is performed based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized.

[0049] The above-mentioned parameter optimization method first filters out the parameters to be optimized by the default values ​​of all the parameters obtained, and then classifies each parameter to be optimized according to the default value to obtain the parameter type, and then matches the target parameter adjustment strategy for the parameter type corresponding to each parameter to be optimized based on the correspondence between the preset parameter type and the parameter adjustment strategy, and finally performs automatic optimization based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized. There is no need to rely on the experience of R&D personnel, and it realizes automatic screening of parameters that can be optimized, and automatically finds the optimal parameters quickly according to the preset parameter adjustment strategy. It has strong stability and versatility, and greatly saves labor costs.

[0050] In addition, the present invention also provides a parameter optimization device, a computer device and a computer-readable storage medium, which can also achieve the above-mentioned technical effects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.

[0052] Figure 1 A flow chart of a parameter optimization method provided for one embodiment of the present invention;

[0053] Figure 2 A schematic diagram of a process for classifying parameters in a Linux operating system provided by an embodiment of the present invention

[0054] Figure 3 A schematic diagram of an automatic optimization process of kernel parameters of a Linux operating system provided by another embodiment of the present invention;

[0055] Figure 4 A schematic diagram of the structure of a parameter optimization device provided by another embodiment of the present invention;

[0056] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in another embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0058] It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are for distinguishing two non-identical entities with the same name or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one.

[0059] In one embodiment, please refer to Figure 1 As shown, the present invention provides a parameter optimization method 100. Specifically, the method comprises the following steps:

[0060] Step 101, obtaining the default values ​​of all parameters, and filtering out the parameters to be optimized from all parameters based on the default values ​​of each parameter;

[0061] Step 102: classify each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized; wherein the parameter type corresponding to the parameter to be optimized is one of the preset parameter types.

[0062] In the specific implementation process, it is assumed that the user predefines two different preset parameter types, and the parameter type of any parameter to be optimized should be one of the two different preset parameter types predefine. It should be noted that the number of preset parameter types is only used for example, and in the specific implementation process, it can be reasonably set according to the optimization accuracy requirements and optimization efficiency.

[0063] Step 103, matching the target parameter adjustment strategy for the parameter type corresponding to each parameter to be optimized based on the correspondence between the preset parameter type and the parameter adjustment strategy; wherein the preset parameter type is predefined such as numerical type, non-numerical type, large numerical type or intermediate numerical type.

[0064] Step 104 : Automatic optimization is performed based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized.

[0065] The above-mentioned parameter optimization method first filters out the parameters to be optimized by the default values ​​of all the parameters obtained, and then classifies each parameter to be optimized according to the default value to obtain the parameter type, and then matches the target parameter adjustment strategy for the parameter type corresponding to each parameter to be optimized based on the correspondence between the preset parameter type and the parameter adjustment strategy, and finally performs automatic optimization based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized. There is no need to rely on the experience of R&D personnel, and it realizes automatic screening of parameters that can be optimized, and automatically finds the optimal parameters quickly according to the preset parameter adjustment strategy. It has strong stability and versatility, and greatly saves labor costs.

[0066] In some embodiments, the step of selecting the parameter to be optimized from all parameters based on the default value of each parameter includes:

[0067] For each parameter, do the following:

[0068] Compare the default value with the range corresponding to the numerical value and the range corresponding to the character respectively;

[0069] In response to the default value falling within the range corresponding to the value, the parameter corresponding to the default value is used as the parameter to be optimized;

[0070] In response to the default value falling within the range corresponding to the character, the parameter corresponding to the default value is used as a parameter that does not need to be optimized.

[0071] In some embodiments, the step of classifying each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized includes:

[0072] For each parameter to be optimized, perform the following operations:

[0073] In response to the default value being equal to zero or equal to one, confirming that the parameter to be optimized is of Boolean type;

[0074] In response to the default value being greater than one and less than or equal to the first preset value, confirming that the parameter to be optimized is a short integer type;

[0075] In response to the default value being greater than a second preset value, it is confirmed that the parameter to be optimized is a long integer type, wherein the second preset value is greater than the first preset value.

[0076] In some embodiments, the correspondence between the preset parameter type and the parameter adjustment strategy includes: a Boolean type corresponds to a first parameter adjustment strategy, a short integer type corresponds to a second parameter adjustment strategy, and a long integer type corresponds to a third parameter adjustment strategy;

[0077] Among them, the first parameter adjustment strategy is to adopt the default value when the automatic optimization is performed for the first time, and to invert the default value when the automatic optimization is performed for the second time; the second parameter adjustment strategy is to adopt the default value when the automatic optimization is performed for the first time, and to multiply the previous parameter value by the first preset multiple when the automatic optimization is performed again subsequently; the third parameter adjustment strategy is to adopt the default value when the automatic optimization is performed for the first time, and to multiply the previous parameter value by the second preset multiple when the automatic optimization is performed again subsequently, wherein the second preset multiple is greater than the first preset multiple.

[0078] In some embodiments, the step of performing automatic optimization based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized includes:

[0079] In response to the target parameter adjustment strategy being the first parameter adjustment strategy, the parameter value adopted in the test with the higher test result of the two automatic optimization tests is used as the optimal parameter value;

[0080] In response to the target parameter adjustment strategy being the second parameter adjustment strategy or the third parameter adjustment strategy, the following steps are performed after each automatic optimization is completed:

[0081] Compare the test results of this automatic optimization execution with the test results of the previous automatic optimization execution;

[0082] If the test result of the current automatic optimization is higher than the test result of the previous automatic optimization, the new parameter value is reconfirmed based on the target adjustment strategy, and the automatic optimization is performed again based on the new parameter value;

[0083] If the test result of the current automatic optimization execution is lower than or equal to the test result of the previous automatic optimization execution, the parameter value used in the previous automatic optimization execution is used as the optimal parameter value.

[0084] In some embodiments, if the test score of the current automatic optimization execution is lower than or equal to the test score of the previous automatic optimization execution, before executing the step of using the parameter value used in the previous automatic optimization execution as the optimal parameter value, the method further includes:

[0085] At least once, a fourth parameter adjustment strategy is used to determine a new parameter value, and automatic optimization is performed again based on the new parameter value, wherein the fourth parameter adjustment strategy is to reduce the first preset multiple used by the second parameter adjustment strategy or to reduce the second preset multiple used by the third parameter adjustment strategy and multiply the parameter value used in the previous automatic optimization;

[0086] If the test result corresponding to the new parameter value determined at a certain time is higher than the test result of the previous automatic optimization, the new parameter value determined at a certain time is used as the optimal parameter value.

[0087] In some embodiments, the method is applied to a Linux system, and all the parameters are kernel parameters of the Linux system.

[0088] In another embodiment, in order to facilitate understanding of the technical solution of the present invention, the following takes the above method applied to the Linux operating system as an example, assuming that all parameters are Linux kernel parameters, please refer to Figure 2 As shown, the main process of optimizing the Linux kernel parameters is as follows:

[0089] Step 1: First, the automatic optimization software extracts the default kernel parameters of the operating system;

[0090] Step 2: Then, the kernel parameters are classified according to the default values. The specific parameter classification strategy is as follows: (1) Parameters with default values ​​of 0 and 1 are classified as Boolean type; (2) Parameters with default values ​​that are numerical and greater than 1 and less than 5000 are classified as short integer type; (3) Parameters with default values ​​that are numerical and greater than 5000 are classified as long integer type. (4) Parameters that are not all numbers (such as English characters and special symbols) are not included in the automatic optimization range and are discarded.

[0091] Step 3: According to the divided parameter types and default values, the parameters are automatically adjusted and tested later;

[0092] Please refer to Figure 3 As shown, the optimal parameter search process for each numerical kernel parameter is described in detail below:

[0093] Step 1: Select a parameter from the classified parameters and start automatic optimization using the automatic optimization software;

[0094] Step 2: Start performance testing with default values ​​and record the test results. Then, determine how to adjust the parameter value next time according to the type corresponding to each parameter. For ease of understanding, this embodiment provides three specific parameter adjustment strategies for the above three types of parameters: (1) For Boolean type parameters, the parameter value used in the second optimization is the inverse of the previous one. For example, if the default value is 1, the parameter value is adjusted to 0 during the second optimization. (2) For short integer types, the collection can start from the default value and multiply the previous parameter value by four times during the next optimization. (3) For long integer types, the collection can start from the default value and multiply the previous parameter value by sixteen times during the next optimization.

[0095] Step 3: After each automatic optimization is completed, analyze the test results to see if they are better than the previous round.

[0096] Step 4: Use the following criteria to determine whether the optimal parameter value has been found: If the test result is better, it means that the last optimization was effective, and continue to optimize according to the parameter type; if the test result is the same or worse, it means that the inflection point of the parameter has been reached, and the last parameter value is the best, and the optimization of the parameter is completed.

[0097] It should be noted that, if the test results of the latter test are the same or worse, the optimal parameters can be found more accurately by reducing the step length of the original adjustment parameters. Taking the long integer type as an example, a more accurate optimal value can be found between the parameters used in the two optimizations by doubling or quadrupling the values. It can be understood that the above multiple values ​​are only used for illustration and should not be construed as limitations of the present invention. In the specific implementation process, they can be adjusted according to accuracy requirements and efficiency.

[0098] Step 5: Continue to optimize the next parameter.

[0099] A parameter optimization method of this embodiment classifies Linux system kernel parameters and sets an automatic optimization step method according to parameter types, which can find the optimal parameters more quickly and no longer rely on the experience of R&D personnel. The obtained optimal values ​​have better versatility and stability.

[0100] In some embodiments, please refer to Figure 4 As shown, the present invention also provides a parameter optimization device 200, the device 200 comprising:

[0101] A screening module 201 is configured to obtain the default values ​​of all parameters, and screen out the parameters to be optimized from all parameters based on the default value of each parameter;

[0102] A classification module 202, configured to classify each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized;

[0103] A matching module 203, configured to match a target parameter adjustment strategy for a parameter type corresponding to each parameter to be optimized based on a correspondence between a preset parameter type and a parameter adjustment strategy;

[0104] The optimization module 204 is configured to perform automatic optimization based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized.

[0105] The above-mentioned parameter optimization device first filters out the parameters to be optimized by the default values ​​of all the parameters obtained, and then classifies each parameter to be optimized according to the default value to obtain the parameter type, and then matches the target parameter adjustment strategy for the parameter type corresponding to each parameter to be optimized based on the correspondence between the preset parameter type and the parameter adjustment strategy. Finally, automatic optimization is performed based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized. There is no need to rely on the experience of R&D personnel, and it realizes automatic screening of parameters that can be optimized, and automatically finds the optimal parameters quickly according to the preset parameter adjustment strategy. It has strong stability and versatility, and greatly saves labor costs.

[0106] In some embodiments, the screening module 201 is further configured to:

[0107] For each parameter, do the following:

[0108] Compare the default value with the range corresponding to the numerical value and the range corresponding to the character respectively;

[0109] In response to the default value falling within the range corresponding to the value, the parameter corresponding to the default value is used as the parameter to be optimized;

[0110] In response to the default value falling within the range corresponding to the character, the parameter corresponding to the default value is used as a parameter that does not need to be optimized.

[0111] In some embodiments, the classification module 202 is further configured to:

[0112] For each parameter to be optimized, perform the following operations:

[0113] In response to the default value being greater than or equal to zero or equal to one, confirming that the parameter to be optimized is a Boolean type;

[0114] In response to the default value being greater than one and less than or equal to the first preset value, confirming that the parameter to be optimized is a short integer type;

[0115] In response to the default value being greater than a second preset value, it is confirmed that the parameter to be optimized is a long integer type, wherein the second preset value is greater than the first preset value.

[0116] In some embodiments, the correspondence between the preset parameter type and the parameter adjustment strategy includes: a Boolean type corresponds to a first parameter adjustment strategy, a short integer type corresponds to a second parameter adjustment strategy, and a long integer type corresponds to a third parameter adjustment strategy;

[0117] Among them, the first parameter adjustment strategy is to adopt the default value when the automatic optimization is performed for the first time, and to invert the default value when the automatic optimization is performed for the second time; the second parameter adjustment strategy is to adopt the default value when the automatic optimization is performed for the first time, and to multiply the previous parameter value by the first preset multiple when the automatic optimization is performed again subsequently; the third parameter adjustment strategy is to adopt the default value when the automatic optimization is performed for the first time, and to multiply the previous parameter value by the second preset multiple when the automatic optimization is performed again subsequently, wherein the second preset multiple is greater than the first preset multiple.

[0118] In some embodiments, the optimization module 204 is further configured to:

[0119] In response to the target parameter adjustment strategy being the first parameter adjustment strategy, the parameter value adopted in the test with the higher test result of the two automatic optimization tests is used as the optimal parameter value;

[0120] In response to the target parameter adjustment strategy being the second parameter adjustment strategy or the third parameter adjustment strategy, the following steps are performed after each automatic optimization is completed:

[0121] Compare the test results of this automatic optimization execution with the test results of the previous automatic optimization execution;

[0122] If the test result of the current automatic optimization is higher than the test result of the previous automatic optimization, the new parameter value is reconfirmed based on the target adjustment strategy, and the automatic optimization is performed again based on the new parameter value;

[0123] If the test result of the current automatic optimization execution is lower than or equal to the test result of the previous automatic optimization execution, the parameter value used in the previous automatic optimization execution is used as the optimal parameter value.

[0124] In some embodiments, the optimization module 204 is further configured to:

[0125] If the test score of the current automatic optimization is lower than or equal to the test score of the previous automatic optimization, before executing the step of taking the parameter value used in the previous automatic optimization as the optimal parameter value, the method further includes:

[0126] At least once, a fourth parameter adjustment strategy is used to determine a new parameter value, and automatic optimization is performed again based on the new parameter value, wherein the fourth parameter adjustment strategy is to reduce the first preset multiple used by the second parameter adjustment strategy or to reduce the second preset multiple used by the third parameter adjustment strategy and multiply the parameter value used in the previous automatic optimization;

[0127] If the test result corresponding to the new parameter value determined at a certain time is higher than the test result of the previous automatic optimization, the new parameter value determined at a certain time is used as the optimal parameter value.

[0128] In some embodiments, the method is applied to a Linux system, and all the parameters are kernel parameters of the Linux system.

[0129] It should be noted that the specific definition of the parameter optimization device can be found in the definition of the parameter optimization method above, which will not be repeated here. Each module in the above parameter optimization device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0130] According to another aspect of the present invention, a computer device is provided. The computer device may be a server. Figure 5As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the parameter optimization method described above is implemented. Specifically, the method includes the following steps:

[0131] Get the default values ​​of all parameters, and filter out the parameters to be optimized from all parameters based on the default values ​​of each parameter;

[0132] Classifying each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized;

[0133] Matching a target parameter adjustment strategy to the parameter type corresponding to each parameter to be optimized based on the correspondence between the preset parameter type and the parameter adjustment strategy;

[0134] Automatic optimization is performed based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized.

[0135] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the parameter optimization method described above is implemented. Specifically, the method includes the following steps:

[0136] Get the default values ​​of all parameters, and filter out the parameters to be optimized from all parameters based on the default values ​​of each parameter;

[0137] Classifying each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized;

[0138] Matching a target parameter adjustment strategy to the parameter type corresponding to each parameter to be optimized based on the correspondence between the preset parameter type and the parameter adjustment strategy;

[0139] Automatic optimization is performed based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized.

[0140] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0141] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0142] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A parameter optimization method, characterized in that: The method comprises: Get the default values ​​of all parameters, and filter out the parameters to be optimized from all parameters based on the default values ​​of each parameter; Classifying each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized; Matching a target parameter adjustment strategy to the parameter type corresponding to each parameter to be optimized based on the correspondence between the preset parameter type and the parameter adjustment strategy; Performing automatic optimization based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized; The step of classifying each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized comprises: For each parameter to be optimized, perform the following operations: In response to the default value being equal to zero or equal to one, confirming that the parameter to be optimized is of Boolean type; In response to the default value being greater than one and less than or equal to the first preset value, confirming that the parameter to be optimized is a short integer type; In response to the default value being greater than a second preset value, confirming that the parameter to be optimized is a long integer type, wherein the second preset value is greater than the first preset value; The correspondence between the preset parameter type and the parameter adjustment strategy includes: the Boolean type corresponds to the first parameter adjustment strategy, the short integer type corresponds to the second parameter adjustment strategy, and the long integer type corresponds to the third parameter adjustment strategy; The first parameter adjustment strategy is to use the default value when the automatic optimization is performed for the first time, and to invert the default value when the automatic optimization is performed for the second time; the second parameter adjustment strategy is to use the default value when the automatic optimization is performed for the first time, and to multiply the previous parameter value by the first preset multiple when the automatic optimization is performed again subsequently; the third parameter adjustment strategy is to use the default value when the automatic optimization is performed for the first time, and to multiply the previous parameter value by the second preset multiple when the automatic optimization is performed again subsequently, wherein the second preset multiple is greater than the first preset multiple; The step of performing automatic optimization based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized includes: In response to the target parameter adjustment strategy being the first parameter adjustment strategy, the parameter value adopted in the test with the higher test result of the two automatic optimization executions is used as the optimal parameter value; In response to the target parameter adjustment strategy being the second parameter adjustment strategy or the third parameter adjustment strategy, the following steps are performed after each automatic optimization is completed: Compare the test results of this automatic optimization execution with the test results of the previous automatic optimization execution; If the test result of the current automatic optimization is higher than the test result of the previous automatic optimization, the new parameter value is reconfirmed based on the target adjustment strategy, and the automatic optimization is performed again based on the new parameter value; If the test result of the current automatic optimization execution is lower than or equal to the test result of the previous automatic optimization execution, the parameter value used in the previous automatic optimization execution is used as the optimal parameter value.

2. The parameter optimization method according to claim 1, characterized in that: The step of selecting the parameters to be optimized from all parameters based on the default value of each parameter comprises: For each parameter, do the following: Compare the default value with the range corresponding to the numerical value and the range corresponding to the character respectively; In response to the default value falling within the range corresponding to the value, the parameter corresponding to the default value is used as the parameter to be optimized; In response to the default value falling within the range corresponding to the character, the parameter corresponding to the default value is used as a parameter that does not need to be optimized.

3. The parameter optimization method according to claim 1, characterized in that: If the test score of the current automatic optimization is lower than or equal to the test score of the previous automatic optimization, before executing the step of taking the parameter value used in the previous automatic optimization as the optimal parameter value, the method further includes: At least once, a fourth parameter adjustment strategy is used to determine a new parameter value, and automatic optimization is performed again based on the new parameter value, wherein the fourth parameter adjustment strategy is to reduce the first preset multiple used by the second parameter adjustment strategy or to reduce the second preset multiple used by the third parameter adjustment strategy and multiply the parameter value used in the previous automatic optimization; If the test result corresponding to the new parameter value determined at a certain time is higher than the test result of the previous automatic optimization, the new parameter value determined at a certain time is used as the optimal parameter value.

4. The parameter optimization method according to claim 1, characterized in that: The method is applied to a Linux system, and all the parameters are kernel parameters of the Linux system.

5. A parameter optimization device, characterized in that: The device comprises: A screening module is configured to obtain the default values ​​of all parameters and screen out the parameters to be optimized from all parameters based on the default value of each parameter; A classification module, configured to classify each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized; A matching module configured to match a target parameter adjustment strategy for a parameter type corresponding to each parameter to be optimized based on a correspondence between a preset parameter type and a parameter adjustment strategy; An optimization module configured to perform automatic optimization based on a target parameter adjustment strategy corresponding to each parameter to be optimized to determine an optimal parameter value for each parameter to be optimized; The step of classifying each parameter to be optimized based on the default value to obtain a parameter type corresponding to each parameter to be optimized includes: For each parameter to be optimized, perform the following operations: In response to the default value being equal to zero or equal to one, confirming that the parameter to be optimized is of Boolean type; In response to the default value being greater than one and less than or equal to the first preset value, confirming that the parameter to be optimized is a short integer type; In response to the default value being greater than a second preset value, confirming that the parameter to be optimized is a long integer type, wherein the second preset value is greater than the first preset value; The correspondence between the preset parameter type and the parameter adjustment strategy includes: the Boolean type corresponds to the first parameter adjustment strategy, the short integer type corresponds to the second parameter adjustment strategy, and the long integer type corresponds to the third parameter adjustment strategy; The first parameter adjustment strategy is to use the default value when the automatic optimization is performed for the first time, and to invert the default value when the automatic optimization is performed for the second time; the second parameter adjustment strategy is to use the default value when the automatic optimization is performed for the first time, and to multiply the previous parameter value by the first preset multiple when the automatic optimization is performed again subsequently; the third parameter adjustment strategy is to use the default value when the automatic optimization is performed for the first time, and to multiply the previous parameter value by the second preset multiple when the automatic optimization is performed again subsequently, wherein the second preset multiple is greater than the first preset multiple; The step of performing automatic optimization based on the target parameter adjustment strategy corresponding to each parameter to be optimized to determine the optimal parameter value of each parameter to be optimized includes: In response to the target parameter adjustment strategy being the first parameter adjustment strategy, the parameter value adopted in the test with the higher test result of the two automatic optimization executions is used as the optimal parameter value; In response to the target parameter adjustment strategy being the second parameter adjustment strategy or the third parameter adjustment strategy, the following steps are performed after each automatic optimization is completed: Compare the test results of this automatic optimization execution with the test results of the previous automatic optimization execution; If the test result of the current automatic optimization is higher than the test result of the previous automatic optimization, the new parameter value is reconfirmed based on the target adjustment strategy, and the automatic optimization is performed again based on the new parameter value; If the test result of the current automatic optimization execution is lower than or equal to the test result of the previous automatic optimization execution, the parameter value used in the previous automatic optimization execution is used as the optimal parameter value.

6. A computer device, characterized in that: include: at least one processor; as well as A memory storing a computer program executable in the processor, wherein the processor executes the method according to any one of claims 1 to 4 when executing the program.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is performed.

Citation Information

Patent Citations

  • Resource optimization dispatching system and dispatching method

    CN103593712A

  • Methods, systems, articles of manufacture, and apparatus to optimize thread scheduling

    CN112988342A

  • Kernel Policy Optimization for Computing Workloads

    US20170262314A1