Hybrid level enhanced random algorithm based on double-loop optimization and cross-platform implementation method thereof

By using a hybrid-level enhanced stochastic algorithm based on dual-cycle optimization, combined with adaptive perturbation and combined constraint control, the problems of local optima and cross-platform deployment in multi-factor hybrid-level experimental design are solved, realizing efficient and flexible experimental design and cross-platform operation.

CN121637823APending Publication Date: 2026-03-10BEIJING UNIV OF CIVIL ENG & ARCHITECTURE

Patent Information

Application Number
CN202511836211.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-08
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

Existing technologies for multi-factor mixed-level experimental design suffer from a lack of universal construction methods, a tendency to get trapped in local optima, and difficulty in cross-platform deployment. Traditional algorithms struggle to achieve good uniformity and spatial coverage when dealing with unequal numbers of factor levels, complex constraints, or large sample sizes.

Method used

A hybrid-level enhanced stochastic algorithm based on dual-loop optimization is proposed, which combines inner and outer loop structures, adaptive perturbation strategy and acceptance criterion, embeds factor-level combination constraint control module, and is packaged into a cross-platform JAR package by MATLAB Compiler SDK, supporting operation on Windows, macOS, Linux and CentOS.

Benefits of technology

It achieves a balance between global search capability and local optimization efficiency in multi-factor mixed-level experimental design, possesses good versatility and cross-platform deployment capability, significantly improves the flexibility and adaptability of the design, and outperforms traditional algorithms under various evaluation criteria.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121637823A_ABST
    Figure CN121637823A_ABST
Patent Text Reader

Abstract

The invention provides a hybrid level enhanced random algorithm based on double-loop optimization and a cross-platform implementation method thereof, and belongs to the technical field of modeling and parameter, and the method comprises the following steps: S1, initialization; s2, setting algorithm parameters; s3, executing internal circulation, and executing local search under a fixed threshold value; s4, judging constraint conditions; when there is no constraint condition, generating a candidate solution; s5, calculating a target function value; s6, judging updating of the matrix according to the target function value; s7, returning to an outer loop, and adjusting a threshold value Th according to the frequency for receiving the new design and the number of iterations; s8, after M iterations are completed, the acceptance rate and the improvement rate are calculated; s9, updating the threshold value Th; and S10, judging a condition for stopping iteration. According to the method, the problems that a general construction method is lacked, local optimum is easy to sink and cross-platform deployment is difficult to realize in a multi-factor mixing level test design are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of modeling and parameter technology, specifically relating to a hybrid level-enhanced stochastic algorithm based on double-loop optimization and its cross-platform implementation method. Background Technology

[0002] With the deepening research into modeling and parameter optimization of complex systems, multi-factor mixed-level experimental design has demonstrated significant value in modeling, simulation, algorithm verification, and data acquisition across various fields. Compared to single-factor or equal-level experimental designs, the number of levels for each factor in mixed-level experiments may vary significantly, resulting in a highly asymmetric and discretized design space. While traditional orthogonal and uniform design methods possess strong structure and lookup table characteristics when dealing with equal-level factor problems, they struggle to achieve experimental schemes with good uniformity and spatial coverage when faced with unequal numbers of factor levels, complex constraints, or large sample size requirements, relying solely on existing table constructions or simple heuristic strategies. These scenarios place higher demands on the flexibility, adaptability, and computational efficiency of experimental design algorithms, and also expose the limitations of traditional methods in practical applications.

[0003] To address the problems of "scarcity of feasible solutions," "weak global search capability," and "prone to getting trapped in local optima" in mixed-level experimental design, researchers have proposed a variety of iterative search algorithms. For example, the column-level pairwise swap algorithm (CP) optimizes locally by swapping the positions of two levels in a single column, is suitable for a single optimality criterion, but is prone to getting trapped in local optima; the simulated annealing algorithm (SA) uses a temperature-acceptance criterion to control global search and local convergence, but its temperature cooling plan parameters are cumbersome to adjust and its efficiency is low; Particle swarm optimization (PSO) is based on group cooperative search, and information sharing improves the convergence speed, but it has high computational overhead and is prone to premature convergence in high-dimensional or complex constraint scenarios; and the stochastic evolutionary algorithm (SE) combines genetic ideas with a threshold acceptance mechanism, which has a faster convergence speed than SA, but is sensitive to the initial threshold and adjustment strategy.

[0004] While the aforementioned methods improve the quality and efficiency of experimental design to some extent, they struggle to simultaneously address requirements such as global search capability, local optimization efficiency, multi-objective criterion adaptation, and complex constraints (e.g., combinations of forced / exclusionary factors). Therefore, there is an urgent need for a general, efficient, and flexibly configurable hybrid-level experimental design algorithm and its cross-platform implementation to solve these problems. Summary of the Invention

[0005] To achieve the above objectives, this invention provides a hybrid level-enhanced stochastic algorithm based on bicyclic optimization, comprising the following steps: S1: Initialization; S2: Set algorithm parameters; S3: Execute the inner loop and perform a local search under a fixed threshold; S4: Determine the constraints; When there are no constraints, candidate solutions are generated; S5: Calculate the objective function value; S6: Determine the matrix update based on the objective function value; S7: Return to the outer loop and adjust the threshold T based on the frequency of accepting new designs and the number of iterations. h ; S8: After completing M iterations, calculate the acceptance rate and improvement rate; S9: Update threshold T h ; S10: Determine the condition for stopping the iteration.

[0006] Furthermore, in step S4, when determining the constraints, the specific steps include the following: S411: Define the constraint structure after selecting the result of the column element swapping or horizontal jump mechanism with a 50% probability; S412: Input a list of constraints, each constraint containing: parent factor index jf, parent factor level Ljf, child factor index jc, child factor allowed level set Sjc, and constraint type type∈{0,1,2}; S413: Obtain the K-pair parent-child factor relationship table; S414: Determine the constraint type; When type=0, combination is prohibited; When type=1, it is a forced combination; When type=2, it is a restricted combination; S415: For each constrained solution, generate a new candidate solution and recalculate the objective function value.

[0007] Furthermore, the prohibited combinations are as follows: when the parent factor takes a specific value, some levels of the child factor are illegal, and the system will automatically replace them with legal levels; The forced combination: specifies that certain experimental points must strictly adopt a specific combination of factor levels. Specifically, the function constructs a design row that satisfies the combination conditions according to each constraint and inserts it at the top of the matrix, while keeping the other structures of the original design unchanged. The restricted combination is as follows: when the parent factor is a specified level, the child factor is only allowed to be selected from a set of candidate levels.

[0008] Furthermore, step S5, calculating the objective function value, specifically includes the following: Calculate the objective function increment Δf and evaluate the criterion value.

[0009] Furthermore, in step S6, the specific steps for updating the matrix based on the objective function value are as follows: S611: According to the acceptance criterion P of the simulated degradation algorithm accept =max(1-Δf / T h , 0), determine whether to accept the new design; When Δf≤0, it indicates that Xtry is better than the current design X, so the replacement X is accepted, and the current optimal design and the corresponding objective function criterion value are updated; S612: In step S611, when determining whether to accept the new design, if Δf > 0, then the uniform random number U (following a uniform distribution in the interval (0,1)) satisfies U ≥ Δf / T. h When that happens, accept the current inferior solution Xtry; When U < Δf / T h If so, then the inferior solution Xtry is rejected.

[0010] Furthermore, the conditions for stopping the iteration in S10 specifically include the following: When the maximum number of outer loops E or T is reached h When the threshold is less than the preset lower limit, the iteration stops, and the current optimal design matrix X is output. best and the corresponding maximum and minimum distances mindX best Its objective function value; When the maximum number of outer loops E and T has not been reached h >When the preset lower limit is reached, return to step S3 to continue the next round of inner loop.

[0011] A cross-platform implementation method based on double loop optimization includes the following steps: M1: Package the hybrid level-enhanced stochastic algorithm based on double-loop optimization in MATLAB R2024a, compile the core algorithm functions using MATLAB CompilerSDK, and generate a JAR file that can be called in Java; M2: Import the generated JAR file and the "javabuilder.jar" that comes with Matlab R2024a into the Java project. The Java program accesses the algorithm function by calling the JAR file generated by MATLAB, loads the algorithm function using Java native methods, and runs it successfully. M3: Packages the code that can successfully call the JAR file together with the javabuilder.jar file to generate a new cross-platform JAR file, so that it can run on different operating systems later; M4: Each target platform requires the installation of the MCR R2024a version software corresponding to the compiled version; When a Java application calls an algorithm function in a Jar package, MCR is responsible for executing the code on the operating system, ensuring that the MATLAB function can run, and for the corresponding JDK 1.8 version for different platforms; M5: On each platform, a compatible Java runtime environment and the corresponding version of MATLAB Runtime need to be installed in advance; M6: Final test JAR package, to determine the normal operation result; In the terminal, type `java -jar_package_name.jar`. If the output is successful, the program has run successfully. If this fails, it indicates an error in checking environment variables or path configuration.

[0012] The advantages of this invention are: In view of the practical problems existing in multi-factor mixed-level test design, such as "lack of general construction method, easy to get trapped in local optimum" and "difficult to achieve cross-platform deployment", this invention proposes and implements a mixed-level test optimization algorithm that supports combined constraints and cross-system operation.

[0013] This algorithm is based on Enhanced Stochastic Evolution (ESE), which introduces an inner and outer double loop structure, an adaptive perturbation strategy, and an acceptance criterion to improve convergence efficiency while ensuring global search capability. At the same time, by embedding a factor-level combination constraint control module, it can flexibly handle factor dependencies that are common in engineering practice, such as forced combination, prohibited combination, and restricted combination.

[0014] The core of the algorithm is implemented in MATLAB and encapsulated into a Java-callable JAR package component using the MATLAB Compiler SDK. Combined with the MATLAB Runtime, it can be deployed on mainstream operating systems such as Windows, macOS, Linux, and CentOS, demonstrating good versatility and practical scalability. Experimental results show that this invention outperforms existing algorithms under various evaluation criteria, exhibiting strong applicability, stability, and cross-platform deployment advantages.

[0015] The present invention will now be described in detail with reference to the accompanying drawings and embodiments. Attached Figure Description

[0016] Figure 1 This is the flowchart of the ESE algorithm.

[0017] Figure 2 This is a flowchart of the constraint mechanism.

[0018] Figure 3This is a diagram showing that the AR package file has successfully run in the CentOS environment.

[0019] Figure 4 This is a diagram showing that a JAR file has been successfully run in a Docker container. Detailed Implementation

[0020] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the specific implementation methods, structural features and effects of the present invention are described in detail below with reference to the accompanying drawings and embodiments.

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] In the description of this invention, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "aligned", "overlapping", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0023] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature; in the description of this invention, unless otherwise stated, "a plurality of" means two or more.

[0024] Example 1

[0025] This embodiment provides, for example Figures 1-4 The hybrid level-enhanced stochastic algorithm based on bicyclic optimization, as shown, includes the following steps: S1: Initialization, generate an n×m initial Latin hypercube design matrix X0, convert X0 into midpoint form mX0, and calculate the maximum and minimum distances of the initial design, disto; Where n is the number of trials and m is the number of factors; S2: Set algorithm parameters, determine the maximum number of iterations (number of exchanges) E, and set the initial threshold (temperature) T. 0, It can be represented as , And the number of swaps M and the number of candidate solutions J in each iteration; S3: Execute the inner loop, perform local search under a fixed threshold, perform M iterations of optimization, and the algorithm traverses the columns of the design matrix in turn to generate perturbation patterns in the columns of the current design X. S4: Determine the constraints; When there are no constraints, candidate solutions are generated; S5: Calculate the objective function value; S6: Determine the matrix update based on the objective function value; S7: Return to the outer loop and adjust the threshold (temperature) T based on the frequency of accepting new designs and the number of iterations. h ; S8: After completing M iterations, calculate the acceptance rate and improvement rate to determine whether the criterion has been improved after one cycle (one inner loop), which can be expressed as: , ; If n imp If the value is greater than 0, the search process becomes an improvement process (flag). imp =1); otherwise, the search process switches to the exploration process (flag). imp =0); S9: Update threshold T h The value is used to control the optimization process, so that the algorithm can escape local optimal design, and the maximum number of iterations is used as the stopping criterion; S10: Determine the condition for stopping the iteration.

[0026] Furthermore, in step S4, when determining the constraints, the specific steps include the following: S411: Define the constraint structure after selecting the result of the column element swapping or horizontal jump mechanism with a 50% probability; S412: Input a list of constraints, each constraint containing: parent factor index jf, parent factor level Ljf, child factor index jc, child factor allowed level set Sjc, and constraint type type∈{0,1,2}; S413: Obtain the K-pair parent-child factor relationship table; S414: Determine the constraint type; When type=0, combination is prohibited; When type=1, it is a forced combination; When type=2, it is a restricted combination; S415: For each constrained solution, generate a new candidate solution and recalculate the objective function value.

[0027] This invention improves the algorithm described above by introducing factor-level combination constraints and a prohibited combination mechanism, thereby enhancing the flexibility and adaptability of the design algorithm and enabling it to maximize the effectiveness of the design while satisfying specific constraints.

[0028] The improved algorithm flow is as follows Figure 2 As shown, specifically, the constraint mechanism is based on the conditional relationship between the parent factor and the child factor, supporting three types of constraints: (1) Prohibited Combinations (type=0): When the parent factor takes a specific value, some levels of the child factor are illegal, and the system will automatically replace them with legal levels; (2) Forced combination (type=1): Specifies that certain experimental points must strictly adopt specific combinations of factor levels; (3) Restricted Combinations (type=2): When the parent factor is a specified level, the child factor is only allowed to be selected from a set of candidate levels; For prohibited combination constraints, the function iterates through all illegal parent-child factor pairs in the design matrix and replaces the illegal levels of the child factors with other allowed levels, thereby avoiding logical conflicts or invalid test points in the design. For forced combination constraints, the function forcibly inserts all specified "parent factor-child factor" level combinations into the first few rows of the design matrix, thereby ensuring that these key combinations are strictly preserved in the design and placed in a prominent position (e.g., for priority observation during analysis). Specifically, the function constructs a design row that satisfies the combination conditions based on each constraint and inserts it at the top of the matrix, while keeping the rest of the original design structure unchanged. For restrictive combination constraints, the function, while traversing the design matrix, filters all rows that satisfy the specific parent factor value conditions and checks whether the corresponding child factor levels belong to a preset allowed set. If a child factor level is found to be outside this set, the function replaces it with a valid alternative value to ensure that when the parent factor is at a specified level, the child factor can only take levels within the specified range. This mechanism effectively constrains the conditional dependencies of child factors, avoiding illogical or uncontrollable design points, while enhancing the interpretability and practical applicability of experimental schemes while ensuring design diversity. This constraint processing ensures that the design points always meet the specific structural requirements of the problem during the optimization process, effectively improving the feasibility and practical application value of the design.

[0029] Furthermore, step S5, calculating the objective function value, specifically includes the following: Calculate the objective function increment Δf and evaluate the criterion value.

[0030] Furthermore, in step S6, the specific steps for updating the matrix based on the objective function value are as follows: S611: According to the acceptance criterion P of the simulated degradation algorithm accept =max(1-Δf / T h , 0), determine whether to accept the new design; When Δf≤0, it indicates that Xtry is better than the current design X, so the replacement X is accepted, and the current optimal design and the corresponding objective function criterion value are updated; S612: In step S611, when determining whether to accept the new design, if Δf > 0, then the uniform random number U (following a uniform distribution in the interval (0,1)) satisfies U ≥ Δf / T. h When that happens, accept the current inferior solution Xtry; When U < Δf / T h If so, then reject the inferior solution Xtry; Where, when Δf≥T h At this point, regardless of the value of the random number U, an inferior solution will inevitably be rejected because the acceptance probability P is lower. accept =0; while when 0 < Δf < T h At that time, as the temperature threshold T h As the value of U increases, the probability of accepting inferior solutions will increase accordingly, but this is not absolute and the acceptance must still be determined based on the size of the random number U.

[0031] Furthermore, the conditions for stopping the iteration in S10 specifically include the following: When the maximum number of outer loops E or T is reached h When the threshold is less than the preset lower limit, the iteration stops, and the current optimal design matrix X is output. best and the corresponding maximum and minimum distances mindX best Its objective function value; When the maximum number of outer loops E and T has not been reached h >When the preset lower limit is reached, return to step S3 to continue the next round of inner loop.

[0032] A cross-platform implementation method based on double loop optimization includes the following steps: M1: Package the hybrid level-enhanced stochastic algorithm based on double-loop optimization in MATLAB R2024a (enter deloytool), compile the core algorithm functions using the MATLAB Compiler SDK, and generate a JAR file that can be called in Java (the JAR file contains the MATLAB files and graphics library required for algorithm execution, which are dynamically loaded when called by Java). M2: Import the generated JAR file and the "javabuilder.jar" that comes with Matlab R2024a into the Java project. The Java program accesses the algorithm function by calling the JAR file generated by MATLAB, loads the algorithm function using Java native methods, and runs it successfully. M3: Packages the code that can successfully call the JAR file together with the javabuilder.jar file to generate a new cross-platform JAR file, so that it can run on different operating systems later; M4: Each target platform requires the installation of the MCR (MATLAB Runtime) R2024a version software corresponding to the compiled version; When a Java application calls an algorithm function in a Jar package, MCR is responsible for executing the code on the operating system, ensuring that the MATLAB function can run, and for the corresponding JDK 1.8 version for different platforms; M5: On each platform, a compatible Java Runtime Environment (JRE / JDK) and the corresponding version of MATLAB Runtime need to be pre-installed; Supported operating systems include Windows, macOS, Linux / CentOS, etc. For example, in Windows systems, the `bin` path under the MCR installation directory needs to be added to the system environment variable PATH to ensure that Java can call the relevant dynamic libraries; In Linux or CentOS systems, you need to set LD_LIBRARY_PATH to point to the lib directory of MCR in order to load the necessary shared libraries; On macOS, the MCR can be obtained by installing the corresponding .pkg file, and the environment variables are set up similarly to those on Linux. The installation details vary slightly on each platform, but as long as the compatibility requirements are met, users can run Java applications directly without modifying the algorithm code, thus achieving true cross-platform deployment. M6: Final test JAR package, to determine the normal operation result; In the terminal, type `java -jar_package_name.jar`. If the output is successful, the program has run successfully. If not, check if there is an error in the environment variables or path configuration.

[0033] In CentOS 8.5, the test JAR package was able to run successfully as follows: Figure 1 As shown; the test JAR package runs successfully in a Docker container. Figure 2 As shown.

[0034] Purpose of cross-platform implementation: As the top-level module, the Java application layer implements algorithm calculations by calling the algorithm package compiled by MATLAB. The internal functions of the algorithm package depend on the MATLAB runtime library, and the MATLAB runtime is supported by the operating system. The interface between Java and MATLAB code is automatically generated by MATLAB's Java Builder tool, eliminating the need for users to implement complex language interoperability logic themselves. Users only need to call the algorithm interface function in the Java environment and pass in parameters, and the system can run the algorithm on any supported platform and return the results.

[0035] Among them, 1. Double-loop optimization framework: Inner loop: Combining two perturbation methods of "in-column element exchange in a specific direction" and "single-point horizontal jump" to achieve local fine search and global exploration respectively; Outer loop: Based on the acceptance rate (n_acpt / M) and improvement rate (n_imp / M) of the inner loop, adaptively increase or decrease the threshold (Th), and precisely control the search intensity through two different temperature increase and decrease formulas (Th←α1·Th or Th←Th / α1; Th←α2·Th or Th←Th / α3).

[0036] Double-loop framework and its adaptive threshold update strategy: Protect the definition and interaction relationship of the inner and outer loops in the double-loop structure; Protect the adaptive threshold update formula based on the acceptance rate and improvement rate: When flag_imp = 1 and nacpt / M > p1 and nimp / M < nacpt / M: Th←α1·Th; When flag_imp = 0 and nacpt / M < p2: Th←Th / α3; otherwise Th←α2·Th; Among them, 0 < α3 < α2 < α1 < 1, and p1, p2 are preset percentage thresholds Beneficial effects: This framework can dynamically balance global jumping out and local convergence at different stages, taking into account both efficiency and quality, and significantly reducing the risk of falling into local optimality.

[0037] 2. Adaptive perturbation scale and iteration setting The number of candidate solutions J is set to min([n_e / 5], 50), where n_e is the possible number of exchange pairs in the current column; The number of inner loop iterations M is set to min(2·n_e·m / J, 100), where m is the number of factors.

[0038] Adaptive perturbation scale and iteration number setting method: Adaptive calculation formulas for the number of protection disturbances J and the number of iterations M, and their application scenarios; This method automatically determines J and M based on the number of factors m and the number of possible swaps n_e of the current column, without the need for pre-tuning parameters.

[0039] Beneficial effects: The number of perturbations and iterations are automatically adjusted according to the problem size, without the need for prior parameter tuning, ensuring the algorithm's adaptability and computational efficiency for different scale designs.

[0040] 3. Combination of Mandatory / Prohibited Factor Level Constraints Module Constraint checks are performed simultaneously during the de-disturbance and acceptance decision phases: Mandatory constraints: Prioritize inserting the specified "parent factor – child factor" level combination into the specified row of the design matrix; Prohibitory constraints: Automatically correct to a legal level when an illegal combination is detected.

[0041] Beneficial effects: The design process naturally satisfies complex combinatorial constraints, eliminating the need for post-processing and significantly improving the feasibility and reliability of the design. 4. Multi-objective criterion parameterization interface It supports multiple evaluation functions such as "maximum-minimum distance", "maximum correlation coefficient minimization", and "centering L2 bias minimization"; Users can quickly generate optimal solutions for different design goals simply by replacing the evaluation function module.

[0042] Design of parameterized interface for multi-objective evaluation function: The protection evaluation function module features a pluggable architecture: users can dynamically select criteria such as maximum and minimum distance, maximum correlation, or centered L2 bias. This interface design allows switching optimization targets without modifying the core algorithm.

[0043] Beneficial effects: The algorithm is highly versatile, and a single implementation can serve a variety of experimental design scenarios, reducing the cost of secondary development.

[0044] 5. Cross-platform one-click deployment solution Develop algorithms in MATLAB and encapsulate them as functions; Generate a Java-callable JAR using the MATLAB Compiler SDK; The Java layer automatically loads algorithms via the MATLAB Engine API or Java Builder, without requiring a full MATLAB environment; For deployment on Windows, macOS, Linux, and CentOS, simply install the corresponding MATLAB Runtime (MCR) to run the same JAR package directly.

[0045] Overall solution for cross-platform deployment of MATLAB and Java: This document protects the complete packaging and calling process from MATLAB functions to Java callable JARs, including the usage of the MATLAB Compiler SDK, Java-side loading and parameter passing interfaces, and the configuration method for a cross-platform compatible execution environment based on the MATLAB Runtime. Comparative Study of Optimization Stochastic Evolution Algorithms Based on Different Criteria: The proposed algorithm can be used to optimize various experimental design criteria, including various space-filling criteria, A-optimal and D-optimal criteria under regression models, etc. This study demonstrates the applicability of the algorithm using the maximum-minimum distance criterion, the approximate orthogonality criterion, and the bias criterion as examples.

[0046] Beneficial effects: One-time development and multi-system compatibility simplify the integration and maintenance of the production environment and significantly improve the efficiency of algorithm deployment.

[0047] 6. Specific combinations of hybrid perturbation strategies: Protect the two perturbation methods, "directional intra-column element swap" and "single-point horizontal jump", and the mechanism by which they are selected in the inner loop with a certain probability (e.g., 50%).

[0048] 7. Combinatorial constraint processing module based on the solution generation stage The protection incorporates **mandatory combination** and **prohibited combination** constraint checks and automatic correction logic in the algorithm perturbation generation and acceptance determination processes; This module ensures that the design point always conforms to the given combination of constraints throughout the entire iteration process.

[0049] 1. Maximum and minimum distance criterion The maximum-minimum distance criterion is a key design method in the field of space filling design, and its core lies in optimizing the minimum spacing between all design points. This criterion constructs the objective function by maximizing the minimum Euclidean distance between all design points: (1) Here, Euclidean distance is used to measure the distance between design points. During optimization, the objective function aims to maximize... The maximum-minimum distance criterion ensures that no two design points in the optimal design will be too close, thus guaranteeing the uniform distribution of design points in space. This characteristic makes the criterion significant in evaluating the global exploration performance of the algorithm. A larger objective function value indicates a wider exploration range in the search space and a greater likelihood of finding the global optimum.

[0050] 2. Approximately orthogonal design The approximate orthogonal design criterion constructs the optimal design by minimizing the maximum correlation coefficient between the columns of the design matrix. Its objective function is as follows: (2) In this formula, This represents the correlation coefficient between the i-th and j-th columns in the design matrix. and These correspond to the value vectors of different factors in the design matrix. The optimization direction is to minimize... The aim is to reduce the correlation between factors, thereby weakening mutual interference and ensuring the statistical independence and validity of the experimental design. This method is suitable for scenarios with a limited number of factor levels and can effectively simplify the subsequent data analysis process. Since fully orthogonal designs are difficult to achieve in most practical problems, approximate orthogonal designs provide an approximate optimization scheme to get as close as possible to the ideal state of an orthogonal design.

[0051] 3. Uniform design The uniform design criterion aims to minimize the center deviation, thereby achieving a uniform distribution of design points in space. Its objective function expression is: (3) The optimization direction of this objective function is to minimize That is, by reducing the center The deviation value ensures that all design points are evenly distributed in space, effectively avoiding the problem of excessive clustering of design points in local areas, thereby improving the uniformity and representativeness of the design points in space. Initialize the three algorithms with different optimization criteria as the objective function: The sample size was set to n=25, n=55, and n=100. Different factor settings with varying levels were designed for each size, typically including combinations of 6, 8, and 10 levels (in Experiment 1, when 8 factors were selected, 4 factors were at 6 levels and 4 factors were at 8 levels). The levels were evenly distributed within the range [0,1]. The maximum number of iterations was set to 10. 4 Under each condition, the performance of the algorithm of this invention was compared and analyzed with three benchmark algorithms: Simulated Annealing (SA), Constraint Programming (CP), and Particle Swarm Optimization (PSO). All algorithms were run under the same hardware environment and time budget, and multiple independent experiments were conducted to calculate statistical indicators. The specific results are shown in Table 1.

[0052] Table 1. Running time and X under different criteria best Comparison of effectiveness indicators

[0053] As can be seen from the data in Table 1, ESE outperforms the comparison algorithms (CP, SA, PSO) under different sample sizes (n=25, n=55, n=100) and multiple evaluation criteria.

[0054] In terms of runtime: The ESE algorithm demonstrates significant computational efficiency advantages under various evaluation criteria and different sample sizes. Under the minimum distance criterion, when the sample size increases to n=100, ESE takes only 8.94 seconds, compared to 3442.16 seconds for CP, 957.27 seconds for SA, and 23.83 seconds for PSO, representing approximately 384, 107, and 2.7 times faster than ESE, respectively. In the maximum correlation coefficient criterion, ESE takes only 17.81 seconds at n=100, while PSO and CP take 75.81 seconds and 13164.72 seconds, respectively, further highlighting ESE's computational advantage in handling high-dimensional mixed-level experimental designs. Even in relatively low-complexity centralized... Under the deviation criterion, ESE completed the optimization in only 6.93 seconds even with n=100, demonstrating good stability and scalability.

[0055] In terms of effectiveness metrics: ESE demonstrated excellent optimization capabilities and robustness under various criteria. For the minimum distance criterion (the larger the target value, the better), ESE achieved 1.06, 0.74, and 0.61 for n=25, 55, and 100, respectively. Although slightly lower than PSO (1.19 and 0.87) with low sample sizes, its running time was significantly shorter than PSO, showing a better balance between efficiency and quality. In the maximum correlation coefficient criterion (the smaller the target value, the better), ESE achieved 0.028, 0.013, and 0.008 for the three sample sizes, all significantly better than PSO (0.369), SA (0.125), and CP (0.121), especially reaching the optimal level at n=100, demonstrating strong decorrelation capabilities. In the centralized... Under the deviation criterion, the ESE index is 0.213 when n=100, which is close to SA (0.201), but its running time is only 1 / 5 of SA. Compared with PSO, it also saves more than 80% of the calculation time, demonstrating an excellent balance between design uniformity and resource efficiency.

[0056] A comprehensive comparison reveals that the ESE algorithm demonstrates exceptional stability and efficiency under large sample conditions. Taking n=100 as an example, the ESE runtime under all criteria did not exceed 20 seconds, while CP and SA required hundreds to tens of thousands of seconds under multiple criteria, showcasing ESE's excellent scalability in handling complex high-dimensional experimental designs. Furthermore, the ESE's effectiveness index did not deteriorate with increasing sample size. Particularly under the maximum correlation coefficient criterion, its effectiveness continuously improved with increasing sample size (from 0.028→0.013→0.008), fully validating the adaptability and superiority of its inner and outer loop strategies and constraint mechanisms in multi-factor, multi-level environments. Overall, the ESE algorithm achieves a harmonious balance between optimization effectiveness, time efficiency, and scalability, making it suitable for constructing high-quality mixed-level experimental designs that satisfy multiple criteria.

[0057] To further verify the generalization ability of the proposed algorithm in scenarios with higher-dimensional mixed factors, a comparative experiment 2 was designed as follows: The sample size was set to n=25, n=55, and n=100. For each size, different factor settings with different level combinations were designed, typically including factor combinations of 6, 8, and 10 levels (in Experiment 2, when 10 factors were selected, 4 factors were at 6 levels, 4 factors were at 8 levels, and 2 factors were at 10 levels), with the levels evenly distributed in [0,1]; the maximum number of iterations was set to 104.

[0058] Table 2 Running Time and X under Different Criteria best Comparison of effectiveness indicators

[0059] In terms of runtime: The ESE algorithm demonstrates a significant time advantage across all evaluation criteria and sample sizes. Under the minimum distance criterion, as the sample size increases from n=25 to n=100, ESE's runtime decreases from 1.29 seconds to only 8.76 seconds, while CP's runtime increases from 110.17 seconds to 4116.18 seconds, and SA and PSO also increase to 1132.93 seconds and 46.85 seconds respectively. ESE saves up to over a thousand times the computation time compared to traditional algorithms. Under the maximum correlation coefficient criterion, CP's computation time reaches a staggering 26441.37 seconds (approximately 7.3 hours), while ESE only takes 27.75 seconds under the same conditions, showcasing strong scalability and practical operability. Furthermore, under the centralized L2 bias criterion, the ESE runtime is consistently less than 8 seconds, while CP and SA take 6921.74 seconds and 53.62 seconds respectively when n=100, which fully demonstrates the efficiency advantage of ESE in large-scale complex design tasks.

[0060] In terms of effectiveness metrics: The optimization results show that ESE maintains a high-quality design level under various evaluation criteria. In the minimum distance criterion (higher values ​​are better), ESE's effectiveness for the three sample sizes is 1.273, 1.013, and 0.827, respectively. While ensuring computational efficiency, its results are not only far superior to CP (0.517, 0.681, 0.411) but also significantly better than SA (0.884, 0.731, 0.619), approaching or nearly surpassing PSO. Especially with n=100, ESE achieves a similar minimum distance level (0.827 vs 0.921) with a significantly shorter running time than PSO (8.76 seconds vs 46.85 seconds), demonstrating its excellent trade-off between efficiency and quality. In the maximum correlation coefficient criterion (the smaller the value, the better), ESE reached 0.039 at n=100, significantly outperforming PSO (0.338), SA (0.081), and CP (0.114); Under the deviation criterion, the effectiveness of ESE is 0.264, which is better than PSO (0.487) and CP (0.328) and very close to SA (0.253), further confirming the stability of its optimization capability.

[0061] In terms of stability and trend: The ESE algorithm exhibits stronger robustness and trend consistency as the sample size increases. Taking the maximum correlation coefficient criterion as an example, from n=25 to n=100, the effectiveness of ESE steadily decreased (0.076→0.039→0.038) with almost no fluctuation, while PSO increased from 0.632 to 0.338, and SA decreased from 0.362 to 0.081, showing larger irregular fluctuations. This indicates that ESE can maintain stable and progressively optimized performance when dealing with complex combinations of factors and asymmetric levels. In addition, the running time of ESE was controlled within 30 seconds in all experimental settings, while CP exceeded 6000 seconds multiple times under the same conditions. This is extremely important for applications that require rapid output of design results.

[0062] In summary, the ESE algorithm achieves stable output of high-quality solutions under multiple evaluation criteria, while its operating efficiency is far superior to other mainstream algorithms. This is true regardless of whether the algorithm is based on minimum distance, maximum correlation, or centralization. Under various criteria, such as bias, ESE demonstrates high adaptability, strong optimization capability, and good time control characteristics. Especially under conditions of large sample size, multiple factors, and high complexity, ESE achieves a balance between efficient solution and design quality, showcasing its comprehensive advantages as a mixed-level experimental optimization algorithm. It is the preferred solution for large-scale design problems in practical application environments.

[0063] Example Application In the research and development and application of unmanned aerial vehicles (UAVs), optimizing flight parameters is crucial for improving flight performance, extending endurance, enhancing stability, and adapting to different mission requirements. This experiment designed a set of multi-factor mixed-level experiments to systematically study the impact of different flight parameters on UAV endurance and to determine the optimal combination of parameters through experimental design optimization.

[0064] (1) Experimental factors and their levels The experiment involved six factors. The parameters and their levels are as follows:

[0065] X1 (Flight Altitude): The value ranges from 1 to 10, representing 100 meters to 1000 meters, with each unit corresponding to 100 meters.

[0066] X2 (flight speed): values ​​are 5, 10, 15, and 20 meters per second.

[0067] X3 (Battery Capacity): Values ​​of 30, 40, 50, 60, 70, and 80 represent the percentage of remaining battery capacity.

[0068] X4 (load weight): values ​​are 1, 5, 10, and 15 kg.

[0069] X5 (Ambient Temperature): Values ​​are -10, 0, 10, 20, 30, and 40℃.

[0070] X6 (Flight Mode): Values ​​range from 1 to 5, representing different flight modes such as cruise mode, energy-saving mode, high-speed mode, etc.

[0071] These factors cover key variables in drone flight, including altitude, speed, battery power, payload, temperature, and flight mode. The level setting for each factor is based on actual flight conditions and engineering experience.

[0072] (2) Experimental objectives The impact of various flight parameters on the UAV's endurance was determined, and the optimal parameter combination was found to maximize endurance. By optimizing the experimental design, the uniform distribution of experimental points in the design space was ensured, thereby exploring the design space more effectively and improving experimental efficiency.

[0073] (3) Experimental design and optimization This experiment employs the maximum-minimum distance criterion for optimization design. This criterion ensures a uniform distribution of test points in the design space by maximizing the minimum distance between all design points. The optimization process uses a Latin hypercube design as the initial design and combines iterative optimization with simulated annealing to satisfy constraints and improve the objective function value.

[0074] The maximum-minimum distance criterion was selected as the effectiveness index, and the results are shown in Table 3. The ESE algorithm shows certain advantages in terms of running efficiency and solution quality.

[0075] Table 3 Running time and X under different criteria best Comparison of effectiveness indicators

[0076] The ESE algorithm maintains stable and outstanding overall performance across different sample sizes (n=30, 50, 100). In terms of runtime efficiency, ESE takes 1.63 seconds, 3.46 seconds, and 11.63 seconds at the three sizes, respectively, significantly outperforming traditional methods such as CP (78.26 seconds, 310.24 seconds, and 2582.63 seconds) and SA (19.27 seconds, 85.83 seconds, and 672.64 seconds), and even outperforming the more efficient PSO (6.74 seconds, 17.36 seconds, and 47.72 seconds) by orders of magnitude. Particularly in large sample designs (n=100), ESE's runtime is only 0.35% of CP's and 1.36% of SA's, demonstrating strong scalability and system adaptability while significantly reducing computational costs.

[0077] From the perspective of effectiveness metrics, ESE achieved the best performance across all sample sizes. Taking the maximum-minimum distance criterion as an example, ESE achieved an effectiveness of 0.72 when n=30, significantly outperforming SA (0.59) and CP (0.34). When the sample size increased to n=100, despite the significant expansion of the experimental space, ESE still maintained an effectiveness of 0.36, which is not only higher than SA (0.34) and PSO (0.31), but also far exceeds CP (0.03). This result indicates that ESE maintains strong stability and uniform filling ability even with increasing factor complexity, effectively maintaining the structural quality of the design matrix and avoiding getting trapped in local optima or generating inferior points.

[0078] From a trend perspective, the validity of ESE changes relatively little with increasing sample size, demonstrating good robustness. For example, as n=30 increases to n=100, the validity of ESE gradually decreases from 0.72 to 0.36, while PSO decreases from 0.62 to 0.31, SA from 0.59 to 0.36, and CP drops sharply from 0.34 to 0.03. This stable pattern of "slow decay + high starting point" indicates that ESE has a strong ability to adapt to different design scales, and will not sacrifice the quality of results due to the expansion of sample size. It is suitable for long-term deployment in large-scale experimental designs with many constraints and high computational requirements.

[0079] In summary, considering both minimum running time and optimal objective value performance, the ESE algorithm outperforms existing mainstream optimization methods in terms of algorithmic efficiency, solution quality, and scale adaptability. This demonstrates that the algorithm is not only suitable for rapid exploration but also for high-precision design tasks, making it an ideal algorithm for addressing the optimal construction challenges in practical mixed-level problems.

[0080] Table 3 shows that, under unconstrained conditions, the objective function criterion values ​​based on the maximum-minimum distance criterion are 0.72, 0.64, and 0.36 when the sample size n is 30, 50, and 100, respectively. Assume that a critical level combination exists in practical applications, i.e., when X2 is 20, X6 must be 5. However, after checking the optimal design matrix, it is found that this combination is not included, and directly using the original design will not meet the flight requirements. To solve this problem, we introduce a critical combination locking mechanism to re-optimize the design. Under the premise of ensuring the existence of this combination, the minimum distance objective function criterion values ​​of the new design matrix are 0.68, 0.51, and 0.27, respectively. Although these values ​​are slightly lower than the unconstrained design, the practicality of the design is significantly improved.

[0081] Furthermore, it is assumed that certain level combinations are prohibited in the same experimental problem due to actual flight constraints. For example, when X2 is 5, X6 being 5 is meaningless. Such illegal combinations exist in the initial design matrix, and direct experimentation may lead to system failure. To avoid this, we introduce a combination exclusion constraint to ensure that illegal combinations are not generated during subsample optimization. Through recalculation, the minimum distance objective function criterion values ​​for the new design matrix are 0.64, 0.58, and 0.32, respectively. While these values ​​are slightly lower than those for unconstrained design, they effectively avoid the generation of infeasible design points, thus ensuring the safety and reliability of the experiment.

[0082] When the sample size n=30, the optimal designs generated under three different conditions are shown in Table 4. These examples demonstrate that properly handling specific levels of combined constraints not only ensures design quality but also better meets the requirements of practical applications, improving the performance of UAVs in different tasks and environments. This experimental design method is not only applicable to UAV flight parameter optimization but can also be extended to other engineering fields requiring multi-factor optimization, providing strong support for the design and optimization of complex systems.

[0083] Table 4 Optimal Design Tables Generated Under Different Constraints

[0084] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A hybrid level enhanced random algorithm based on double loop optimization, characterized in that: Comprising the following steps: S1: initialization; S2: setting algorithm parameters; S3: performing inner loop, performing local search under fixed threshold; S4: judging constraint condition; When there is no constraint condition, generating candidate solution; S5: calculating target function value; S6: judging update of matrix according to target function value; S7: Return to the outer loop, adjust the threshold T according to the frequency of accepting new designs and the number of iterations h ; S8: after completing M iterations, calculating acceptance rate and improvement rate; S9: Update threshold T h ; S10: judging stopping iteration condition.

2. A hybrid level enhanced random algorithm based on double loop optimization as claimed in claim 1 wherein: In step S4 of judging constraint condition, when there is constraint condition, the specific steps comprise the following: S411: after selecting the result of element exchange or horizontal jump mechanism in column with a probability of 50%, defining constraint structure body; S412: inputting constraint list, each constraint containing: parent factor index jf, parent factor level Ljf, child factor index jc, child factor allowed level set Sjc, and constraint type type ∈ {0, 1, 2}; S413: obtaining K pairs of parent factor-child factor relationship table; S414: judging constraint type; When type = 0, it is forbidden combination; When type = 1, it is forced combination; When type = 2, it is limited combination; S415: for each constraint-corrected, generating new candidate solution and recalculating target function value.

3. A hybrid level enhanced random algorithm based on double loop optimization as claimed in claim 2 wherein: The forbidden combination: when the parent factor takes a specific value, some levels of the child factor are illegal, and the system will automatically replace them with legal levels; The forced combination: specifying that certain experimental points must strictly use a specific factor level combination, specifically, the function constructs a design row that meets the combination condition according to each constraint and inserts it into the top of the matrix, while keeping other structures of the original design unchanged; The limited combination: when the parent factor is at a specified level, the child factor is only allowed to choose from a set of candidate levels.

4. A hybrid level enhanced random algorithm based on double loop optimization as claimed in claim 1 wherein: Step S5 of calculating target function value specifically comprises the following: Calculate target function increment Δf, and evaluate criterion value.

5. A hybrid level enhanced random algorithm based on double loop optimization as claimed in claim 1 wherein: In step S6, according to the target function value, the specific steps of judging the update of the matrix are as follows: S611: Accept the new design according to the acceptance criterion P of the simulated degeneration algorithm accept = max(1 - Δf / T h , 0), judge to accept the new design; When Δf ≤ 0, it indicates that Xtry is better than the current design X, so replace X, update the current optimal design and the corresponding target function criterion value; S612: Step S611 judges acceptance in new design, when Δf > 0, when and only when uniform random number U (uniform distribution in interval (0, 1)) satisfies U ≥ Δf / T h , accept current inferior solution Xtry; When U < Δf / T h then the poor solution Xtry is rejected.

6. A hybrid level enhanced random algorithm based on double loop optimization as claimed in claim 1 wherein: In step S10 of judging the stopping iteration condition, the specific steps comprise the following: When the maximum number of outer loops E is reached, or T h When the lower limit is reached, stop iteration, output the current optimal design matrix X best and the corresponding maximum minimum distance mindX best The objective function value; When the maximum outer loop number E and T h is not reached, return to step S3 to continue the next inner loop.

7. A cross-platform implementation method based on double-loop optimization, characterized in that: Comprising the following steps: M1: package the hybrid level enhancement random algorithm based on double-loop optimization in MATLAB R2024a, compile the core algorithm function through MATLAB Compiler SDK, and generate Jar package that can be called in java; M2: introduce the generated Jar package and "javabuilder.jar" provided by Matlab R2024a into the Java project, and Java program accesses the algorithm function by calling the Jar package generated by MATLAB compilation, loads the algorithm function by using Java native method, and successfully runs; M3: package the code that can successfully call Jar package and javabuilder.jar file together to generate a new cross-platform JAR package, so as to run on different operating systems in the future; M4: Install the MCR R2024a version of the software corresponding to the compiled version on each target platform; When the Java application calls the algorithm function in the Jar package, MCR is responsible for executing the code on the operating system, ensuring that the MATLAB function is executable, and corresponding to the jdk1.8 version of different platforms; M5: On each platform, a compatible Java runtime environment and the corresponding version of MATLAB Runtime need to be pre-installed; M6: Finally test the JAR package to determine the normal running result; Enter java-jar package name.jar in the terminal, and when the result can be successfully output, it indicates that the running is successful; When it can't, it means that the environment variable or path configuration is wrong.

Citation Information

Patent Citations

  • Ground penetrating radar image abnormal region enhancement method based on mixed supervised learning

    CN116563169A

  • Local layout wiring method based on sequence value correction and historical guidance search

    CN120145985A

  • Benchmarking progressive systems for solving combinatorial problems

    US20140025610A1

Cited By

  • Time sequence sensing automatic replacement method for circuit multi-threshold camouflage unit

    CN121936385A