Distributed cache parameter optimization method and device, computer equipment and storage medium
By building a cache performance prediction model and using genetic evolution methods, the distributed cache parameters are optimized, and the problems of low efficiency and poor accuracy of traditional manual tuning are solved, achieving more efficient and accurate parameter optimization.
Patent Information
- Application Number
- CN202411724377.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-11-28
AI Technical Summary
In traditional technology, manual tuning of distributed cache parameters is inefficient and poorly accurate, and depends on personal experience, making it difficult to meet the needs of modern Internet companies and large data centers for high performance, scalability and high availability.
By randomly generating distributed cache parameters of the initial population, multiple learners are used to build cache performance prediction models, and a strong learner is generated by combining integrated learning algorithms to predict cache performance and perform evolutionary processing, and iterative optimization to obtain optimal parameters.
The efficiency and accuracy of distributed cache parameter tuning is improved, data acquisition time is reduced, the optimal parameters obtained are more universal, and the limitations of manual operation are avoided through fully automated means.
Smart Images

Figure CN119415565A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a distributed cache parameter optimization method, apparatus, computer equipment and storage medium. Background Art
[0002] In order to improve business operation efficiency, Internet companies and large data centers widely use distributed cache to improve system performance and effectively reduce database pressure. However, with the continuous expansion of data scale, the increasing number of user access, the diversification of business needs and the promotion of technological development, enterprises have put forward higher requirements for the data processing performance, scalability and high availability of distributed cache. Distributed cache parameter optimization involves many aspects, including the selection and optimization of cache strategy, data sharding and load balancing, performance monitoring and tuning, high availability and fault tolerance, etc.
[0003] In traditional technology, distributed cache parameters are tuned through manual continuous monitoring and then appropriate optimization strategies are formulated and selected. However, manual tuning and collecting various types of data takes a lot of time, the parameter tuning efficiency is low, and manual tuning relies heavily on personal experience, so the accuracy of parameter tuning is low. Summary of the invention
[0004] Based on this, it is necessary to provide a distributed cache parameter optimization method, device, computer equipment and storage medium that can improve the efficiency and accuracy of distributed cache parameter tuning in response to the above technical problems.
[0005] In a first aspect, the present application provides a distributed cache parameter optimization method, comprising:
[0006] Randomly generate multiple sets of distributed cache parameters as the initial group;
[0007] Inputting the initial population into multiple learners of the cache performance prediction model respectively, predicting the cache performance of the initial population, and determining the health value of the initial population according to the cache performance of the initial population;
[0008] The initial population is subjected to evolutionary processing according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population;
[0009] The new population is updated as the initial population, and the step of inputting the initial population into multiple learners of the cache performance prediction model is returned. The iterative evolution process is performed to obtain a set of distributed cache parameters with optimal cache performance.
[0010] In one embodiment, the initial population is input into a plurality of learners of a cache performance prediction model respectively, and predicting the cache performance of the initial population includes:
[0011] Inputting the initial population into multiple learners of the cache performance prediction model respectively to obtain cache performance prediction results of each learner; the multiple learners include but are not limited to generative adversarial networks, artificial neural networks, support vector machines and regression trees;
[0012] The cache performance prediction results of multiple learners are combined through the combination layer of the cache performance prediction model to obtain the cache performance of the initial group.
[0013] In one embodiment, determining the health value of the initial population according to the cache performance of the initial population includes:
[0014] The health value of the initial group is determined according to the cache performance of the initial group and preset constraints.
[0015] In one embodiment, the cache performance prediction results of multiple learners are combined through the combination layer of the cache performance prediction model to obtain the cache performance of the initial group, including:
[0016] Through the combined layer of the cache performance prediction model, a voting strategy is adopted to vote on the cache performance prediction results of multiple learners;
[0017] The cache performance prediction result with the largest number of occurrences is determined as the cache performance of the initial population.
[0018] In one embodiment, the cache performance prediction results of multiple learners are combined through the combination layer of the cache performance prediction model to obtain the cache performance of the initial group, including:
[0019] Through the combination layer of the cache performance prediction model, a weighted average strategy is adopted to perform weighted average processing on the cache performance prediction results of multiple learners to obtain the cache performance of the initial group.
[0020] In one embodiment, performing evolution processing on the initial population according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population includes:
[0021] Select the target group distributed cache parameters in the initial group according to the health value of the initial group;
[0022] A crossover operation is performed on the distributed cache parameters of the target group according to a crossover probability threshold, and a mutation process is performed on the initial group according to a mutation probability threshold to obtain a new group.
[0023] In one embodiment, the method further comprises:
[0024] Inputting cache operation environment configuration data, cache performance data and cache operation configuration parameters of the distributed cache cluster into multiple learners of the initial model to obtain learner prediction results of each learner;
[0025] The prediction results of multiple learners are combined through the combination layer of the initial model to obtain the target prediction result;
[0026] The initial model is trained according to the target prediction results to obtain a cache performance prediction model.
[0027] In a second aspect, the present application also provides a distributed cache parameter optimization device, including:
[0028] A population generation module is used to randomly generate multiple sets of distributed cache parameters as the initial population;
[0029] A performance prediction module, used for inputting the initial group into multiple learners of the cache performance prediction model respectively, predicting the cache performance of the initial group, and determining the health value of the initial group according to the cache performance of the initial group;
[0030] The genetic evolution module is used to perform evolution processing on the initial population according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population;
[0031] The parameter optimization module is used to update the new population to the initial population, return to the step of inputting the initial population into multiple learners of the cache performance prediction model respectively, iterate the evolution process, and obtain a set of distributed cache parameters with optimal cache performance.
[0032] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0033] Randomly generate multiple sets of distributed cache parameters as the initial group;
[0034] Inputting the initial population into multiple learners of the cache performance prediction model respectively, predicting the cache performance of the initial population, and determining the health value of the initial population according to the cache performance of the initial population;
[0035] The initial population is subjected to evolutionary processing according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population;
[0036] The new population is updated as the initial population, and the step of inputting the initial population into multiple learners of the cache performance prediction model is returned. The iterative evolution process is performed to obtain a set of distributed cache parameters with optimal cache performance.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0038] Randomly generate multiple sets of distributed cache parameters as the initial group;
[0039] Inputting the initial population into multiple learners of the cache performance prediction model respectively, predicting the cache performance of the initial population, and determining the health value of the initial population according to the cache performance of the initial population;
[0040] The initial population is subjected to evolutionary processing according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population;
[0041] The new population is updated as the initial population, and the step of inputting the initial population into multiple learners of the cache performance prediction model is returned. The iterative evolution process is performed to obtain a set of distributed cache parameters with optimal cache performance.
[0042] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0043] Randomly generate multiple sets of distributed cache parameters as the initial group;
[0044] Inputting the initial population into multiple learners of the cache performance prediction model respectively, predicting the cache performance of the initial population, and determining the health value of the initial population according to the cache performance of the initial population;
[0045] The initial population is subjected to evolutionary processing according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population;
[0046] The new population is updated as the initial population, and the step of inputting the initial population into multiple learners of the cache performance prediction model is returned. The iterative evolution process is performed to obtain a set of distributed cache parameters with optimal cache performance.
[0047] The above-mentioned distributed cache parameter optimization method, device, computer equipment, storage medium and computer program product, since the cache performance prediction model includes multiple learners, multiple learners are combined into a strong learner through an integrated learning algorithm. Without sacrificing the accuracy of the model, less training data can be used for model training, which reduces the time spent on data collection and improves the efficiency of parameter optimization. Based on the cache performance prediction model, an optimized genetic evolution method is used to obtain a set of distributed cache parameters with optimal cache performance. Since the optimized genetic evolution method has good randomness and is not easy to fall into local optimality, the obtained optimal parameters are more universal. At the same time, the above-mentioned method adopts a fully automated means, does not require manual operation and screening, can greatly improve the efficiency of parameter optimization, shorten the optimization cycle, and has higher parameter optimization efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] FIG1 is a schematic diagram of a process flow of a distributed cache parameter optimization method in one embodiment;
[0050] FIG2 is a schematic diagram of a process of inputting an initial group into multiple learners of a cache performance prediction model to predict the cache performance of the initial group in one embodiment;
[0051] FIG3 is a structural block diagram of a distributed cache parameter optimization device in one embodiment;
[0052] FIG4 is a diagram showing the internal structure of a computer device in one embodiment;
[0053] FIG. 5 is a diagram showing the internal structure of a computer device in another embodiment. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0055] Distributed cache parameter optimization involves many aspects, including the selection and optimization of cache strategies, data sharding and load balancing, performance monitoring and tuning, high availability and fault tolerance, etc. In reality, it is difficult for users to select the best configuration parameters in such a complex parameter space. Therefore, users often accept the default configuration, but these configurations are inefficient and may even lead to unavailability risks. Based on this situation, by optimizing distributed cache parameters, the performance, scalability and availability of distributed cache can be improved, thereby better meeting the needs of modern Internet companies and large data centers.
[0056] In traditional technologies, enterprises conduct continuous manual monitoring based on their own business characteristics and needs, and then formulate and select appropriate optimization strategies to tune distributed cache parameters.
[0057] However, distributed cache parameter configuration has certain spatial exploration complexity. First, there is the complex interaction between the configuration of different basic environments and cache parameters. Second, there is the mutual coordination relationship between different parameter configurations of distributed cache. As a result, the manual tuning solutions in traditional technologies have the following deficiencies:
[0058] 1. Due to the limitations of manual operations, manual tuning has a narrow coverage and limited collected data. It is difficult to cover all basic environmental scenarios and parameter combinations, and the suggestions provided are not universal.
[0059] 2. Due to the complexity of the environment and the diversity of parameters, manual tuning and collecting various types of data requires a lot of time, the overall efficiency is relatively low, and the tuning cycle is long.
[0060] 3. Since manual tuning relies heavily on personal experience and is highly subjective, it is difficult to objectively reflect the effect of parameter tuning and has low accuracy.
[0061] In an exemplary embodiment, as shown in FIG1 , a distributed cache parameter optimization method is provided. This embodiment is illustrated by applying the method to a terminal. It is understandable that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0062] Step 102: randomly generate multiple groups of candidate distributed cache parameters as an initial group.
[0063] The multiple sets of distributed cache parameters refer to cache configuration parameters used for parameter optimization.
[0064] Alternatively, since there are many distributed cache configurations and the parameter range varies with the underlying hardware environment, it is impossible to enumerate the distributed cache configurations corresponding to the application. Therefore, a heuristic algorithm can be used to explore the optimal solution in the parameter space of the distributed cache configuration.
[0065] Exemplarily, multiple groups of distributed cache parameters are randomly generated in the parameter space, and an initial group is formed according to the multiple groups of distributed cache parameters. The initial group can be expressed as: P={conf1,conf2,...,confk}, where confk represents a group of distributed cache parameters. Each group of distributed cache parameters can include distributed cache parameters corresponding to multiple distributed cache configurations.
[0066] Step 104 , input the initial population into a plurality of learners of the cache performance prediction model respectively, predict the cache performance of the initial population, and determine the health value of the initial population according to the cache performance of the initial population.
[0067] Optionally, a pre-trained cache performance prediction model is called, the cache performance prediction model includes a base learning layer, the base learning layer includes multiple learners, the initial group is input into multiple learners respectively, each learner processes the initial group independently, and finally the cache performance of the initial group is obtained. The cache performance of the initial group may include the cache performance of each set of distributed cache parameters. Among them, the cache performance prediction model is obtained by training with an integrated learning algorithm, which can combine multiple learners into a strong learner, and can use less training data to build the model without sacrificing the accuracy of the model.
[0068] After obtaining the cache performance of the initial group, the cache performance of the initial group is used as the fitness, that is, the fitness of each set of distributed cache parameters is obtained. Among them, fitness refers to the degree of adaptation or the degree of excellence of the individual to the objective function with the optimal cache performance as the goal. Then, the health value of the initial group is determined according to the cache performance of the initial group. The health value is used to measure the survival ability of the individual in the group or the comprehensive performance under various conditions.
[0069] Optionally, the cache performance of the initial group may be the execution time of the job, and the shorter the execution time, the better the cache performance.
[0070] Step 106, performing evolution processing on the initial population according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population.
[0071] Optionally, the initial population is selected, crossed and mutated according to the health value, mutation probability threshold and crossover probability threshold of the initial population to obtain a new population. The new population can be expressed as: P'={conf1r, conf2r, ..., confkr}, where confkr represents an individual in the new population. The mutation probability threshold is used to determine whether to perform a mutation operation. The crossover probability threshold is used to determine whether to perform a crossover operation.
[0072] Step 108, update the new population to the initial population, return to the step of inputting the initial population, the mutation probability threshold and the crossover probability threshold of the initial population into the pre-trained cache performance prediction model, predicting the cache performance of the initial population, iterative evolution processing, and obtaining a set of distributed cache parameters with optimal cache performance.
[0073] Optionally, the new group is used as the initial group, and the process returns to step 104. The initial group is respectively input into multiple learners of the cache performance prediction model to predict the cache performance of the initial group, and the health value of the initial group is determined based on the cache performance of the initial group. The evolutionary process is iterated until a preset number of iterations is reached to obtain a set of distributed cache parameters with optimal cache performance.
[0074] Optionally, before the first evolutionary process is performed, the initial population can be input into multiple learners of the cache performance prediction model to predict the cache performance of the initial population. The initial population is evolved according to the cache performance, mutation probability threshold and crossover probability threshold to generate a new population. In the subsequent evolutionary process, the evolutionary process is performed according to the health value of the population until a set of distributed cache parameters with optimal cache performance is obtained.
[0075] In the above-mentioned distributed cache parameter optimization method, since the cache performance prediction model includes multiple learners, multiple learners are combined into a strong learner through an integrated learning algorithm. Without sacrificing the accuracy of the model, less training data can be used for model training, which reduces the time spent on data collection and improves the efficiency of parameter optimization. Based on the cache performance prediction model, an optimized genetic evolution method is used to obtain a set of distributed cache parameters with optimal cache performance. Since the optimized genetic evolution method has good randomness and is not easy to fall into local optimality, the obtained optimal parameters are more universal. At the same time, the above-mentioned method adopts a fully automated means, does not require manual operation and screening, can greatly improve the efficiency of parameter optimization, shorten the optimization cycle, and has higher parameter optimization efficiency.
[0076] In an exemplary embodiment, as shown in FIG2 , the initial population is input into multiple learners of the cache performance prediction model respectively, and the cache performance of the initial population is predicted, including the following steps 202 to 204. Among them:
[0077] Step 202, input the initial population into multiple learners of the cache performance prediction model respectively to obtain the cache performance prediction results of each learner; the multiple learners include but are not limited to generative adversarial networks, artificial neural networks, support vector machines and regression trees.
[0078] Step 204 , combining the cache performance prediction results of multiple learners through the combination layer of the cache performance prediction model to obtain the cache performance of the initial group.
[0079] Optionally, the cache performance prediction model includes a base learning layer, a combination layer and an output layer, and the base learning layer includes multiple learners. The multiple learners include but are not limited to generative adversarial networks, artificial neural networks, support vector machines and regression trees. Each learner processes data independently.
[0080] The initial population is input into multiple learners of the cache performance prediction model respectively. Each learner independently predicts the cache performance of the initial population to obtain the cache performance prediction result of each learner. The cache performance prediction results of multiple learners are combined through the combination layer of the cache performance prediction model to obtain the cache performance of the initial population. The cache performance of the initial population is output through the output layer.
[0081] In this embodiment, multiple learners are combined into a strong learner through an integrated learning algorithm. Without sacrificing the accuracy of the model, less training data can be used for model training, which effectively reduces the time spent on data collection and further improves the efficiency of parameter optimization.
[0082] In an exemplary embodiment, determining the health value of the initial population according to the cache performance of the initial population includes: determining the health value of the initial population according to the cache performance of the initial population and preset constraints.
[0083] Optionally, the preset constraint condition may be a numerical range constraint condition of cache performance. If the cache performance of an individual violates the constraint condition, the health value may be reduced by adding a penalty term: health value = fitness value − λ × penalty term; where λ is the penalty coefficient, and the penalty term may be the degree of violation of the preset constraint condition or other related factors.
[0084] Optionally, if the range of fitness is large, it can be adjusted to a fixed range (such as 0 to 1) by normalization or standardization, which can make the health value more stable: Health value = ;in, represents fitness, and represent the minimum fitness and the maximum fitness respectively.
[0085] In an exemplary embodiment, the combination layer of the cache performance prediction model may use different combination strategies to combine cache performance prediction results of multiple learners. Different combination strategies may include voting strategy, weighted average strategy, etc.
[0086] In one of the embodiments, the cache performance prediction results of multiple learners are combined through the combination layer of the cache performance prediction model to obtain the cache performance of the initial group, including: voting on the cache performance prediction results of multiple learners using a voting strategy through the combination layer of the cache performance prediction model; and determining the cache performance prediction result with the largest number of occurrences as the cache performance of the initial group.
[0087] The combination layer can adopt a voting strategy to determine the cache performance prediction result with the most occurrences as the cache performance of the initial group. When multiple learners have similar prediction capabilities, the prediction accuracy of the model can be improved through an integrated learning algorithm.
[0088] In one embodiment, the cache performance prediction results of multiple learners are combined through the combination layer of the cache performance prediction model to obtain the cache performance of the initial group, including: through the combination layer of the cache performance prediction model, a weighted average strategy is adopted to perform weighted average processing on the cache performance prediction results of multiple learners to obtain the cache performance of the initial group.
[0089] The combined layer can also adopt a weighted average strategy to obtain the cache performance of the initial group. The weighted average strategy is different from the voting strategy. The weighted average strategy takes into account the prediction ability or accuracy of different learners, and can assign different weights to each learner based on the prediction ability or accuracy of the learner. The higher the weight of the learner, the more influential its cache performance prediction results are. The weighted average strategy is adopted to perform weighted average processing on the cache performance prediction results of multiple learners to obtain the cache performance of the initial group. The weighted average strategy can better utilize the model with better prediction results when the cache performance prediction results of different learners vary too much.
[0090] In an exemplary embodiment, the initial population is evolved according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population, including: selecting a target group distributed cache parameter in the initial population according to the health value of the initial population; performing a crossover operation on the target group distributed cache parameter according to the crossover probability threshold, and performing mutation processing on the initial population according to the mutation probability threshold to obtain a new population.
[0091] Optionally, during the genetic evolution process, the initial population is subjected to selection, crossover and mutation operations according to the health value, mutation probability threshold and crossover probability threshold of the initial population. The selection operation refers to selecting a target group of distributed cache parameters in the initial population according to the health value of the initial population. Exemplarily, a preset number of distributed cache parameter groups can be selected from multiple groups of distributed cache parameters of the initial population according to the health value of the initial population as target group distributed cache parameters. The target group distributed cache parameters are used to participate in subsequent crossover and mutation operations.
[0092] The crossover operation is used to simulate the genetic recombination process of organisms, including randomly selecting two sets of distributed cache parameters from the target set of distributed cache parameters. By generating a random number, if the random number is less than or equal to the crossover probability threshold, the crossover operation is performed, otherwise the crossover operation is skipped. Two new distributed cache parameter groups are generated through the crossover operation. The crossover method can include single-point crossover, double-point crossover, uniform crossover, etc.
[0093] The mutation operation refers to randomly changing part of the content in an individual gene, thereby introducing new genetic variation and enhancing the diversity of the population. The mutation operation can include randomly selecting a set of distributed cache parameters from the target group of distributed cache parameters. By generating a random number, if the random number is less than or equal to the mutation probability threshold, the mutation operation is performed. According to the encoding method (such as binary encoding), a gene bit is randomly selected and changed to obtain a new distributed cache parameter group. If the random number is greater than the mutation probability threshold, the mutation operation is skipped.
[0094] A new population is obtained according to the target group distributed cache parameters, two new distributed cache parameter groups generated by the crossover operation, and a new distributed cache parameter group generated by the mutation operation.
[0095] In this embodiment, by performing genetic evolution processing on the initial population, the survival of the fittest mechanism in the biological evolution process is simulated, and distributed cache parameters with optimal cache performance can be obtained. The genetic evolution method can also simultaneously calculate and compare individuals in the population. This potential parallelism enables the algorithm to converge quickly, which is conducive to improving the efficiency of parameter optimization.
[0096] In an exemplary embodiment, the above method also includes: a cache performance prediction model training step, which includes: inputting the cache operating environment configuration data, cache performance data and cache operating configuration parameters of the distributed cache cluster into multiple learners of the initial model to obtain the learner prediction result of each learner; combining the learner prediction results of multiple learners through the combination layer of the initial model to obtain the target prediction result; training the initial model according to the target prediction result to obtain the cache performance prediction model.
[0097] Optionally, during the model training process, the cache operating environment configuration data, cache performance data and cache operating configuration parameters of the distributed cache cluster are collected through automated scripts. The cache operating environment configuration data refers to different configuration items of the environment configuration, which may include machine type (container / virtual machine / physical machine), CPU (Central Processing Unit) configuration, memory configuration, network card size, storage size, etc. The cache performance data may include CPU usage, memory usage, IO (Input / Output) throughput, real-time OPS (Operations PerSecond), response time, AOF (Append Only File) size, output buffer maximum queue, memory fragmentation rate, master-slave node offset, etc. The cache operating configuration parameters may include maximum memory, elimination strategy, maximum number of connections, buffer size, persistence switch, connection retention switch, timeout duration, etc.
[0098] The cache operation environment configuration data, cache performance data and cache operation configuration parameters of the distributed cache cluster are input into multiple learners of the initial model to obtain the learner prediction result of each learner. The learner prediction result refers to the prediction result of cache performance.
[0099] The prediction results of multiple learners are combined by combining strategies through the combination layer of the initial model to obtain the target prediction result. The target prediction result refers to the cache performance obtained by the final prediction. The initial model is trained according to the target prediction result until the number of iterations is reached or the target preset result does not change, and the cache performance prediction model is obtained.
[0100] Alternatively, cache performance is expressed primarily through the execution time of a job:
[0101] t=f(e,d,w,conf);
[0102] Among them, t represents the execution time of the job, e represents the cache operating environment configuration data, d represents the size of the data set, including the cache operating environment configuration data, cache performance data and cache operating configuration parameters, w represents the cache performance data, and conf represents the cache operating configuration parameters.
[0103] In this embodiment, the cache performance prediction model is trained based on the cache operating environment configuration data, cache performance data and cache operating configuration parameter data of the distributed cache cluster, which can improve the comprehensiveness of the training data and help improve the accuracy and versatility of the cache performance prediction model.
[0104] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0105] Based on the same inventive concept, the embodiment of the present application also provides a distributed cache parameter optimization device for implementing the above-mentioned distributed cache parameter optimization method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above-mentioned method, so the specific limitations in one or more distributed cache parameter optimization device embodiments provided below can refer to the limitations of the distributed cache parameter optimization method above, and will not be repeated here.
[0106] In an exemplary embodiment, as shown in FIG3 , a distributed cache parameter optimization device is provided, including: a population generation module 302, a performance prediction module 304, a genetic evolution module 306 and a parameter optimization module 308, wherein:
[0107] The group generation module 302 is used to randomly generate multiple groups of distributed cache parameters as initial groups.
[0108] The performance prediction module 304 is used to input the initial population into multiple learners of the cache performance prediction model respectively, predict the cache performance of the initial population, and determine the health value of the initial population according to the cache performance of the initial population.
[0109] The genetic evolution module 306 is used to perform evolution processing on the initial population according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population.
[0110] The parameter optimization module 308 is used to update the new population to the initial population, return to the step of inputting the initial population into multiple learners of the cache performance prediction model respectively, and iterate the evolution process to obtain a set of distributed cache parameters with optimal cache performance.
[0111] In an exemplary embodiment, the performance prediction module 304 is also used to input the initial group into multiple learners of the cache performance prediction model respectively to obtain the cache performance prediction results of each learner; the multiple learners include but are not limited to generative adversarial networks, artificial neural networks, support vector machines and regression trees; through the combination layer of the cache performance prediction model, the cache performance prediction results of the multiple learners are combined and processed to obtain the cache performance of the initial group.
[0112] In an exemplary embodiment, the performance prediction module 304 is further configured to determine the health value of the initial population according to the cache performance of the initial population and preset constraints.
[0113] In an exemplary embodiment, the performance prediction module 304 is also used to adopt a voting strategy to vote on the cache performance prediction results of multiple learners through the combination layer of the cache performance prediction model; and determine the cache performance prediction result with the most occurrences as the cache performance of the initial group.
[0114] In an exemplary embodiment, the performance prediction module 304 is further configured to perform weighted averaging processing on cache performance prediction results of multiple learners by adopting a weighted averaging strategy through a combination layer of a cache performance prediction model to obtain the cache performance of an initial group.
[0115] In an exemplary embodiment, the genetic evolution module 306 is also used to select the target group distributed cache parameters in the initial population according to the health value of the initial population; perform a crossover operation on the target group distributed cache parameters according to a crossover probability threshold, and perform a mutation process on the initial population according to a mutation probability threshold to obtain a new population.
[0116] In an exemplary embodiment, the above device further includes:
[0117] The model training module is used to input the cache operating environment configuration data, cache performance data and cache operating configuration parameters of the distributed cache cluster into multiple learners of the initial model to obtain the learner prediction results of each learner; combine the learner prediction results of multiple learners through the combination layer of the initial model to obtain the target prediction result; train the initial model according to the target prediction result to obtain a cache performance prediction model.
[0118] Each module in the above-mentioned distributed cache parameter optimization device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned 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 in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0119] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG4. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. 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 such as a cache performance prediction model. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a distributed cache parameter optimization method is implemented.
[0120] In an exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be shown in FIG5. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. The processor, the memory, and the input / output interface are connected via a system bus, and the communication interface, the display unit, and the input device are connected to the system bus via the input / output interface. 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 and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner may be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a distributed cache parameter optimization method is implemented. The display unit of the computer device is used to form a visually visible picture, which may be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0121] Those skilled in the art will understand that the structure shown in FIG. 5 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0122] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0123] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0124] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0125] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0126] 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 the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0127] 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.
[0128] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A distributed cache parameter optimization method, characterized in that: The method comprises: Randomly generate multiple sets of distributed cache parameters as the initial group; Inputting the initial population into a plurality of learners of a cache performance prediction model respectively, predicting the cache performance of the initial population, and determining the health value of the initial population according to the cache performance of the initial population; Performing evolution processing on the initial population according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population; The new population is updated to the initial population, and the step of inputting the initial population into multiple learners of the cache performance prediction model is returned to, and the iterative evolution process is performed to obtain a set of distributed cache parameters with optimal cache performance.
2. The method according to claim 1, characterized in that Inputting the initial population into a plurality of learners of a cache performance prediction model respectively to predict the cache performance of the initial population comprises: Inputting the initial population into multiple learners of a cache performance prediction model respectively to obtain cache performance prediction results of each learner; the multiple learners include but are not limited to generative adversarial networks, artificial neural networks, support vector machines and regression trees; The cache performance prediction results of multiple learners are combined through the combination layer of the cache performance prediction model to obtain the cache performance of the initial group.
3. The method according to claim 1, characterized in that Determining the health value of the initial population according to the cache performance of the initial population includes: The health value of the initial population is determined according to the cache performance of the initial population and preset constraints.
4. The method according to claim 2, characterized in that: The cache performance prediction results of multiple learners are combined through the combination layer of the cache performance prediction model to obtain the cache performance of the initial group, including: Through the combined layer of the cache performance prediction model, a voting strategy is adopted to vote on the cache performance prediction results of multiple learners; The cache performance prediction result with the largest number of occurrences is determined as the cache performance of the initial population.
5. The method according to claim 2, characterized in that: The cache performance prediction results of multiple learners are combined through the combination layer of the cache performance prediction model to obtain the cache performance of the initial group, including: Through the combination layer of the cache performance prediction model, a weighted average strategy is adopted to perform weighted average processing on the cache performance prediction results of multiple learners to obtain the cache performance of the initial group.
6. The method according to claim 1, characterized in that The step of performing evolution processing on the initial population according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population comprises: selecting a target group distributed cache parameter in the initial population according to the health value of the initial population; A crossover operation is performed on the target group distributed cache parameters according to a crossover probability threshold, and a mutation process is performed on the initial group according to a mutation probability threshold to obtain a new group.
7. The method according to claim 1, characterized in that The method further comprises: Inputting cache operation environment configuration data, cache performance data and cache operation configuration parameters of the distributed cache cluster into multiple learners of the initial model to obtain learner prediction results of each learner; Combining the learner prediction results of multiple learners through the combination layer of the initial model to obtain a target prediction result; The initial model is trained according to the target prediction result to obtain a cache performance prediction model.
8. A distributed cache parameter optimization device, characterized in that: The device comprises: A population generation module is used to randomly generate multiple sets of distributed cache parameters as the initial population; A performance prediction module, used for inputting the initial population into a plurality of learners of a cache performance prediction model respectively, predicting the cache performance of the initial population, and determining the health value of the initial population according to the cache performance of the initial population; A genetic evolution module, used for performing evolution processing on the initial population according to the health value, mutation probability threshold and crossover probability threshold of the initial population to generate a new population; The parameter optimization module is used to update the new population to the initial population, return to the step of inputting the initial population into multiple learners of the cache performance prediction model respectively, iterate the evolution process, and obtain a set of distributed cache parameters with optimal cache performance.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
A parameter selection optimization method, system and equipment in random forest model training
CN113591944A
Fuel cell performance degradation prediction method
CN116306226A
Database parameter configuration optimization method and device, electronic equipment and storage medium
CN116401232A
Circuit optimization method and device and computer equipment
CN117391018A