Middleware parameter configuration method and device, equipment and storage medium

Through genetic algorithm optimization of middleware parameter configuration, the problem of insufficient accuracy and adaptability in the existing technology is solved, and more efficient and stable system performance is achieved.

CN119781866APending Publication Date: 2025-04-08CHINA MOBILE GRP GUANGDONG CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411982394.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

In the prior art, the optimal parameter configuration of middleware is not accurate enough and does not have adaptability, resulting in the system being unable to perform optimal performance under various operating conditions.

Method used

Using genetic algorithm, we design the chromosomal structure by defining middleware parameters as chromosomal genes, and set the initial value and value range of the parameters. The initial population is randomly generated, and the fitness function is created based on the key indicators that affect middleware performance. Through gene crossover and mutation operations, individuals with the highest fitness are gradually screened out to determine the optimal configuration of middleware parameters.

Benefits of technology

The accuracy and adaptability of middleware parameter configuration is achieved, which significantly improves the overall performance of the system and enhances the efficiency, stability and reliability of deployment and maintenance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781866A_ABST
    Figure CN119781866A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of infrastructure and IT production, in particular to a middleware parameter configuration method, device and equipment and a computer storage medium. According to the middleware parameter configuration method, the genetic algorithm is adopted, and the configuration parameters of the middleware server are automatically adjusted through an intelligent parameter optimization process, so that low delay and high throughput in a specific deployment environment are realized, and the overall performance and stability of a system are remarkably improved. Through the method, the limitation of traditional empirical configuration can be exceeded, and a more accurate and adaptive parameter setting strategy is provided for the middleware assembly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of infrastructure and IT production technology, and in particular to a middleware parameter configuration method, device, equipment and computer storage medium. Background Art

[0002] The middleware system component is responsible for coordinating the flow of data and tasks between different applications and services. The effectiveness of the middleware depends largely on the proper setting of its configuration parameters, including but not limited to the number of threads, number of connections, and JVM memory allocation.

[0003] Since the performance of the middleware directly affects the response speed and stability of the entire application, how to configure the optimal parameter set for it becomes a key issue in system maintenance and optimization.

[0004] Existing technical solutions:

[0005] 1. Setting parameters based on experience largely depends on the administrator's expertise and experience.

[0006] 2. Refer to the parameter values ​​set in systems of similar scale for setting.

[0007] 3. The middleware product provides a set of default parameters that are suitable for general situations.

[0008] 4. Use static analysis tools to evaluate the potential impact of configuration parameters on performance. This approach is usually used during the development phase rather than after the system is deployed.

[0009] 5. Use predefined rules based on historical data and expert knowledge to guide parameter configuration.

[0010] In traditional solutions, middleware parameter configuration methods mainly rely on empirical rules, default settings, or manual adjustments, which have significant limitations. They are usually inflexible and cannot adapt to rapidly changing system loads and business needs. In addition, the manual configuration process is not only time-consuming and labor-intensive, but also easily affected by human factors, resulting in configuration errors or suboptimal performance. Due to the lack of precise optimization mechanisms, existing technologies often cannot find the globally optimal parameter settings, thereby failing to ensure that the system can perform optimally under various working conditions. At the same time, the process of manually adjusting parameters is difficult to standardize and automate, resulting in possible differences in configuration in different environments or time periods, increasing the risk of system instability.

[0011] In summary, in the prior art, the optimal parameter configuration of the middleware is not accurate enough and does not have adaptability. Summary of the invention

[0012] Therefore, the technical problem to be solved by the present invention is to overcome the problem that the optimal parameter configuration of the middleware in the prior art is not accurate enough and does not have adaptability.

[0013] In order to solve the above technical problems, the present invention provides a middleware parameter configuration method, comprising:

[0014] Step 1: Define the middleware parameters as chromosome genes, design the chromosome structure, and set the initial values ​​and value ranges of the middleware parameters;

[0015] Step 2: Based on the value range of the middleware parameters, a plurality of individuals are randomly generated according to the chromosome structure to create an initial population, and a fitness function is created according to key indicators that affect the performance of the middleware;

[0016] Step 3: Calculate the fitness of each individual in the current population according to the fitness function, select a group of individuals whose fitness meets the first preset condition, and generate a parent population;

[0017] Step 4: Perform a gene crossover operation on the parent population to generate offspring individuals, incorporate them into the current population, and perform a single-point mutation operation on the updated population;

[0018] Step 5: Incorporate the individuals generated after the mutation operation into the updated population, and eliminate the individuals that do not meet the second preset condition. Repeat steps 3-5 until the iteration termination condition is met, and determine the chromosome gene of the individual with the highest fitness in the final population as the optimal configuration of the middleware parameters.

[0019] Preferably, the middleware parameters are defined as chromosome genes, the chromosome structure is designed, and the initial values ​​and value ranges of the middleware parameters are set, including:

[0020] Define middleware parameters as chromosome genes, including the number of threads that the middleware can process simultaneously, the maximum number of concurrent connections that the middleware can maintain with a database or other services, and the initial size of the JVM heap memory;

[0021] Designing a chromosome structure, wherein the chromosome structure includes a chromosome gene corresponding to the middleware parameter and a plurality of reserved gene positions;

[0022] The initial value of the number of threads that the middleware can process simultaneously is defined as the product of the number of concurrent users and the average response time or the expected response time and the safety factor;

[0023] Define the initial value of the maximum number of concurrent connections that the middleware can maintain with the database or other services as the sum of the maximum number of concurrent queries and the number of additional reserved connections;

[0024] The initial size of the JVM heap memory is defined as the product of the safety factor, the memory occupied by a single request, and the number of concurrent requests;

[0025] The value range of each middleware parameter is determined based on the initial value and the preset proportional coefficient.

[0026] Preferably, the step of randomly generating a plurality of individuals based on the value range of the middleware parameter according to the chromosome structure to create an initial population includes:

[0027] Define the population size based on the number of middleware parameters and the initial value and range of each middleware parameter;

[0028] Within the range of the middleware parameter, randomly generate an integer value as the chromosome gene corresponding to the middleware parameter, assign a random value or a default value to the reserved gene position, and generate multiple individuals based on the population size;

[0029] Individual verification is performed on the multiple individuals generated to ensure that each generated individual complies with the preset business rules and logical constraints to obtain the initial population.

[0030] Preferably, the step of creating a fitness function according to key indicators affecting the performance of the middleware includes:

[0031] Identify key indicators that affect middleware performance, including response time, throughput, and resource utilization;

[0032] Compare the key indicators in pairs, assign values ​​based on relative importance, and construct a pairwise comparison matrix;

[0033] Calculating the maximum eigenvalue of the pairwise comparison matrix, and normalizing the eigenvector corresponding to the maximum eigenvalue to obtain the relative weight of each key indicator;

[0034] Calculating a consistency index according to the maximum feature, calculating a consistency ratio according to the consistency index, and performing a consistency check on the matrix according to the consistency ratio;

[0035] If the consistency check passes, a fitness function is created based on each key indicator and its corresponding weight.

[0036] Preferably, the step of calculating the fitness of each individual in the current population according to the fitness function, selecting a group of individuals whose fitness meets the first preset condition, and generating the parent population comprises:

[0037] Step a: Define the initial tournament size t and fitness threshold;

[0038] Step b: Randomly select t individuals from the current population to participate in the tournament, and select the individual with the highest fitness as the winner;

[0039] Step c: Calculate the average fitness of the current population, if it is higher than the fitness threshold, reduce the tournament size, if it is not higher than the fitness threshold, increase the tournament size;

[0040] Step d: Repeat steps bc until the required number of parent populations reaches the set value.

[0041] Preferably, performing a gene crossover operation on the parent population to generate offspring individuals, incorporating the offspring individuals into the current population, and performing a single-point mutation operation on the updated population includes:

[0042] Randomly selecting two male parents from the parent population multiple times and placing them into a pairing pool as candidates;

[0043] Selecting a paternal combination whose gene difference is greater than a preset threshold from the pairing pool, and setting a crossover point;

[0044] Exchanging gene fragments of two paternal individuals according to the intersection point to generate offspring individuals, and performing individual verification on the offspring individuals to ensure that each generated individual complies with preset business rules and logical constraints;

[0045] Incorporate the offspring individuals that have passed individual verification into the current population and define the mutation probability;

[0046] Calculate the relative position of the gene value of each gene within the corresponding parameter range;

[0047] If the relative position is not within the preset range, the mutation strength is reduced; if the relative position is within the preset range, the mutation strength is increased;

[0048] The gene value of the selected gene is randomly adjusted according to the adjusted mutation intensity to perform the mutation operation.

[0049] Preferably, the step of incorporating individuals generated after performing the mutation operation into the updated population and eliminating individuals that do not meet the second preset condition comprises:

[0050] The frequency of each gene in the updated population is counted, and the individuals whose gene frequency meets the third preset condition are retained;

[0051] In addition to the individuals that need to be retained, multiple individuals with lower fitness rankings in the population are replaced by individuals generated after performing the mutation operation.

[0052] The present invention also provides a middleware parameter configuration device, comprising:

[0053] The chromosome structure design module is used to define the middleware parameters as chromosome genes, design the chromosome structure, and set the initial value and value range of the middleware parameters;

[0054] An initial population and fitness function creation module, for randomly generating a plurality of individuals according to the chromosome structure based on the value range of the middleware parameters, creating an initial population, and creating a fitness function according to key indicators affecting the performance of the middleware;

[0055] A selection module, used for calculating the fitness of each individual in the current population according to the fitness function, screening out a group of individuals whose fitness meets the first preset condition, and generating a parent population;

[0056] A crossover and mutation module, used for performing a gene crossover operation on the parent population to generate offspring individuals, incorporating the offspring individuals into the current population, and performing a single-point mutation operation on the updated population;

[0057] The optimal parameter determination module is used to incorporate the individuals generated after the mutation operation into the updated population, eliminate the individuals that do not meet the second preset condition, repeat steps 3-5 until the iteration termination condition is met, and determine the chromosome gene of the individual with the highest fitness in the final population as the optimal configuration of the middleware parameters.

[0058] The present invention also provides a middleware parameter configuration device, comprising:

[0059] Memory for storing computer programs;

[0060] A processor is used to implement the above-mentioned middleware parameter configuration method steps when executing the computer program.

[0061] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned middleware parameter configuration method are implemented.

[0062] The above technical solution of the present invention has the following advantages compared with the prior art:

[0063] The middleware parameter configuration method described in the present invention adopts a genetic algorithm to provide an optimal solution for the configuration of middleware components. By simulating the selection and genetic processes in nature, the present invention can automatically explore and determine parameter configurations that achieve low latency and high throughput under variable workloads and system states. Compared with traditional manual configuration, the automated search and optimization process of the present invention significantly reduces human intervention, thereby reducing human errors and related costs. In addition, the present invention not only improves the overall performance of the system, but also enhances the efficiency, stability and reliability of the deployment and maintenance of middleware components. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein:

[0065] Figure 1 It is an implementation flow chart of a middleware parameter configuration method provided by the present invention. DETAILED DESCRIPTION

[0066] The core of the present invention is to provide a middleware parameter configuration method, device, equipment and computer storage medium, which effectively improves the accuracy and adaptability of the optimal configuration of the middleware parameters.

[0067] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0068] Please refer to Figure 1 , Figure 1 This is a flow chart of the implementation of a middleware parameter configuration method provided by the present invention; the specific operation steps are as follows:

[0069] S101: define the middleware parameters as chromosome genes, design the chromosome structure, and set the initial values ​​and value ranges of the middleware parameters;

[0070] S102: Based on the value range of the middleware parameters, a plurality of individuals are randomly generated according to the chromosome structure to create an initial population, and a fitness function is created according to key indicators that affect the performance of the middleware;

[0071] Among them, the chromosome structures of multiple randomly generated individuals are different.

[0072] S103: Calculating the fitness of each individual in the current population according to the fitness function, screening out a group of individuals whose fitness meets the first preset condition, and generating a parent population;

[0073] S104: performing a gene crossover operation on the parent population to generate offspring individuals, incorporating the offspring individuals into the current population, and performing a single-point mutation operation on the updated population;

[0074] S105: Incorporate the individuals generated after the mutation operation into the updated population, and eliminate the individuals that do not meet the second preset condition, repeat steps S103-S105 until the iteration termination condition is met, and determine the chromosome gene of the individual with the highest fitness in the final population as the optimal configuration of the middleware parameters.

[0075] Based on the above embodiments, this embodiment describes step S101 in detail:

[0076] Define middleware parameters as chromosome genes, including the number of threads that the middleware can process simultaneously, the maximum number of concurrent connections that the middleware can maintain with the database or other services, and the initial size of the JVM heap memory;

[0077] Designing a chromosome structure, wherein the chromosome structure includes a chromosome gene corresponding to the middleware parameter and a plurality of reserved gene positions;

[0078] In one embodiment, when designing the chromosome structure, two gene positions are reserved at the end. These positions are not currently involved in the algorithm operation, but can be used in the future according to new performance influencing factors; the complete chromosome contains genes and reserved gene positions of all known parameters, such as: [thread number gene, connection number gene, JVM heap memory gene, reserved gene 1, reserved gene 2, etc.].

[0079] ·Define the initial value of the number of threads that the middleware can process simultaneously as the product of the number of concurrent users and the average response time or the expected response time and the safety factor;

[0080] The initial value of the number of threads = number of concurrent users × (average response time / expected response time) × safety factor. The number of concurrent users refers to the number of users that the system needs to serve at the same time; the average response time is the average time for the current system to process requests; the expected response time is the service response speed that is expected to be achieved; the safety factor range is [1.5, 2], which is used to deal with sudden traffic and system reservation.

[0081] ·Define the initial value of the maximum number of concurrent connections that the middleware can maintain with the database or other services as the sum of the maximum number of concurrent queries and the number of additional reserved connections;

[0082] The initial value of the number of connections = the maximum number of concurrent queries + the number of additional reserved connections. The maximum number of concurrent queries is based on the concurrent query demand during business peak periods; the number of additional reserved connections is 10%-20% of the maximum number of concurrent queries.

[0083] The initial size of the JVM heap memory is defined as the product of the safety factor, the memory occupied by a single request, and the number of concurrent requests;

[0084] Determine the value range of each middleware parameter based on the initial value and the preset proportional coefficient.

[0085] The initial value of JVM heap memory = safety factor × (memory occupied by a single request) × (number of concurrent requests), in GB.

[0086] In one embodiment, the parameter range is set using the following formula: p∈[p0×(1-α),p0×(1+α)]

[0087] Among them, p0 is the initial value of the parameter, α is the proportional coefficient, and the value range is [0.3, 0.5]. In addition, all parameters are encoded using integers.

[0088] Based on the above embodiments, this embodiment describes step S102 in detail:

[0089] Define the population size based on the number of middleware parameters and the initial value and range of each middleware parameter;

[0090]

[0091] Where n is the number of parameters defined in the above steps, and the maximum value is i and minimum value i is the upper and lower limits of the range of the i-th parameter defined in the above steps, and the initial value i is the initial value of the i-th parameter defined in the above steps, and k is a proportional constant used to adjust the relationship between the population size and the parameter range and the expected search depth, which is used to balance the exploration ability and computational efficiency of the genetic algorithm. The setting method is as follows: ① Initial setting: The initial setting of k can be based on historical data of similar middleware optimization problems and experience from previous studies. Choose a medium value as a starting point, such as k = 10.

[0092] ② Experiment: Set several different k values, such as k = 5, 10, 15, and run the genetic algorithm for each k value, recording and comparing the results. Observe the performance of the genetic algorithm under different k values, including the quality of the solution, the convergence speed of the algorithm, and the use of computing resources. ③ Result evaluation: Analyze the results of each experiment to determine which k value provides the best performance balance, that is, effectively exploring the solution space while maintaining reasonable computing efficiency. Consider the performance of the algorithm in actual operation and select a k value that performs best under actual resource constraints. ④ Final selection: Based on the experimental results, select a k

[0093] The value is used as a standard setting for the algorithm. If necessary, you can fine-tune this value in subsequent operations to adapt to new situations or improve the algorithm.

[0094] Within the range of the middleware parameter, randomly generate an integer value as the chromosome gene corresponding to the middleware parameter, assign a random value or a default value to the reserved gene position, and generate multiple individuals based on the population size;

[0095] Each parameter is randomly initialized to determine the initial value of each parameter, that is, the value of each gene is generated according to the parameter range set in the above steps, and α is used to calculate the legal value range of each parameter. For each parameter p, the following settings are made:

[0096] Thread number gene: According to the thread number range determined in the above step, p 线程数=[p 0线程数 ×(1-α),p 0线程数 ×(1+α)], a random integer value is generated as the value of the thread number gene.

[0097] Connection number gene: Similarly, the connection number range p defined in the above step 连接数 =[p 0连接数 ×(1-α),p 0连接数 ×(1+α)], a random integer value is generated as the value of the connection number gene.

[0098] JVM heap memory gene: In the JVM heap memory range p JVM堆内存 =[p 0JVM堆内存 ×(1-α), p 0JVM堆内存 ×(1+α)], a random integer value is generated as the value of the JVM heap memory gene.

[0099] Reserved gene positions: Assign random values ​​or default values ​​to reserved gene positions because they are not currently involved in the algorithm operation.

[0100] Perform individual verification on the generated individuals to ensure that each generated individual complies with the preset business rules and logical constraints to obtain the initial population.

[0101] Perform individual verification on the randomly generated parameter values ​​in the previous step to ensure that each generated individual complies with the predetermined business rules and logical constraints, and that all parameter values ​​are within a reasonable range:

[0102] Verify parameter range: Check each parameter in each individual to confirm whether its value is within the valid range defined in the above steps.

[0103] Business rule compliance check: Check whether the individual configuration is reasonable according to business requirements and logical constraints. For example, some parameter combinations may not be allowed due to business logic, such as the number of threads should not exceed twice the number of connections.

[0104] Regenerate non-compliant parameters: For parameters that do not meet the scope or business rules, regenerate them randomly until all conditions are met. Use a loop or recursive method to regenerate parameters and ensure that they are validated after each generation.

[0105] Identify key indicators that affect middleware performance, including response time, throughput, and resource utilization;

[0106] Define performance indicators: Determine the key indicators that affect the performance of the middleware, including response time, processing capacity, and resource utilization, to provide quantitative evaluation criteria for the construction of the fitness function and help determine the actual impact of different configurations on the performance of the middleware components. The specific steps include:

[0107] Build a controlled environment that simulates actual operating conditions to ensure the accuracy and consistency of the measured data. Use performance monitoring tools to capture response time and throughput data. Utilize system monitoring tools (such as Windows Performance Monitor or Linux top command) to record CPU and memory usage.

[0108] In the test environment, run performance tests, perform standardized load tests on the middleware configuration, and collect and record the resulting performance data.

[0109] ·Compare the key indicators in pairs, assign values ​​based on relative importance, and construct a pairwise comparison matrix;

[0110] Calculate the maximum eigenvalue of the pairwise comparison matrix, and standardize the eigenvector corresponding to the maximum eigenvalue to obtain the relative weight of each key indicator;

[0111] The weights w1, w2 and w3 representing throughput, latency and resource consumption are set by using the Analytic Hierarchy Process (AHP). The specific process is as follows:

[0112] Construct a pairwise comparison matrix: Perform pairwise comparisons on the performance indicators to assess their importance relative to the optimization goal. Perform pairwise comparisons on each performance indicator in the middle layer and assign values ​​based on relative importance. Use a 1 to 9 assignment method, where 1 indicates that both are equally important, 3 indicates slightly important, 5 indicates obviously important, 7 indicates strongly important, and 9 indicates extremely important. 2, 4, 6, and 8 are intermediate values. For example, if the expert believes that response time is more important than throughput, assign a value of 3 to the cell for response time to throughput (or 1 / 3 for the opposite case). An example of a matrix is ​​as follows:

[0113]

[0114] Calculate weights: Use the standardized method to process the pairwise comparison matrix, and solve the maximum eigenvalue λ of the matrix corresponding to

[0115] max is used to determine the weight. The characteristic equation is in the form of: det(A-λI)=0, where A is the pairwise comparison matrix, I is the unit matrix of the same order, and λ represents the eigenvalue. Solving this equation will obtain multiple eigenvalues. From the obtained eigenvalues, identify the largest eigenvalue, i.e., λ. When λ is brought back to the equation A-λI=0, the corresponding characteristic max max can be solved.

[0116] Vector. This feature vector is normalized (i.e. the sum of the elements of the vector is 1) to represent the relative weight of each element in the result of the pairwise comparison.

[0117] Calculating a consistency index according to the maximum feature, calculating a consistency ratio according to the consistency index, and performing a consistency check on the matrix according to the consistency ratio;

[0118] Consistency test: Calculate the consistency index (CI) and consistency ratio (CR). The CI calculation formula is: (λ max -n) / (n-1), where λ max is the largest eigenvalue of the matrix, and n is the dimension of the matrix. Find the corresponding average random consistency index (RI) and calculate CR = CI / RI. If CR < 0.1, the consistency of the matrix is ​​considered acceptable. If the result is unacceptable, re-execute the steps of constructing the pairwise comparison matrix, calculating the weights and consistency test until it is satisfied.

[0119] If the consistency check passes, a fitness function is created based on each key indicator and its corresponding weight.

[0120] Create a fitness function to convert the performance index into a quantitative fitness score. The fitness function is as follows:

[0121] Fitness=w1×Throughput+w2×(1 / Latency)+w3×(1 / Resource Consumption)

[0122] Among them, w1, w2 and w3 represent the weights of throughput, delay and resource consumption set in the previous link respectively. Delay and resource consumption use the inverse form to obtain lower values, which are more in line with the needs of the model (usually it is expected to minimize delay and resource consumption. If the original values ​​of delay and resource consumption are used directly, the ideal situation with lower indicators will lead to lower fitness scores, which is contrary to the desired goal. By adopting the inverse, this relationship is transformed so that lower delay and resource consumption correspond to higher fitness values, which is more in line with the mechanism of genetic algorithm to select the optimal solution).

[0123] Based on the above embodiments, this embodiment describes step S103 in detail:

[0124] Step a: Define the initial tournament size t and fitness threshold;

[0125] The initial tournament size t0 is set based on previous algorithm experiments or expert recommendations, and is initially set to 10% of the population size. ② Set a fitness threshold F threshold This threshold is used as the basis for subsequent adjustment of the tournament size and is initially set to the median of the current population fitness.

[0126] Step b: Randomly select t individuals from the current population to participate in the tournament, and select the individual with the highest fitness as the winner;

[0127] ② Randomly select t individuals from the current population to participate in the tournament, where t is the current tournament size. ② Score the individuals participating in the tournament according to the fitness function, and select the individual with the highest fitness as the winner.

[0128] Step c: Calculate the average fitness of the current population, if it is higher than the fitness threshold, reduce the tournament size, if it is not higher than the fitness threshold, increase the tournament size;

[0129] In one embodiment, the tournament size is dynamically adjusted as follows: if the average fitness of the population is higher than F threshold , then reduce the tournament size by 10%, not less than 5% of the population size. If the average fitness is below F threshold , then increase the tournament size by 10%, not to exceed 25% of the population size.

[0130] Step d: Repeat steps bc until the required number of parent populations reaches a set value (in one embodiment, set to 50% of the total population).

[0131] After the adaptive tournament selection method is applied, a group of individuals with higher fitness have been selected, and the parent population is generated based on these individuals. The specific process is:

[0132] From the individuals selected by the adaptive tournament selection method, a certain proportion of individuals with the highest fitness are selected. These individuals demonstrate the best configuration performance in the current environment, including excellent performance in response time, throughput, and resource utilization. This proportion is determined based on the population size and predetermined genetic algorithm parameters, and the top 10% to 30% of the population is usually selected as the parent population.

[0133] Detailed records are kept for each selected parent individual, including their chromosome encoding, fitness score and relevant performance indicator data.

[0134] The following is an example of a record for a parent entity:

[0135]

[0136] in,

[0137] Chromosome encoding: The chromosome consists of multiple genes, each of which corresponds to a parameter of the middleware configuration.

[0138] Fitness score: The fitness score of each individual is calculated based on the fitness function, which reflects the degree of adaptation of the individual to the current environment.

[0139] Relevant performance indicator data: Performance indicators may include response time, throughput, and resource utilization.

[0140] Based on the above embodiments, this embodiment describes step S104 in detail:

[0141] · Randomly select two male parents from the parent population multiple times and put them into the pairing pool as candidates;

[0142] Randomly select two fathers from the generated parent population for pairing. At the same time, use the algorithm to dynamically select individuals with large genomic differences for pairing, avoiding pairing between individuals that may share a large number of identical genes. Specifically, a simple algorithm such as the Hamming distance can be used to measure the difference between two chromosomes, that is, to calculate the number of different genes on the two chromosomes. The overall process is: before starting pairing, randomly select individuals in the population as candidates for the pairing pool. Calculate the genetic difference for each pair of individuals in the pairing pool. Select the individual combination with the largest genetic difference from the pairing pool for pairing.

[0143] Selecting a paternal combination with a gene difference greater than a preset threshold from the pairing pool and setting a crossover point;

[0144] Two crossover points are set, one between the number of threads and connections (these two parameters usually have a direct impact on concurrency) and the JVM memory, and the other between the JVM memory and the two reserved parameters, to increase the diversity of crossover operations while maintaining the parameter functional group.

[0145] Exchange the gene fragments of the two paternal individuals according to the intersection point to generate offspring individuals, and perform individual verification on the offspring individuals to ensure that each generated individual complies with the preset business rules and logical constraints;

[0146] The gene fragments of the parent individuals are exchanged at the crossover point to produce new offspring individuals. At the first crossover point, the genetic information of the two parents before and after that point is exchanged. For example, one parent provides the number of threads and connections, and the other parent provides JVM memory and reserved parameters. At the second crossover point, their genetic information before and after that point is further exchanged. This can include exchanging JVM memory from the first parent to the second parent, while exchanging the reserved parameters of the second parent to the first parent. Through gene exchange, each pair of parents produces two offspring individuals. These offspring individuals combine the characteristics of their parents and introduce new variations, increasing the diversity and innovation of the population.

[0147] After the crossover operation, the newly generated offspring individuals are checked for parameter validity to ensure that their configuration parameters meet the predetermined business rules and logical constraints. Illegal individuals need to be regenerated until all conditions are met.

[0148] Incorporate the offspring individuals that have passed individual verification into the current population and define the mutation probability;

[0149] The mutation operation is performed using a limited range of point mutation methods. The mutation operation is performed on a single gene, and its value is adjusted within a limited range to ensure that the mutated gene value is still within the allowed parameter range. Specifically:

[0150] Set the mutation probability: Set a smaller mutation rate pm in the range of [1%, 5%]. This probability determines how many individuals in the population will undergo mutation.

[0151] Calculate the relative position of the gene value of each gene within the corresponding parameter range;

[0152] For each gene that needs to be mutated, calculate its relative position within the parameter range. Use the formula:

[0153]

[0154] Among them, Gene Current Value: is the current value of the gene, such as the current setting value of the number of threads, the number of connections, or the JVM heap memory. Lower Bound: is the minimum value of the parameter corresponding to the gene, which is the lowest valid value that the parameter can take. Upper Bound: is the maximum value of the parameter corresponding to the gene, representing the highest valid value that the parameter can reach. RelativePosition: This ratio represents the relative position of the current value of the gene within its total range. If this value is close to 0, it means that the gene value is close to its lower limit; if it is close to 1, it means that the gene value is close to its upper limit.

[0155] If the relative position is not within the preset range, the mutation strength is reduced; if the relative position is within the preset range, the mutation strength is increased;

[0156] If the Relative Position is less than 0.2 or greater than 0.8, reduce the mutation intensity and set it to ±3% of the current value. If the Relative Position is between 0.2 and 0.8, increase the mutation intensity and set it to ±10% of the current value. The above adjustments can ensure that the mutation of genes near the boundaries does not cause the value to exceed the range, while allowing greater variation in the middle area.

[0157] Randomly adjust the gene value of the selected gene according to the adjusted mutation strength and perform the mutation operation.

[0158] Randomly adjust the selected gene value according to the variation intensity calculated above, the formula is: New Gene Value = Current Gene Value × (1 ± variation percentage). The variation percentage is the variation intensity of one step. Afterwards, check whether the mutated gene value is still within the allowed parameter range. If it is out of range, it needs to be readjusted to the boundary value or the variation value needs to be recalculated.

[0159] Update the calculated new gene value to the corresponding position in the individual's chromosome. Including: If the new gene value is within the allowable range of the parameter, update it directly. If the new gene value exceeds the allowable range of the parameter, adjust it to the nearest boundary value. For example, if the newly calculated gene value is lower than the minimum allowable value, set it to the minimum allowable value; if it is higher than the maximum allowable value, set it to the maximum allowable value.

[0160] Assume that in the mutation operation, the gene for the number of threads is mutated, and the mutated value changes from 8 to 10 (the mutation intensity is ±10%), while the other genes remain unchanged. The updated individual example is as follows:

[0161]

[0162] Based on the above embodiments, this embodiment describes step S105 in detail:

[0163] The step of incorporating the individuals generated after the mutation operation into the updated population and eliminating the individuals that do not meet the second preset condition includes:

[0164] Count the frequency of each gene in the updated population, and retain the individuals whose gene frequency meets the third preset condition;

[0165] Identifying individuals with unique gene combinations, although not highly fit, and retaining them in the population can enhance the genetic diversity of the population. The method is to count the frequency of each gene in the population and retain individuals with genes whose frequency is less than the mean minus two standard deviations.

[0166] In addition to the individuals that need to be retained, multiple individuals with lower fitness rankings in the population are replaced with individuals generated after performing the mutation operation.

[0167] All the new individuals that have undergone mutation operations in the above steps are incorporated into the current population to form a new generation of population; the individuals with the lowest fitness are selected from the existing population, and their number is equal to that of the newly generated individuals; the fitness of the individuals is sorted, and the old individuals with the lowest fitness are replaced by the new individuals.

[0168] During the elimination process, measures are taken to protect the diversity of the population, prevent the offspring individuals from being too similar, and ensure that the population contains different configuration parameter combinations. The specific process is as follows:

[0169] For each gene, calculate its mean value across the entire population. The mean is the sum of all the values ​​for that gene divided by the total number of individuals in the population.

[0170] For each gene, calculate the square of the difference between each individual's gene value and the mean. Sum these squared differences and divide by the number of individuals in the population to get the variance. The variance formula is as follows: Where N is the population size, x i is the gene value of the ith individual, and μ is the average value of the gene.

[0171] Calculate the variance of each gene in the population and compare it with the width of the respective gene parameter range. The parameter range width here is defined as the difference between the maximum and minimum allowed values ​​of the gene. If the calculated variance exceeds 10% of the width of the corresponding gene parameter range, it is considered that the genetic expression differences of individuals in the population are large, indicating that the population diversity is sufficient and no additional intervention is required. When the calculated population variance is less than 10% of the width of the corresponding gene parameter range, it indicates that the genetic diversity of the population is low, and measures need to be taken to increase diversity. Choose one of the following three methods or use a combination of multiple (if the population diversity is very low, choose ①②, if the diversity is slightly low, choose ① or ②): ① Increase the mutation rate: Increase the mutation rate to 2-3 times the original mutation rate to introduce more randomness and promote genetic diversification. ② Adjust the crossover rate: Increase the original crossover rate by 30% to increase the chance of genetic recombination between individuals to introduce new gene combinations.

[0172] Based on the above embodiments, the present invention compares the highest fitness of 10 consecutive generations. If the maximum fitness change between these generations is less than 0.01%, this indicates that a fitness platform has been reached, that is, further genetic changes and selection are unlikely to produce significant improvements, indicating that the iteration end condition has been met.

[0173] Based on the above embodiments, after obtaining the final population:

[0174] Identify the individual with the highest fitness in the current population, which represents the optimal middleware configuration currently found. Record the chromosome code, fitness score, and related performance indicators (such as response time, throughput, and resource utilization) of the individual in detail.

[0175] The optimal individual middleware configuration parameters are used for detailed performance verification in the control environment constructed in the above steps.

[0176] Once verified in a controlled environment, deploy these configuration parameters to the actual production environment to achieve performance optimization.

[0177] The present invention adopts a genetic algorithm-based approach to automatically adjust the configuration parameters of the middleware, thereby providing the ability to dynamically adapt to business needs and system loads, and can automatically explore the optimal configuration parameter combination according to the actual workload and environment, providing higher efficiency and accuracy; the present invention can dynamically adjust the middleware configuration to adapt to different business needs and system loads through a genetic algorithm, ensuring that the best performance can be achieved in various operating environments; the present invention considers multiple performance indicators such as throughput, delay and resource utilization by constructing a fitness function, ensuring that the performance of the middleware configuration is fully evaluated; the present invention continuously iterates to find the optimal solution through a continuous optimization cycle and a natural selection mechanism of a genetic algorithm, and can continuously find and verify the optimal configuration, ensuring that the system can show the best performance under various working conditions, enhancing the predictability and stability of the system, and reducing the system failure rate. The chromosome structure design in the present invention allows for future expansion based on new performance influencing factors, increasing the flexibility and foresight of the system. The automated optimization process of the present invention reduces the need for manual intervention, reduces the risk caused by manual configuration errors or inconsistencies, and also significantly reduces the workload of system administrators.

[0178] The present invention aims at optimizing the automatic configuration of middleware system parameters and is applicable to various system maintenance and optimization projects in IT infrastructure and production fields. The present invention adopts an automatic configuration method based on genetic algorithm, combined with an intelligent parameter optimization process and an adaptive configuration strategy, to automatically adjust the configuration parameters of the middleware server based on changing business needs and dynamic system loads. Through this method, not only can the performance of the middleware system in a specific deployment environment be significantly improved, low latency and high throughput can be achieved, but it can also effectively cope with the rapidly changing environment that traditional empirical configuration methods are difficult to adapt to.

[0179] Compared with the traditional experience and rule-based parameter configuration method, the present invention provides automated and intelligent parameter configuration and optimization capabilities while achieving significant improvements in system performance and configuration efficiency. For example, the response time of the middleware component is reduced by more than 20%, and the system resource utilization efficiency is improved by more than 30%. In addition, the method maintains the continuity and adaptability of the optimization process by dynamically adapting to changes in system load, which can effectively reduce configuration errors caused by human factors and significantly reduce the risk of system instability. Through this method, the time used for middleware parameter configuration adjustment is reduced by 70%, greatly optimizing the operation and maintenance efficiency.

[0180] The embodiment of the present invention further provides a middleware parameter configuration device; the specific device may include:

[0181] The chromosome structure design module is used to define the middleware parameters as chromosome genes, design the chromosome structure, and set the initial value and value range of the middleware parameters;

[0182] An initial population and fitness function creation module, for randomly generating a plurality of individuals according to the chromosome structure based on the value range of the middleware parameters, creating an initial population, and creating a fitness function according to key indicators affecting the performance of the middleware;

[0183] A selection module, used for calculating the fitness of each individual in the current population according to the fitness function, screening out a group of individuals whose fitness meets the first preset condition, and generating a parent population;

[0184] A crossover and mutation module, used for performing a gene crossover operation on the parent population to generate offspring individuals, incorporating the offspring individuals into the current population, and performing a single-point mutation operation on the updated population;

[0185] The optimal parameter determination module is used to incorporate the individuals generated after the mutation operation into the updated population, eliminate the individuals that do not meet the second preset condition, repeat steps 3-5 until the iteration termination condition is met, and determine the chromosome gene of the individual with the highest fitness in the final population as the optimal configuration of the middleware parameters.

[0186] The middleware parameter configuration device of this embodiment is used to implement the aforementioned middleware parameter configuration method. Therefore, the specific implementation methods of the middleware parameter configuration device can be seen in the embodiment part of the aforementioned middleware parameter configuration method. For example, the chromosome structure design module, the initial population and fitness function creation module, the selection module, the crossover and mutation module, and the optimal parameter determination module are respectively used to implement steps S101, S102, S103, S104 and S105 in the aforementioned middleware parameter configuration method. Therefore, its specific implementation methods can refer to the description of the corresponding embodiments of each part, which will not be repeated here.

[0187] A specific embodiment of the present invention further provides a middleware parameter configuration device, comprising: a memory for storing a computer program; and a processor for implementing the steps of the above-mentioned middleware parameter configuration method when executing the computer program.

[0188] A specific embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned middleware parameter configuration method are implemented.

[0189] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0190] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0191] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0192] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0193] Obviously, the above embodiments are merely examples for the purpose of clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the present invention.

Claims

1. A method for configuring middleware parameters, characterized in that: include: Step 1: Define the middleware parameters as chromosome genes, design the chromosome structure, and set the initial values ​​and value ranges of the middleware parameters; Step 2: Based on the value range of the middleware parameters, a plurality of individuals are randomly generated according to the chromosome structure to create an initial population, and a fitness function is created according to key indicators that affect the performance of the middleware; Step 3: Calculate the fitness of each individual in the current population according to the fitness function, select a group of individuals whose fitness meets the first preset condition, and generate a parent population; Step 4: Perform a gene crossover operation on the parent population to generate offspring individuals and incorporate them into the current population. And perform single-point mutation operation on the updated population; Step 5: Incorporate the individuals generated after the mutation operation into the updated population, and eliminate the individuals that do not meet the second preset condition. Repeat steps 3-5 until the iteration termination condition is met, and determine the chromosome gene of the individual with the highest fitness in the final population as the optimal configuration of the middleware parameters.

2. The method for configuring middleware parameters according to claim 1, characterized in that: Defining the middleware parameters as chromosome genes, designing the chromosome structure, and setting the initial values ​​and value ranges of the middleware parameters include: Define middleware parameters as chromosome genes, including the number of threads that the middleware can process simultaneously, the maximum number of concurrent connections that the middleware can maintain with a database or other services, and the initial size of the JVM heap memory; Designing a chromosome structure, wherein the chromosome structure includes a chromosome gene corresponding to the middleware parameter and a plurality of reserved gene positions; The initial value of the number of threads that the middleware can process simultaneously is defined as the product of the number of concurrent users and the average response time or the expected response time and the safety factor; Define the initial value of the maximum number of concurrent connections that the middleware can maintain with the database or other services as the sum of the maximum number of concurrent queries and the number of additional reserved connections; The initial size of the JVM heap memory is defined as the product of the safety factor, the memory occupied by a single request, and the number of concurrent requests; The value range of each middleware parameter is determined based on the initial value and the preset proportional coefficient.

3. The method for configuring middleware parameters according to claim 2, characterized in that: The step of randomly generating a plurality of individuals based on the value range of the middleware parameter according to the chromosome structure and creating an initial population includes: Define the population size based on the number of middleware parameters and the initial value and range of each middleware parameter; Within the range of the middleware parameter, randomly generate an integer value as the chromosome gene corresponding to the middleware parameter, assign a random value or a default value to the reserved gene position, and generate multiple individuals based on the population size; Individual verification is performed on the multiple individuals generated to ensure that each generated individual complies with the preset business rules and logical constraints to obtain the initial population.

4. The method for configuring middleware parameters according to claim 1, characterized in that: The creation of a fitness function according to key indicators affecting the performance of the middleware includes: Identify key indicators that affect middleware performance, including response time, throughput, and resource utilization; Compare the key indicators in pairs, assign values ​​based on relative importance, and construct a pairwise comparison matrix; Calculating the maximum eigenvalue of the pairwise comparison matrix, and normalizing the eigenvector corresponding to the maximum eigenvalue to obtain the relative weight of each key indicator; Calculating a consistency index according to the maximum feature, calculating a consistency ratio according to the consistency index, and performing a consistency check on the matrix according to the consistency ratio; If the consistency check passes, a fitness function is created based on each key indicator and its corresponding weight.

5. The method for configuring middleware parameters according to claim 1, characterized in that: The step of calculating the fitness of each individual in the current population according to the fitness function, selecting a group of individuals whose fitness meets the first preset condition, and generating a parent population comprises: Step a: Define the initial tournament size t and fitness threshold; Step b: Randomly select t individuals from the current population to participate in the tournament, and select the individual with the highest fitness as the winner; Step c: Calculate the average fitness of the current population, if it is higher than the fitness threshold, reduce the tournament size, if it is not higher than the fitness threshold, increase the tournament size; Step d: Repeat steps bc until the required number of parent populations reaches the set value.

6. The method for configuring middleware parameters according to claim 1, characterized in that: The performing of a gene crossover operation on the parent population to generate offspring individuals, incorporating the offspring individuals into the current population, and performing a single-point mutation operation on the updated population includes: Randomly selecting two male parents from the parent population multiple times and placing them into a pairing pool as candidates; Selecting a paternal combination whose gene difference is greater than a preset threshold from the pairing pool, and setting a crossover point; Exchanging gene fragments of two paternal individuals according to the intersection point to generate offspring individuals, and performing individual verification on the offspring individuals to ensure that each generated individual complies with preset business rules and logical constraints; Incorporate the offspring individuals that have passed individual verification into the current population and define the mutation probability; Calculate the relative position of the gene value of each gene within the corresponding parameter range; If the relative position is not within the preset range, the mutation strength is reduced; if the relative position is within the preset range, the mutation strength is increased; The gene value of the selected gene is randomly adjusted according to the adjusted mutation intensity to perform the mutation operation.

7. The method for configuring middleware parameters according to claim 1, characterized in that: The step of incorporating the individuals generated after the mutation operation into the updated population and eliminating the individuals that do not meet the second preset condition includes: The frequency of each gene in the updated population is counted, and the individuals whose gene frequency meets the third preset condition are retained; In addition to the individuals that need to be retained, multiple individuals with lower fitness rankings in the population are replaced by individuals generated after the mutation operation.

8. A middleware parameter configuration device, characterized in that: include: The chromosome structure design module is used to define the middleware parameters as chromosome genes, design the chromosome structure, and set the initial value and value range of the middleware parameters; An initial population and fitness function creation module, for randomly generating a plurality of individuals according to the chromosome structure based on the value range of the middleware parameters, creating an initial population, and creating a fitness function according to key indicators affecting the performance of the middleware; A selection module, used for calculating the fitness of each individual in the current population according to the fitness function, screening out a group of individuals whose fitness meets the first preset condition, and generating a parent population; A crossover and mutation module, used for performing a gene crossover operation on the parent population to generate offspring individuals, incorporating the offspring individuals into the current population, and performing a single-point mutation operation on the updated population; The optimal parameter determination module is used to incorporate the individuals generated after the mutation operation into the updated population, eliminate the individuals that do not meet the second preset condition, repeat steps 3-5 until the iteration termination condition is met, and determine the chromosome gene of the individual with the highest fitness in the final population as the optimal configuration of the middleware parameters.

9. A middleware parameter configuration device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of a middleware parameter configuration method as claimed in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a middleware parameter configuration method as claimed in any one of claims 1 to 7 are implemented.