Engineering optimization methods, systems, and media based on the whale optimization algorithm

By improving the individual mutation, unified search, and group communication strategies of the Whale Optimization Algorithm (WOA), the problems of imbalance between exploration and development and insufficient population diversity in the traditional WOA are solved, achieving efficient engineering optimization results, especially significantly improving convergence accuracy and diversity in complex engineering problems.

CN121351871BActive Publication Date: 2026-05-26CHINA UNIV OF PETROLEUM (EAST CHINA)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-16
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Traditional Whale Optimization (WOA) algorithms suffer from shortcomings in exploration-exploitation imbalance, insufficient population diversity, and a single search strategy, resulting in low convergence accuracy and difficulty in adapting to the search requirements of complex multimodal functions.

Method used

By introducing individual mutation strategy, unified search strategy and group communication strategy, the search range and adaptive weights are dynamically adjusted to balance exploration and development, improve population diversity, and the convergence factor is adjusted by using cosine and sine functions, and the weight factor is adaptively adjusted to generate two types of mutated individuals and construct a communication group between the globally optimal individual and random individuals.

Benefits of technology

It achieves improved global search capability and convergence accuracy with low time complexity, significantly enhancing the ability to solve complex engineering optimization problems, especially in practical engineering problems such as tension-compression composite beams, welded beams, and reducer design, outperforming traditional WOA and existing variant algorithms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121351871B_ABST
    Figure CN121351871B_ABST
Patent Text Reader

Abstract

This invention relates to an engineering optimization method, system, and medium based on the Whale Algorithm (WOA), belonging to the field of intelligent optimization algorithm technology. The method includes the following steps: S1: Initialize parameters and population: Set the population size, maximum number of iterations, dimension, and upper and lower bounds of variables; generate an initial population and initialize the global optimum and the current optimum; S2: Execute individual mutation strategy: Record the position of the global optimum and the position of the current iteration's optimum; S3: Execute a unified search strategy; S4: Execute a group communication strategy; S5: Determine if the current iteration count has reached the maximum number of iterations. If so, output the global optimum; otherwise, increment the current iteration count and return to step S2 to continue iteration. The algorithm proposed in this invention aims to improve the global search capability and convergence accuracy of the algorithm while maintaining a time complexity comparable to the original WOA.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an engineering optimization method, system, and medium based on the whale optimization algorithm, belonging to the field of intelligent optimization algorithm technology. Background Technology

[0002] The Whale Optimization Algorithm (WOA), proposed by Mirjalili and Lewis in 2016, is a swarm intelligence-based optimization algorithm. Its core idea is to simulate the social behaviors of humpback whales (such as prey encirclement, bubble web attacks, and random search) to iteratively search for the optimal solution. As a highly efficient global optimization tool, WOA has been widely applied in function optimization, engineering design, machine learning, and other fields. However, it still faces the following key challenges in practical applications:

[0003] 1. Inherent shortcomings of traditional WOA

[0004] Imbalance between exploration and development: Relying on the linear decrease of the convergence factor to control the switching of search modes can easily lead to insufficient exploration in the early stage or getting stuck in local optima in the later stage, resulting in low convergence accuracy.

[0005] Insufficient population diversity: Individual position updates rely excessively on the guidance of the current optimal solution, which can easily lead to "population homogenization" in high-dimensional problems and increase the risk of premature convergence.

[0006] The search strategy is too simplistic: the bubble web attack strategy relies on a single spiral trajectory, which is difficult to adapt to the search requirements of complex multi-peak functions.

[0007] To address the above problems, existing technologies mainly improve in three aspects, but these have limitations:

[0008] Adaptive parameter adjustment: Optimizing the convergence factor through nonlinear functions or chaotic mapping requires additional parameter control strategies, which increases complexity and has limited adaptability to multi-constraint problems.

[0009] Operator fusion and hybrid strategies: Introducing external operators such as genetic algorithm crossover and mutation, and particle swarm velocity update to improve diversity, but this breaks the concise WOA framework, significantly increases time complexity, and reduces real-time performance.

[0010] Structural optimization and multi-strategy collaboration: Performance can be improved by dividing the population into subgroups or switching dynamic strategies, but the design of subgroup rules and switching thresholds lacks universality and requires manual adjustment, which limits its practicality.

[0011] While existing technologies have mitigated the shortcomings of WOA to some extent through improvements in parameters, operators, or structures, a unified solution that simultaneously satisfies low complexity, high robustness, and strong convergence has not yet been developed. An improved WOA algorithm is urgently needed to address these issues and enhance the performance of engineering optimizations. Summary of the Invention

[0012] To address the problems of low convergence accuracy, imbalance between exploration and development, and insufficient population diversity in traditional WOA, this invention proposes an engineering optimization method, system, and medium based on the whale optimization algorithm, aiming to improve the algorithm's global search capability and convergence accuracy while maintaining a time complexity comparable to the original WOA.

[0013] The engineering optimization method based on the whale optimization algorithm described in this invention includes the following steps:

[0014] S1: Construct the objective function and constraints for the engineering optimization problem, and determine the design variables and their upper and lower bounds;

[0015] S2: Initialize the parameters of the improved whale optimization algorithm, including population size, maximum number of iterations, and dimension; generate the initial population and initialize the global optimum and the current optimum.

[0016] S3: Execute the individual mutation strategy: record the global best individual position and the current iteration's best individual position;

[0017] Two types of mutated individuals are generated;

[0018] S4: Implement a unified search strategy: dynamically adjust search range control parameters and expand the search range to balance exploration and development;

[0019] S5: Execute the group communication strategy: Construct a communication group between the globally optimal individual and random individuals, and update the individual positions through adaptive weights;

[0020] S6: Determine if the current iteration count has reached the maximum iteration count. If so, output the optimal design parameters corresponding to the global optimal solution. Otherwise, increment the current iteration count by 1 and return to step S3 to continue iterating.

[0021] Preferably, step S2 specifically includes the following sub-steps:

[0022] S21: Set the population size N, maximum number of iterations max, dimension F, and upper and lower bounds of variables ub and lb;

[0023] S22: The position vector is represented as x = (x1, x2, ..., x...). n ), where x is a position vector with n components, and the initialization of the boundary conditions is expressed as: X nThe position vector representing the nth individual is a column vector. The population is modeled using an N×F dimensional feature space, where N and F represent the size and dimension of the individuals, respectively. The initialization of the boundary conditions is expressed as follows:

[0024]

[0025] Rand is used to generate a random matrix with N rows and F columns.

[0026] S23: Initialize the global optimal solution. The current optimal position of the prey in the search space is considered the global optimal solution or the position closest to the target. Other individuals will update their own positions accordingly. This step is achieved through the following formula:

[0027]

[0028] Where t is the current iteration number, and D is the distance vector representing the current individual whale X. (t) Compared with the current best individual X * (t) The distances between them, A and C, are key parameters controlling the movement and randomness of the coefficient vector. Their expressions A and C can be expressed as:

[0029]

[0030] Where r is a random number in the range [0,1], parameter a is a constant that gradually decreases from 2 to 0, and the value of parameter A is in the range [-2,2].

[0031] Preferably, step S3 specifically includes the following sub-steps:

[0032] S31: Record the best individual: Save the global best position and the current iteration's best position;

[0033] S32: Generate two types of mutated individuals: The first type of mutated individual is generated by replacing a certain dimension of an individual in the population with the globally optimal value; the second type of mutated individual is generated by replacing a certain dimension of an individual in the population with the corresponding dimension of the current optimal individual. These are represented by the following formulas:

[0034]

[0035] Where i and j represent the number and dimension of individuals, respectively, c is a random number in the range [0, F], allbestpos represents the position of the global best individual, and curbestpos describes the position of the current best individual in each iteration;

[0036] S33: The execution of the mutation strategy is controlled by a probability factor, which decreases as the number of iterations increases. The relationship is defined by the following formula:

[0037]

[0038] Where R is a probability factor, and the value of R is in the range of [0,1]. The parameters x and y are constants with values ​​of -0.25 and 0.75, respectively. When the value of R is less than the threshold, the individual variation strategy will be executed; otherwise, the strategy will be ignored.

[0039] Preferably, step S4 specifically includes the following sub-steps:

[0040] S41: The convergence factor a' is dynamically adjusted using the cosine function to expand the search range, and the convergence factor b' is dynamically adjusted using the sine function to control the spiral trajectory shape.

[0041]

[0042] Wherein, the random parameter q takes values ​​in the range [2,4]; Rate is the weighting factor;

[0043] S42: Calculate the weighting factor, its mathematical expression is as follows:

[0044]

[0045] The search rate increases linearly with the iteration process, from 0 to 1; t represents the current iteration number, and max represents the maximum iteration number.

[0046] S43: By adjusting the convergence factors a' and b', the search trajectory is expanded to balance exploration and development.

[0047] Preferably, step S5 specifically includes the following sub-steps:

[0048] S51: Form a group by combining the globally optimal individual with random individuals, and then have this group communicate with the current individual. This process can be described by the following formula:

[0049]

[0050] Among them, X (t) Let X be the current position vector of the individual whale. (t+1) Let S1 and S2 be the individual whale position vectors for the next iteration, and S1 and S2 be two adaptive parameters used to adjust the weights of the group's communication strategy and balance exploration and exploitation. `rand` is a uniformly distributed random number used to perturb the iteration process. X rand(t) It is a random individual in the current iteration;

[0051] S52: Set adaptive weights: Weights S1 and S2 are defined and adaptively varied in the following formulas, with S1 ranging from [0,1] and S2 ranging from [0,2]:

[0052]

[0053] S53: The probability of using the group communication strategy is 50%, where p is a uniformly distributed random number. When the value of p exceeds 0.5, the group communication strategy will be executed. The mathematical model is as follows:

[0054]

[0055] Among them, X (t+1) Let X be the position vector of the individual whale in the next iteration. rand(t) Let X be a random individual in the current iteration. (t) Let X be the current position vector of the individual whale, and D be the distance vector representing the current position of the individual whale. (t) Compared with the current best individual X * (t) The distance between them, A is the key parameter for controlling movement and randomness in the coefficient vector, S1 and S2 are two adaptive parameters used to adjust the weight of the group communication strategy and balance exploration and exploitation, and rand is a uniformly distributed random number to perturb the iteration process;

[0056] S54: Otherwise, when the p-value does not exceed 0.5:

[0057]

[0058] Predator search is performed based on the formula above.

[0059] Preferably, it also includes time complexity analysis, specifically including the following steps:

[0060] S61: Initialization Phase: Population size is N, whale dimension is F, assuming parameter initialization time is t0, and population initialization time is F. The time complexity of the initialization phase, t1, is expressed as:

[0061]

[0062] S62: Boundary Initialization Phase: Assuming the boundary processing time for each individual in each dimension is t2, the time to calculate the fitness value of the optimal individual is represented as f(F); the time to select the optimal individual from the population is t3, and the time to replace the individual with the individual from the previous iteration is t4. The time complexity of the boundary initialization phase is:

[0063]

[0064] S63: Individual Mutation Strategy Phase: Assume the time required to determine whether the random number R satisfies the condition is t5, the time required for individual mutation is t6, and the time required to compare individual fitness values ​​is t7. The time complexity of the individual mutation phase is:

[0065]

[0066] S64: Position Update Phase: The parameter update time is t8, and the calculation of a' and b', S1 and S2 times are 4. t8, the time to generate uniformly distributed random numbers r, q, and p is 3. t9, the time to surround the prey is F t 10 The time to generate a random individual whale is t. 11 The time taken to search for prey is denoted as F. t 12 F t 13 The location update time for group communication is represented by F, and the time for updating the individual location is represented by F. t 14 ;t 11 t 12 t 13 t 14 This refers to the time required to update each dimension; the time complexity of the individual position update stage is expressed as:

[0067]

[0068] The time complexity is defined as follows:

[0069]

[0070] The initialization phase complexity is... =O(F), boundary processing order =O(F+f(F)), Individual variation stage =O(F), Position Update Phase =O(F), where F is the dimension and f(F) is the complexity of the objective function.

[0071] Preferably, the engineering optimization problem includes the design of tension-compression composite beams, welded beams, and reducers.

[0072] Preferably, the goal of the reducer design problem is to minimize weight, and the design variables include tooth width, gear module, number of pinion teeth, first shaft bearing spacing length, second shaft bearing spacing length, first shaft diameter, and second shaft diameter.

[0073] The engineering optimization system based on the whale optimization algorithm described in this invention includes:

[0074] Problem modeling module: used to construct the objective function and constraints of engineering optimization problems, and to determine the design variables and their upper and lower bounds;

[0075] Parameter initialization module: Used to initialize the core parameters of the improved whale optimization algorithm, generate the initial population and initialize the global optimum and the current optimum;

[0076] Individual mutation module: used to record the optimal individual position, generate mutated individuals, and retain individuals with better fitness;

[0077] Uniform Search Module: Used to dynamically adjust parameters to expand the search range and balance the exploration and development capabilities of the algorithm;

[0078] Group communication module: used to build a communication group and update the position of individuals through adaptive weights;

[0079] Iteration control module: Used to determine whether the number of iterations has reached the maximum value, triggering the module to execute in a loop or output the result;

[0080] The results output module is used to output the engineering design parameters corresponding to the global optimal solution.

[0081] The computer-readable storage medium of the present invention stores a computer program, which, when executed by a processor, implements the engineering optimization method based on the whale optimization algorithm.

[0082] Compared with existing technologies, the engineering optimization method, system, and medium based on the whale optimization algorithm of the present invention have the following advantages:

[0083] 1. Balance exploration and development capabilities

[0084] The unified search strategy expands the search range throughout the entire iteration process by dynamically adjusting the convergence factor and spiral parameter, thus avoiding the problem of the search range shrinking sharply in the later stages of traditional algorithms.

[0085] An adaptive weighting mechanism is adopted to enhance the guiding role of the globally optimal individual in the exploration phase (early iteration) and strengthen the diversity contribution of random individuals in the development phase (late iteration), thereby achieving a dynamic balance between exploration and development.

[0086] 2. Enhance population diversity

[0087] The individual mutation strategy effectively breaks the homogeneity of the population by generating two types of mutated individuals (replacing the globally optimal dimension and the currently iterative optimal dimension), increases the randomness and diversity of individual positions, and reduces the risk of premature convergence. It is especially suitable for high-dimensional complex optimization problems.

[0088] 3. Maintain low time complexity

[0089] The core strategy of the algorithm does not introduce any additional complex operators, and its time complexity is consistent with that of traditional WOA, which can efficiently handle large-scale engineering optimization problems.

[0090] 4. Strong applicability to engineering projects

[0091] In typical engineering problems such as tension-compression composite beam design, welded beam design, and reducer design, by balancing exploration and development and improving population diversity, the convergence accuracy is significantly improved. The optimization results are superior to traditional WOA and existing variant algorithms, and can effectively solve the multi-constraint and high-dimensional optimization needs in practical engineering. Attached Figure Description

[0092] Figure 1 A flowchart of the overall method of invention;

[0093] Figure 2 The diagram shows the search process of an intelligent agent in a two-dimensional space in the invention. In the diagram, (a) represents the search process of the whale algorithm surrounding prey after the introduction of a unified search strategy; (b) represents the search process of the whale algorithm's bubble net attack after the introduction of a unified search strategy.

[0094] Figure 3 This is a flowchart of the algorithm of the present invention;

[0095] Figure 4 The graphs show the convergence curves of the BWOA algorithm of this invention and seven existing cutting-edge algorithms on the benchmark function of the test set; (a) shows the comparison between the BWOA algorithm of this invention and the seven existing cutting-edge algorithms on the rotated high-condition elliptic function; (b) shows the comparison between the BWOA algorithm of this invention and the seven existing cutting-edge algorithms on the translation and rotation Schwefel functions; (c) shows the comparison between the BWOA algorithm of this invention and the seven existing cutting-edge algorithms on the translation and rotation Rustrygin functions; (d) shows the comparison between the BWOA algorithm of this invention and the seven existing cutting-edge algorithms on the composite function 5 (N=5) (CEC2014);

[0096] Figure 5 The graphs show the BWOA exploration and development curves of the BWOA algorithm of the present invention on the benchmark functions of the test set; (a) shows the BWOA exploration and development curves of the BWOA algorithm of the present invention on the rotated high-condition elliptic function; (b) shows the BWOA exploration and development curves of the BWOA algorithm of the present invention on the translation and rotation of the Schwefel function; (c) shows the BWOA exploration and development curves of the BWOA algorithm of the present invention on the shifted and rotated Rustrygin function; (d) shows the BWOA exploration and development curves of the BWOA algorithm of the present invention on the composite function 5 (N=5) (CEC2014).

[0097] Figure 6 This is a schematic diagram of the speed reducer design model in an embodiment of the present invention. Detailed Implementation

[0098] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0099] Example 1:

[0100] like Figure 1 As shown, the engineering optimization method based on the whale optimization algorithm of the present invention includes the following steps:

[0101] S1: Construct the objective function and constraints for the engineering problem, and determine the design variables and their upper and lower bounds;

[0102] S2: Initialize the parameters of the improved whale optimization algorithm, set the population size, maximum number of iterations, dimension and upper and lower bounds of variables, generate the initial population and initialize the global optimal solution and the current optimal solution;

[0103] (1) Population initialization

[0104] Whale populations can be modeled using an N×F dimensional feature space, where N and F represent the size and dimension of an individual, respectively. The position vector of a whale can be represented as x = (x1, x2, ..., x...). n The upper and lower bounds of the search space can be represented as ub and lb, respectively. Therefore, the initialization of the boundary conditions can be expressed as: ;X n The position vector representing the nth individual is a column vector. , is an F-dimensional vector;

[0105]

[0106] (2) Encircle the prey

[0107] The current optimal position of the prey in the search space is considered the global optimal solution or the position closest to the target, and other individuals will update their own positions accordingly. This step is achieved through formula (3):

[0108]

[0109] Where t is the current iteration number, and D is the distance vector representing the current individual whale X. (t) Compared with the current best individual X * (t) The distances between them, A and C, are key parameters controlling the movement and randomness of the coefficient vector. Their expressions A and C can be expressed as:

[0110]

[0111] Where r is a random number in the range [0,1], parameter a is a constant that gradually decreases from 2 to 0, and the value of parameter A is in the range [-2,2].

[0112] (3) Bubble Web Attack

[0113] First, calculate the shortest distance between the individual and the globally optimal search agent. Then, the whale approaches the prey's location along a spiral trajectory. The following equation mathematically describes the bubble web attack behavior:

[0114]

[0115] Where D′ represents the distance between the current individual and the global optimal solution, and X(t) represents the current position of the whale individual. The current best individual position is represented by C, the weight coefficient is represented by X(t+1), the whale individual position is represented by b, the shape parameter of the spiral trajectory (constant value) is represented by b, and l is a random number between -1 and 1.

[0116] In actual hunting, both methods will be used. During the local development phase, each method will be used with a 50% probability. The mathematical model is shown below:

[0117]

[0118] Where p is the range of random numbers [0, 1].

[0119] (4) Finding prey

[0120] During the exploration phase, WOA uses a weight parameter A with an absolute value greater than 1 to move the search agent away from the reference point. This phase updates the position using random individuals instead of the current best individual; therefore, the hunting behavior can be expressed by formulas (9) and (10):

[0121]

[0122] Xrand(t) represents a randomly selected member from the current group. D represents the distance between the random individual and the current individual, and X(t+1) represents the position of the whale individual in the next iteration. A is a control parameter.

[0123] S3: Execute the individual mutation strategy: record the global best individual position and the current iteration's best individual position; generate two types of mutated individuals;

[0124] The system generates high-quality individuals by selectively replacing the dimensions of whales, thereby improving population diversity. Specifically, in each iteration, the system records two individuals with the globally optimal fitness value and the currently optimal fitness value, which are used to generate two types of mutated individuals. The first type of mutated individual is generated by replacing a certain dimension of an individual in the population with the globally optimal value, while the second type of mutated individual is generated by replacing a certain dimension of an individual in the population with the corresponding dimension of the currently optimal individual. If the fitness value of a mutated individual is lower than that of the currently optimal individual, the mutated individual is retained; otherwise, it is discarded. This dual mutation mechanism not only enhances population diversity but also significantly improves convergence efficiency. This strategy can be specifically described by formulas (11) and (12).

[0125]

[0126] Where i and j represent the number and dimension of individuals, respectively, c is a random number in the range [0, F], allbestpos represents the position of the global best individual, and curbestpos describes the position of the current best individual in each iteration.

[0127] This strategy will be applied to the actual hunting process. In order to obtain a suitable exploration trend during the optimization process, a probability factor R is used to determine when to initiate the individual variation strategy, and its relationship can be defined by formula (13).

[0128]

[0129] In this algorithm, parameter R ranges from [0,1], and parameters x and y are constants with values ​​of -0.25 and 0.75, respectively. Specifically, when the value of R is less than a threshold, the individual mutation strategy is executed; otherwise, the strategy is ignored. Since the value of R is random and the threshold increases with the rate of change, this means that the execution probability of the individual mutation strategy has adaptive adjustment characteristics. Individual mutation is an effective method that increases population diversity and improves the efficiency of solution exploration, thereby enhancing the search efficiency and convergence accuracy of the population or individuals.

[0130] S4: Implement a unified search strategy: dynamically adjust search range control parameters and expand the search range to balance exploration and development;

[0131] Typically, dimension-based individual mutation strategies can improve the exploration efficiency of algorithms, but may lead to a narrowing of the search range in later stages. The uniform search strategy, by changing the distance and direction of the search agent's movement towards the current optimal position, effectively mitigates the drawbacks of individual mutation strategies. Parameter 'a' controls the distance and direction of the individual's movement towards the optimal position by adjusting parameter A. The value of 'a' decreases linearly from 2 to 0, which may cause the control parameter A to approach 0 in the later stages of iteration, resulting in a continuous shrinking of the search range. Parameter 'b' is a constant used to control the shape of the spiral trajectory. The value of 'b' remains unchanged until the end of the iteration, further limiting the search range of the WOA algorithm. This means that the search agent may have positioning bias or insufficient coverage, which is not conducive to discovering potential areas. Therefore, it is necessary to adjust parameters 'a' and 'b' to improve optimization performance.

[0132] The present invention uses cosine function, sine function and uniform random number, as shown in formulas (14) and (15), to construct the change mechanism of convergence factors a' and b'. Figure 2 (a) and Figure 2 Figure (b) illustrates the agent's search process after the introduction of a uniform search strategy.

[0133]

[0134] The random parameter q takes values ​​in the range [2, 4]. Rate is the weighting factor as shown in formula (16).

[0135] To improve the accuracy of the algorithm, this invention introduces a weighting factor, Rate, whose mathematical expression is as follows:

[0136]

[0137] The rate increases linearly with the iteration process, from 0 to 1; t represents the current iteration number, and max represents the maximum iteration number.

[0138] S5: Execute the group communication strategy: Construct a communication group between the globally optimal individual and random individuals, and update the individual positions through adaptive weights;

[0139] Group communication (WC) is a strategy designed to improve the diversity and information utilization efficiency of an algorithm population. Unlike individual mutation strategies, WC utilizes the location information of each group, aiming to address the drawback of individual mutation strategies leading to excessive aggregation of the population in the dominant group. The original WOA algorithm determines the probability of using an encirclement-style predation phase or a search-style predation phase by controlling the absolute value of the parameter A. This mechanism results in insufficient information transmission, imbalance between the main search phases, and consequently, insufficient solution accuracy and poor search capability.

[0140] To improve information utilization efficiency and reduce the probability of getting trapped in local optima, this invention proposes a novel group communication strategy. First, the globally optimal individual and random individuals are grouped together, and then this group communicates with the current individual. This process can be described by formula (17).

[0141]

[0142] S1 and S2 are two adaptive parameters used to adjust the weights of the group communication strategy and balance exploration and exploitation.

[0143] To improve the performance of global optimal solution search, weights S1 and S2 are defined in formulas (18)-(19) and given adaptive changes. Specifically, the range of S1 is [0,1] and the range of S2 is [0,2].

[0144]

[0145] During the exploration phase, the probability of employing a swarm communication strategy is 50%. When the p-value exceeds 0.5, the swarm communication strategy will be executed according to formulas (17)-(19); otherwise, predator-prey search will be conducted according to formulas (9)-(10). This strategy significantly improves the accuracy of understanding while maintaining its original advantages, and also optimizes information utilization efficiency and accelerates the convergence speed. The mathematical model is shown below:

[0146]

[0147] S6: Determine if the current iteration count has reached the maximum iteration count. If so, output the global optimal solution; otherwise, increment the current iteration count by 1 and return to step S3 to continue iterating.

[0148] like Figure 3 As shown, the specific process of the BWOA algorithm of this invention is as follows;

[0149] Initialize the population, introduce constraints and optimization functions, and set the group size, maximum number of iterations (max), dimension (F), and upper and lower bounds (lb and ub).

[0150] The search agent is initialized with the global optimal solution Xallbest, which is the optimal solution Xcurbest obtained in each iteration;

[0151] Update the parameter rate using formula (13) and determine whether R satisfies formula (13);

[0152] If X is updated using formulas (11) and (12) i With X c ;

[0153] Compare X iIs the fitness value greater than X? c fitness value;

[0154] If so, the mutated individual X c Replace X i Update the current best individual;

[0155] If X i The fitness value is less than X c The fitness value is used to maintain the current best individual;

[0156] Update parameters a' and b' using formulas (14) and (15);

[0157] Update parameters S1 and S2 using formulas (18) and (19);

[0158] If r < 0.5, and if |A| < 1, then update the search agent using formulas (2) and (3);

[0159] If |A|≥1, p<0.5, update the search agent using formulas (9) and (10);

[0160] Otherwise, update the search agent using formula (17);

[0161] If r > 0.5, then update the search agent using formulas (6) and (7);

[0162] The number of iterations t = t + 1;

[0163] Finish.

[0164] Example 2:

[0165] Based on Example 1, time complexity analysis is also included, specifically comprising the following steps:

[0166] S61: Initialization Phase: Population size is N, and the dimension of the whale is F. Assume the parameter initialization time is t0, and the population initialization time in formula (1) is F. The time complexity of the initialization phase, t1, is expressed as:

[0167]

[0168] S62: Boundary Initialization Phase: Assuming the boundary processing time for each individual in each dimension is t2, the time to calculate the fitness value of the optimal individual is represented as f(F); the time to select the optimal individual from the population is t3, and the time to replace the individual with the individual from the previous iteration is t4. The time complexity of the boundary initialization phase is:

[0169] (twenty two)

[0170] S63: Individual Mutation Strategy Phase: Assume the time required to determine whether the random number R satisfies the condition is t5, the time required for individual mutation is t6, and the time required to compare individual fitness values ​​is t7. The time complexity of the individual mutation phase is:

[0171] (twenty three)

[0172] S64: Position Update Phase: The parameter update time is t8, and the calculation of a' and b', S1 and S2 times are 4. t8, the time to generate uniformly distributed random numbers r, q, and p is 3. t9, the time F is the time to surround the prey by formula (3). t 10 The time to generate a random individual whale is t. 11 The time for searching prey, expressed in equation (10), is F. t 12 F t 13 The location update time of group communication is expressed in equation (17), and the time representation of updating individual locations is expressed in equation (7) as F. t 14 Here, t 11 t 12 t 13 t 14 This refers to the time required to update each dimension. The time complexity of the individual position update phase is expressed as:

[0173] (twenty four)

[0174] The time complexity is derived by combining formulas (21)-(24), and is defined as follows:

[0175]

[0176] The initialization phase complexity is... =O(F), boundary processing order =O(F+f(F)), Individual variation stage =O(F), Position Update Phase =O(F), where F is the dimension and f(F) is the complexity of the objective function.

[0177] Time complexity is an important metric for evaluating the efficiency of an algorithm and a key tool for measuring its performance. Population size, individual dimension, and the model's objective function collectively determine the algorithm's time complexity.

[0178] To verify the superiority of the BWOA algorithm of this invention, it is compared with seven existing cutting-edge algorithms (including EX-GWO, I-GWO, WEMFO, GCHHO, R-TSA, NCHHO and TMGWO) in the past three years. EX-GWO: Enhanced Grey Wolf Optimizer; I-GWO: Improved Grey Wolf Optimizer; WEMFO: Weighted Elite Moth-Flame Optimization; GCHHO: Gaussian Chaos Harris Hawks Optimization; R-TSA: Revised Tuna Swarm Algorithm; NCHHO: Novel Chaos Harris Hawks Optimization; TMGWO: Tent Map-based Grey Wolf Optimizer; Experimental parameters were set as follows: population size N = 30, search space dimension F = 30, and maximum number of iterations max = 300,000.

[0179] F1 is a unimodal function, F9 and F13 are multimodal functions, and F27 is a composite function.

[0180] Table 1. Specification of Benchmark Functions for Test Set

[0181]

[0182] Figure 4 (a) Figure 4 (b) Figure 4 (c) Figure 4 Figure (d) shows the convergence curves of the BWOA algorithm of this invention and seven existing cutting-edge algorithms on the benchmark functions of the test set. For the four benchmark functions F1, F9, F13, and F27, the BWOA algorithm of this invention reaches the final value quickly with the fastest convergence speed and the smallest deviation of the generated value. For the F9 function, when other similar algorithms get stuck in local optimization too early, the BWOA algorithm of this invention can still continue to explore and find a better solution. As for the F27 function, although the BWOA algorithm of this invention converges more slowly in the initial exploration stage, it not only reaches a better solution in the subsequent exploration stage, but also has the smallest deviation.

[0183] Experimental analysis shows that the BWOA algorithm of this invention, as an outstanding optimization algorithm, not only makes up for the shortcomings of the original WOA algorithm in terms of convergence speed and accuracy, but also retains its core advantages. By introducing a uniform search strategy, an individual mutation strategy, and a group communication strategy, this algorithm exhibits superior performance and can effectively solve complex problems.

[0184] The gradual introduction of new strategies will inevitably affect the proportion and balance of the two key stages (exploration and development stages) of the WOA algorithm. Therefore, this embodiment performs a balance analysis on these two stages of the BWOA algorithm of this invention and compares it with the original WOA algorithm. Figure 5 The diagram shows the exploration curve and development curve of the BWOA algorithm of this invention on the benchmark function of the test set; the high value of the exploration curve reflects the stable exploration behavior of the algorithm at this stage, while the development curve records the development behavior of the algorithm at this stage.

[0185] In this embodiment, benchmark functions F1, F9, F13, and F27 were selected, covering unimodal, multimodal, and composite functions. For unimodal and multimodal functions, the algorithm needs to strengthen the development strategy in the initial stage to achieve a better convergence speed. Over-exploration can hinder the algorithm's convergence process. Experimental data show that the BWOA algorithm of this invention significantly improves the execution efficiency of the development strategy in the early stages of these functions. For mixed and composite functions, the development and exploration strategies need to maintain a dynamic balance, and it is recommended to focus on optimizing the exploration strategy in the later stages of iteration.

[0186] like Figure 5 (a) Figure 5 (b) Figure 5 (c) Figure 5 As shown in Figure (d), the average exploration and development phases of the Balanced Whale Optimization Algorithm (BWOA) of this invention are 47.114% / 52.885%, 51.623% / 48.377%, 47.917% / 52.083%, and 49.784% / 50.215%, respectively. These results demonstrate that the exploration / development phases of the BWOA algorithm of this invention are more reliable and balanced. Whether dealing with unimodal, multimodal, or composite functions, the BWOA algorithm of this invention effectively improves algorithm performance and search efficiency while maintaining a good balance between exploration and development. Therefore, it can be concluded that the BWOA algorithm of this invention possesses a superior and balanced exploration and development mechanism.

[0187] The performance of the method of this invention in solving engineering optimization problems was verified. The benchmark tests used included tension-compression bar design (TCSD), welded beam design (WBD), and speed reducer design (SRD) problems, and solutions were obtained under different constraints.

[0188] Tension-Compression Bar Design (TCSD)

[0189] In the benchmarking of this project, engineers focused on minimizing the weight of the high-efficiency tension / compression spring. This weight is controlled by three variables: the spring diameter d, the average coil diameter D, and the number of coils N. The mathematical model for the tension-compression spring design problem can be expressed as follows:

[0190]

[0191] Where: x1=d: spring diameter; x2=D: average coil diameter; x3=N: number of coils;

[0192] The goal is to minimize the total weight of the spring, expressed mathematically as:

[0193]

[0194] Four constraints ensure that the spring meets the performance requirements (in order: stiffness constraint, stress constraint, stability constraint, and size limit), and all constraints must be satisfied. ≤0:

[0195]

[0196]

[0197]

[0198]

[0199] The range of variables is obtained, and the boundary values ​​of each variable correspond to the actual constraints of the project:

[0200] ;

[0201] Table 2 shows the minimum weight results of the BWOA algorithm compared with other algorithms (including SSA, PSO, RDOOA, GSA, GA, RO, DE, and the improved harmony search algorithm) under the same penalty function and constraints for solving the TCSD problem. The data shows that the BWOA algorithm of this invention achieves a better minimum weight (0.012087462) than other algorithms, fully demonstrating its advantages in solving engineering problems.

[0202] Table 2 compares the results of different algorithms for solving the TCSD problem.

[0203]

[0204] Welded beam design (WBD)

[0205] In this model, the engineer's goal is to achieve the lowest manufacturing cost for the WBD (Working Data Environment) through optimization. The WBD problem involves four variables and seven constraints. These constraints limit the optimizer's pursuit of the lowest cost during the design process. The model can be expressed as:

[0206]

[0207] in, =h: Vertical height of the beam; = : Length of the horizontal section of the beam; =t: the thickness of the beam; =b: the width of the beam;

[0208] The goal is to minimize manufacturing costs:

[0209]

[0210] Based on seven constraints (shear stress constraint, bending stress constraint, deflection constraint, dimensional relationship constraint, buckling load constraint, minimum height constraint, and cost constraint), ensure that the beam meets the strength, stability, and dimensional constraints. All constraints must be satisfied. ≤0:

[0211]

[0212]

[0213]

[0214]

[0215] in, Here is the formula for shear stress, where R is the characteristic radius of the cross section and M is the total bending moment; P is the polar moment of inertia; P is the load; L is the beam span.

[0216]

[0217]

[0218] in, Bending stress formula This represents the maximum allowable value for the material.

[0219]

[0220]

[0221] in, The deflection constraint formula is as follows: This represents the maximum permissible deflection value.

[0222]

[0223]

[0224]

[0225] in, Here is the buckling load formula; E is the elastic modulus, and G is the shear modulus;

[0226]

[0227]

[0228] The range of variables is the feasible boundary of the project for each variable:

[0229] ;

[0230] This embodiment employs the proposed BWOA algorithm, along with Robert's algorithm (RO), improved hybrid strategy (IHS), genetic algorithm (GA), co-evolutionary particle swarm optimization (CPSO), and water cycle algorithm (WCA), to jointly solve the welded beam design problem with the same constraints. As shown in Table 3, the BWOA algorithm has the lowest optimal cost (1.724810), outperforming the other algorithms, indicating that its performance is superior and it can be preferentially applied to this engineering problem.

[0231] Table 3 shows the comparison results of different algorithms on the WBD problem.

[0232]

[0233] Speed ​​Reducer Design (SRD)

[0234] The SRD problem is widely used in mechanical systems. This optimization problem aims to minimize the weight of a reducer under 11 constraints. For example... Figure 6 As shown, the reducer contains seven variables: tooth width Gear module Number of teeth on the pinion First shaft bearing spacing length Second shaft bearing spacing length First axis diameter Second axis diameter The problem can be described as follows:

[0235]

[0236] The goal is to minimize the total weight of the reducer:

[0237]

[0238] Based on 11 constraints (in order: tooth surface contact strength constraint, tooth root bending strength constraint, first shaft deflection constraint, second shaft deflection constraint, first shaft stress constraint, second shaft stress constraint, module-to-tooth ratio constraint, tooth width-to-module ratio constraint, tooth width-to-module upper limit constraint, first shaft diameter-to-pitch constraint, second shaft diameter-to-pitch constraint), ensure that the reducer meets the engineering requirements for strength, stiffness, and dimensional proportions.

[0239]

[0240]

[0241]

[0242]

[0243]

[0244]

[0245]

[0246]

[0247]

[0248]

[0249]

[0250] Obtain the range of variables:

[0251] ;

[0252] ;

[0253] In this embodiment, the BWOA algorithm of this invention, along with seven other algorithms including Genetic Algorithm (GA), Sine-Cosine Algorithm (SCA), Spotted Hyena Optimizer (SHO), GWO, PSO, Multiverse Optimizer (MVO), and GSA, jointly addressed the SRD problem and obtained the final result under the same penalty function and constraints. As shown in Table 4, the BWOA algorithm proposed in this invention achieved the lowest optimal cost (2994.472), which not only demonstrates the superiority of the BWOA algorithm in solving this engineering problem but also verifies that, compared to other mature methods, the BWOA algorithm proposed in this invention has stronger performance in practical engineering applications.

[0254] Table 4 compares the results of different algorithms for solving the SRD problem.

[0255]

[0256] In summary, the BWOA algorithm of this invention can effectively solve these three engineering design challenges. The optimization value search results demonstrate that the algorithm performs excellently in optimizing practical problems, further validating its effectiveness in solving constrained problems. By enhancing the exploration capability of the original algorithm, the BWOA algorithm of this invention significantly improves the overall optimization performance.

[0257] Example 3:

[0258] The engineering optimization system based on the whale optimization algorithm described in this invention includes:

[0259] Problem modeling module: used to construct the objective function and constraints of engineering optimization problems, and to determine the design variables and their upper and lower bounds;

[0260] Parameter initialization module: Used to initialize the core parameters of the improved whale optimization algorithm, generate the initial population and initialize the global optimum and the current optimum;

[0261] Individual mutation module: used to record the optimal individual position, generate mutated individuals, and retain individuals with better fitness;

[0262] Uniform Search Module: Used to dynamically adjust parameters to expand the search range and balance the exploration and development capabilities of the algorithm;

[0263] Group communication module: used to build a communication group and update the position of individuals through adaptive weights;

[0264] Iteration control module: Used to determine whether the number of iterations has reached the maximum value, triggering the module to execute in a loop or output the result;

[0265] The results output module is used to output the engineering design parameters corresponding to the global optimal solution.

[0266] Example 4:

[0267] The computer-readable storage medium of the present invention stores a computer program, which, when executed by a processor, implements the engineering optimization method based on the whale optimization algorithm described in Embodiment 1.

[0268] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. An engineering optimization method based on the whale optimization algorithm, characterized in that, Includes the following steps: S1: Construct the objective function and constraints of the engineering optimization problem, and determine the design variables and their upper and lower bounds; the engineering optimization problem is a reducer design problem, the objective of the reducer design problem is to minimize the weight, and the design variables include tooth surface width, gear module, pinion teeth number, first shaft bearing spacing length, second shaft bearing spacing length, first shaft diameter and second shaft diameter; S2: Initialize the parameters of the improved whale optimization algorithm, including population size, maximum number of iterations, and dimension; generate the initial population and initialize the global optimum and the current optimum. S3: Execute the individual mutation strategy: record the global best individual position and the current iteration's best individual position; Two types of mutated individuals are generated; S4: Implement a unified search strategy: dynamically adjust search range control parameters and expand the search range to balance exploration and development; S5: Execute the group communication strategy: Construct a communication group between the globally optimal individual and random individuals, and update the individual positions through adaptive weights; S6: Determine whether the current iteration count has reached the maximum iteration count. If so, output the optimal design parameters corresponding to the global optimal solution. Otherwise, increment the current iteration count by 1 and return to step S3 to continue iterating. Step S2 specifically includes the following sub-steps: S21: Set the population size N, maximum number of iterations max, dimension F, and upper and lower bounds of variables ub and lb; S22: The position vector is represented as x = (x1, x2, ..., x...). n ), where x is a position vector with n components, and the initialization of the boundary conditions is expressed as: X n The position vector representing the nth individual is a column vector. The population is modeled using an N×F dimensional feature space, where N and F represent the size and dimension of the individuals, respectively. The initialization of the boundary conditions is expressed as follows: Rand is used to generate a random matrix with N rows and F columns. S23: Initialize the global optimal solution. The current optimal position of the prey in the search space is considered the global optimal solution or the position closest to the target. Other individuals will update their own positions accordingly. This step is achieved through the following formula: Where t is the current iteration number, and D is the distance vector representing the current individual whale X. (t) Compared with the current best individual X (t) The distances between them, A and C, are key parameters controlling the movement and randomness of the coefficient vector. Their expressions A and C can be expressed as: Where r is a random number in the range [0,1], parameter a is a constant that gradually decreases from 2 to 0, and the value of parameter A is in the range [-2,2]. Step S3 specifically includes the following sub-steps: S31: Record the best individual: Save the global best position and the current iteration's best position; S32: Generate two types of mutated individuals: The first type of mutated individual is generated by replacing a certain dimension of an individual in the population with the globally optimal value; the second type of mutated individual is generated by replacing a certain dimension of an individual in the population with the corresponding dimension of the current optimal individual. These are represented by the following formulas: Where i and j represent the number and dimension of individuals, respectively, c is a random number in the range [0, F], allbestpos represents the position of the global best individual, and curbestpos describes the position of the current best individual in each iteration; S33: The execution of the mutation strategy is controlled by a probability factor, which decreases as the number of iterations increases. The relationship is defined by the following formula: Where R is a probability factor, and the value of R ranges from [0,1]. R is a weighting factor, with parameters x and y being constants, and their values ​​being -0.25 and 0.75, respectively. When the R value is less than the threshold, the individual variation strategy will be executed; otherwise, the strategy will be ignored.

2. The engineering optimization method based on the whale optimization algorithm according to claim 1, characterized in that, Step S4 specifically includes the following sub-steps: S41: The convergence factor a' is dynamically adjusted using the cosine function to expand the search range, and the convergence factor b' is dynamically adjusted using the sine function to control the spiral trajectory shape. Wherein, the random parameter q takes values ​​in the range [2,4]; Rate is the weighting factor; S42: Calculate the weighting factor, its mathematical expression is as follows: The search rate increases linearly with the iteration process, from 0 to 1; t represents the current iteration number, and max represents the maximum iteration number. S43: By adjusting the convergence factors a' and b', the search trajectory is expanded to balance exploration and development.

3. The engineering optimization method based on the whale optimization algorithm according to claim 2, characterized in that, Step S5 specifically includes the following sub-steps: S51: Form a group by combining the globally optimal individual with random individuals, and then have this group communicate with the current individual. This process can be described by the following formula: Among them, X (t) Let X be the current position vector of the individual whale. (t+1) Let S1 and S2 be the individual whale position vectors for the next iteration, and S1 and S2 be two adaptive parameters used to adjust the weights of the group's communication strategy and balance exploration and exploitation. `rand` is a uniformly distributed random number used to perturb the iteration process. X rand(t) It is a random individual in the current iteration; S52: Set adaptive weights: Weights S1 and S2 are defined and adaptively varied in the following formulas, with S1 ranging from [0,1] and S2 ranging from [0,2]: S53: The probability of using the group communication strategy is 50%, where p is a uniformly distributed random number. When the value of p exceeds 0.5, the group communication strategy will be executed. The mathematical model is shown below: Among them, X (t+1) Let X be the position vector of the individual whale in the next iteration. rand(t) Let X be a random individual in the current iteration. (t) Let X be the current position vector of the individual whale, and D be the distance vector representing the current position of the individual whale. (t) Compared with the current best individual X (t) The distance between them, A is the key parameter for controlling movement and randomness in the coefficient vector, S1 and S2 are two adaptive parameters used to adjust the weight of the group communication strategy and balance exploration and exploitation, and rand is a uniformly distributed random number to perturb the iteration process; S54: Otherwise, when the p-value does not exceed 0.5: Predator search is performed based on the above formula.

4. The engineering optimization method based on the whale optimization algorithm according to claim 3, characterized in that, It also includes time complexity analysis, specifically the following steps: S61: Initialization Phase: Population size is N, whale dimension is F, assuming parameter initialization time is t0, and population initialization time is F. The time complexity of the initialization phase, t1, is expressed as: S62: Boundary Initialization Phase: Assuming the boundary processing time for each individual in each dimension is t2, the time to calculate the fitness value of the optimal individual is represented as f(F); the time to select the optimal individual from the population is t3, and the time to replace the individual with the individual from the previous iteration is t4. The time complexity of the boundary initialization phase is: S63: Individual Mutation Strategy Phase: Assume the time required to determine whether the random number R satisfies the condition is t5, the time required for individual mutation is t6, and the time required to compare individual fitness values ​​is t7. The time complexity of the individual mutation phase is: S64: Position Update Phase: The time for updating parameters is t8, and the time for calculating a', b', S1, and S2 is 4. t8, the time to generate uniformly distributed random numbers r, q, and p is 3. t9, the time to surround the prey is F t 10 The time to generate a random individual whale is t. 11 The time taken to search for prey is denoted as F. t 12 F t 13 The location update time represents the group communication location update time, and the time to update the individual location is represented by F. t 14 ;t 11 t 12 t 13 t 14 This refers to the time required to update each dimension; the time complexity of the individual position update stage is expressed as: The time complexity is defined as follows: The initialization phase complexity is... =O(F), boundary processing order =O(F+f(F)), Individual variation stage =O(F), position update phase =O(F), where F is the dimension and f(F) is the complexity of the objective function.

5. An engineering optimization system based on the whale optimization algorithm, employing the engineering optimization method based on the whale optimization algorithm as described in any one of claims 1-4, characterized in that, include: Problem modeling module: used to construct the objective function and constraints of engineering optimization problems, and to determine the design variables and their upper and lower bounds; Parameter initialization module: Used to initialize the core parameters of the improved whale optimization algorithm, generate the initial population and initialize the global optimum and the current optimum; Individual mutation module: used to record the optimal individual position, generate mutated individuals, and retain individuals with better fitness; Uniform Search Module: Used to dynamically adjust parameters to expand the search range and balance the exploration and development capabilities of the algorithm; Group communication module: used to build a communication group and update the position of individuals through adaptive weights; Iteration control module: Used to determine whether the number of iterations has reached the maximum value, triggering the module to execute in a loop or output the result; The results output module is used to output the engineering design parameters corresponding to the global optimal solution.

6. A computer-readable storage medium storing a computer program, characterized in that, When the program is executed by the processor, it implements the engineering optimization method based on the whale optimization algorithm as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Unmanned aerial vehicle three-dimensional path planning method based on improved whale optimization algorithm

    CN118915810A

  • Robot constant-force grinding optimization method and apparatus, and electronic device

    WO2025227627A1