Flexible cable assembly parameter optimization method, device and medium based on q-learning genetic algorithm

By using a flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm, the problem of local optimum trap in the optimization of flexible cable assembly parameters of traditional genetic algorithm is solved, realizing efficient and reliable cable assembly design and improving system stability and security.

CN120805732BActive Publication Date: 2026-01-0610TH RES INST OF CETC
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511271575.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2026-01-06
Estimated Expiration
2045-09-08

AI Technical Summary

Technical Problem

Existing technologies for optimizing flexible cable assembly parameters suffer from local optimum traps caused by the static parameter setting of traditional genetic algorithms and the difficulty in finding the optimal solution within a finite time. This is especially true in complex multidimensional parameter optimization, where existing technologies struggle to efficiently describe the local optimum traps caused by the static parameter setting of traditional genetic algorithms and the difficulty in finding the optimal solution within a finite time.

Method used

The cable assembly parameters are optimized using a Q-Learning genetic algorithm. Physical modeling is performed using a static model of an elastic slender rod and the Kirchhoff equation. The key parameters of the genetic algorithm are dynamically adjusted in conjunction with the Q-Learning genetic algorithm. The optimization objective is to minimize the interference torque. The cable assembly parameters are encoded using a piecewise function, and the crossover rate and mutation rate are adaptively adjusted to generate new individuals to approximate the optimal solution.

Benefits of technology

It significantly improves the efficiency and quality of cable assembly design, enhances global search capabilities and convergence speed, optimizes bending stiffness, torsional stiffness, cable length and cable end positions, improves the reliability and safety of cable assemblies, and reduces problems such as geometric deformation and insulation layer cracks caused by design defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120805732B_ABST
    Figure CN120805732B_ABST
Patent Text Reader

Abstract

The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter optimization method and device based on a Q-Learning genetic algorithm and a medium, and relates to the technical field of cable assembly. The application provides a flexible cable assembly parameter
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of cable assembly technology, and more specifically, to a method, device, and medium for optimizing flexible cable assembly parameters based on a Q-Learning genetic algorithm. Background Technology

[0002] In recent years, the rapid development of industries such as aerospace, shipbuilding, automotive, and home appliances has led to the increasingly widespread application of cable assemblies in modern equipment. However, their reliability and safety issues have become increasingly prominent. In aerospace propulsion systems, over 40% of unplanned outages are related to anomalies in peripheral transmission units, particularly hydraulic conduit rupture and signal cable aging. These problems can trigger chain reactions, leading to system functional degradation or even failure, posing serious safety hazards. Current cable routing designs rely on physical prototypes and repeated trial assembly, which is inefficient and fails to meet high-quality design requirements. Furthermore, design flaws often result in geometric deformation, stress concentration, and insulation layer cracks. Accurately simulating and optimizing the dynamic behavior of cables, especially in the design of flexible moving cables, has become crucial for improving equipment reliability. Although existing research has attempted to address this issue, current technologies still have significant limitations. There is an urgent need to develop accurate physical modeling and efficient solution techniques to optimize designs and improve system safety and stability.

[0003] Chinese invention patent application number 202410303736.X discloses a method for optimizing the assembly parameters of flexible cables based on a genetic algorithm. This method uses an elastic rod model to accurately model the flexible cable, then discretizes the model to convert it into an overdetermined nonlinear algebraic equation system. The Levenberg-Marquardt (LM) algorithm is then used to solve for the attitude of each discrete point in the model, thus obtaining the overall attitude of the cable. Next, the disturbance torque is calculated based on the obtained cable attitude, and the cable assembly parameters are further optimized by minimizing the disturbance torque. In other words, this method clearly describes the specific content of physically modeling the moving cable based on an elastic rod static model to obtain the moving cable model, and determining the pose of the moving cable and the solution method for the disturbance torque based on the Kirchhoff equation considering the distributed force.

[0004] However, this method employs a traditional genetic algorithm to solve for the cable assembly parameters. The applicant found that while traditional genetic algorithms, through operations such as selection, crossover, and mutation, offer good global search capabilities for complex problems and are easy to implement, they also have some significant limitations. The main problems include: static parameter setting and local optimum traps. Key parameters in traditional genetic algorithms (such as crossover and mutation rates) are typically statically set; however, the requirements for these parameters change dynamically at different evolutionary stages. For example, in the early stages, the algorithm needs a higher mutation rate to maintain population diversity and avoid premature convergence; while in the later stages, a lower mutation rate helps the population converge to the optimal solution faster. Because these parameters cannot be adaptively adjusted according to the evolutionary process in traditional algorithms, the algorithm may lack sufficient exploration in the early stages or fail to fully utilize information near the current optimal solution in the later stages. This often leads to the algorithm getting trapped in local optima, affecting the quality of the final solution and the convergence speed.

[0005] In other words, in the optimization of cable assembly parameters, due to the existence of multi-dimensional parameters that need to be optimized (such as bending stiffness, torsional stiffness, cable length, etc.), the problem is complex and has obvious nonlinear characteristics, making it difficult for traditional genetic algorithms to find the optimal solution in a limited time. Summary of the Invention

[0006] The present invention aims to solve at least one of the aforementioned technical problems existing in the prior art.

[0007] To this end, the first aspect of the present invention provides a method for optimizing the assembly parameters of flexible cables based on the Q-Learning genetic algorithm.

[0008] A second aspect of the present invention provides a computer device.

[0009] A third aspect of the present invention provides a computer-readable storage medium.

[0010] This invention provides a method for optimizing flexible cable assembly parameters based on a Q-Learning genetic algorithm, comprising:

[0011] The moving cable model is obtained by physically modeling the moving cable based on the static model of the elastic thin rod. Specifically, the Kirchhoff equation under the action of no distributed force is first established based on the cable equilibrium state constraint. Then, based on the Kirchhoff equation under the action of no distributed force, the influence of surface contact force and external distributed force on the cable motion is considered to obtain the Kirchhoff equation considering the action of distributed force.

[0012] Based on the Kirchhoff equation considering the distributed force, the method for determining the pose of the moving cable and the solution of the disturbance torque is determined.

[0013] The cable assembly parameters are optimized based on the Q-Learning genetic algorithm. The optimization objective is to minimize the interference torque caused by multiple cables by adjusting the cable assembly parameters. The optimized cable assembly parameters include bending stiffness, torsional stiffness, cable length, and the positions of the cable ends.

[0014] The flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to the above technical solution of the present invention may also have the following additional technical features:

[0015] In the above technical solution, the optimization of cable assembly parameters based on the Q-Learning genetic algorithm includes:

[0016] The physical characteristics of the cable assembly parameters are encoded using symbolization and piecewise functions;

[0017] The population is initialized according to preset constraints; wherein, the assembly parameters of each node on the cable are set as the gene values ​​of individuals in the population; the preset constraints include: the positions of both ends of the cable need to meet the geometric constraints of the assembly space, and the physical parameters of the cable are within a set range.

[0018] Define the fitness function in the Q-Learning genetic algorithm; wherein, a penalty term for measuring the degree to which an individual violates the constraints is added to the fitness function;

[0019] Determine a crossover and mutation adaptive strategy based on Q-Learning; wherein, the parameters in the genetic algorithm are dynamically adjusted according to the fitness differences and diversity of the population;

[0020] Based on the fitness function, excellent individuals are selected from the current population to generate an intermediate population; among them, a roulette wheel selection mechanism based on fitness adjustment is adopted, combined with Q-Learning to dynamically adjust the selection probability;

[0021] The population evolves continuously by generating new individuals through selection, crossover, and mutation operations, thereby improving the population's fitness and approaching the optimal solution until a predetermined stopping criterion is reached.

[0022] In the above technical solution, encoding the physical characteristics of the cable assembly parameters through symbolization and piecewise functions includes:

[0023] The bending stiffness is represented by a piecewise function, including:

[0024]

[0025] in, This indicates the bending stiffness of the cable in the x-axis direction; This indicates the bending stiffness of the cable in the y-axis direction; This indicates the bending stiffness of the cable in the z-axis direction; This indicates the bending angle of the cable along the x-axis during assembly. This indicates the bending angle of the cable in the y-axis direction during assembly; This indicates the bending angle of the cable in the z-axis direction during assembly; This represents the encoding result of the cable's bending stiffness in the x-axis direction; This represents the encoded result of the cable's bending stiffness in the y-axis direction; This represents the encoded result of the cable's bending stiffness in the z-axis direction; and These represent the set values ​​of the bending stiffness of the cable under different bending states in the x-axis direction; and These represent the set values ​​of the bending stiffness of the cable under different bending states in the y-axis direction; and These represent the set values ​​of the bending stiffness of the cable under different bending states in the z-axis direction; if is a conditional decision operator;

[0026] The torsional stiffness is represented by a piecewise function, including:

[0027]

[0028] in, Indicates the torsional stiffness of the cable; The encoding result represents the torsional stiffness of the cable; Indicates the twist angle of the cable; and These represent the set values ​​of torsional stiffness of the cable under different torsion angle ranges;

[0029] The cable length is represented by a linear function, including:

[0030]

[0031] Where L represents the cable length; The encoded result represents the cable length; d represents the actual length under dynamic deformation; c represents the fixed length.

[0032] The cable has two ends: a fixed end and a movable end; the positions of the cable ends are represented using three-dimensional coordinates, including:

[0033]

[0034] in, This indicates the fixed end of the cable, and its coordinates are... ; This indicates the active end of the cable, with coordinates as follows: ;

[0035] Based on the encoding results, a gene expression is constructed for each cable as follows:

[0036]

[0037] in, This represents the encoding of assembly parameters for a single cable, i.e., the gene expression. This represents the initial solution for the cable pose.

[0038] For an assembly system containing n cables, the assembly parameters for each cable are... Expanded into a vector, representing all assembly parameters of the entire system; that is, the encoding of the entire system. It is a vector set consisting of the assembly parameters of n cables, represented as:

[0039]

[0040] in, This represents the encoding result of the i-th cable, where i = 1, 2, ..., n.

[0041] In the above technical solution, the optimization objective function in the Q-Learning genetic algorithm is:

[0042]

[0043] in, This represents the total interference torque of n cables; This represents the interference force of the i-th cable; This represents the lever arm length of the interference force of the i-th cable;

[0044] The fitness function in the Q-Learning genetic algorithm is set as follows:

[0045]

[0046] Where M(X) represents the objective function value corresponding to individual cable X; This represents the maximum value of the objective function in the current population; This represents the minimum value of the objective function in the current population; Indicates the penalty coefficient; is the degree of violation of individual X under the I-th constraint; m represents the total number of constraints.

[0047] In the above technical solution, the crossover mutation adaptive strategy based on Q-Learning includes:

[0048] The current evolutionary state is calculated based on the fitness differences and diversity of the population. Calculation methods include:

[0049]

[0050] Where S represents the current evolutionary state of the population; B represents the number of solutions in the population that are the same as the current best solution; and P represents the total population size.

[0051] An action set is constructed based on the combination of crossover rate and mutation rate values, forming a Q-table;

[0052] Based on the current evolutionary state of the population, the optimal combination of crossover rate and mutation rate is selected from the Q table; among which, the ε-greedy strategy is used to select the optimal action;

[0053] Based on the selected combination of crossover and mutation rates, the reward value for the selected action is calculated. The reward value calculation method includes:

[0054]

[0055] Where r represents the reward value; This represents the optimal solution before updating the population; This represents the optimal solution after crossover and mutation.

[0056] Use the Q-Learning update formula to update the values ​​in the Q table, including:

[0057]

[0058] Where Q(S,A) represents the Q-table; α represents the learning rate; This indicates possible combinations of actions for the next generation; Indicates a new state; This represents the discount factor.

[0059] In the above technical solution, the step of selecting superior individuals from the current population based on the fitness function to generate an intermediate population includes:

[0060] Arrange all individuals in the current population according to their fitness level;

[0061] Based on the ranking, each individual is given a choice probability as follows:

[0062]

[0063] in, Indicates the ranking of an individual; Indicates population size; Indicates the selection of pressure parameters; Indicates the individual ID;

[0064] A roulette wheel selection mechanism based on fitness adjustment is adopted, combined with Q-Learning to dynamically adjust the selection probability; wherein, the selection probability is dynamically adjusted according to the state of the population; the selection principle of the roulette wheel selection mechanism based on fitness adjustment includes:

[0065] Individuals with higher fitness levels are positioned higher on the roulette wheel and have a greater probability of being selected.

[0066] Individuals who violate the constraints will be assigned a lower probability of selection;

[0067] Determine whether the population is currently in the exploratory or convergent phase based on its current evolutionary state; in the exploratory phase, expand the selection range of the roulette wheel; in the convergent phase, reduce the selection range of the roulette wheel.

[0068] In the above technical solution, the process of generating new individuals based on selection, crossover, and mutation operations to continuously evolve the population, improve population fitness, and approach the optimal solution until a predetermined stopping criterion is reached includes:

[0069] Individuals with fitness that meet the requirements are selected for the breeding pool through selection operations; new individuals are generated through crossover and mutation operations; the fitness of the new individuals is evaluated and the population is updated; during the iteration process, the crossover rate and mutation rate are dynamically adjusted according to the state of the population to ensure a balance between exploration and convergence in the optimization process.

[0070] The predetermined stop criteria include:

[0071] Reaching the maximum number of iterations;

[0072] Or, the population fitness reaches a set threshold;

[0073] Or, the algorithm has converged.

[0074] In the above technical solution, the optimization of cable assembly parameters based on the Q-Learning genetic algorithm further includes:

[0075] The final solution is evaluated, and cable assembly parameters are adjusted according to requirements; including:

[0076] Calculate the fitness of the final solution and determine whether the fitness of the final solution meets the set threshold requirement;

[0077] The assembly parameters in the final solution are adaptively adjusted based on the usage environment.

[0078] The present invention provides a computer device, including a processor and a memory, wherein the memory stores a computer program, and when the computer program is loaded and executed by the processor, it implements the flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm as described in any of the above technical solutions.

[0079] The present invention provides a computer-readable storage medium storing a program that, when loaded by a processor, implements the flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm as described in any of the above technical solutions.

[0080] In summary, due to the adoption of the above-mentioned technical features, the beneficial effects of the present invention are:

[0081] This invention significantly improves the efficiency and quality of cable assembly design by employing a flexible cable assembly parameter optimization method based on a Q-Learning genetic algorithm. By utilizing a static model of an elastic slender rod and Kirchhoff's equations to accurately model the moving cable, this invention can accurately describe the equilibrium state of the cable under different forces, thus providing a solid theoretical foundation for cable design and optimization. Furthermore, this invention dynamically adjusts the key parameters of the genetic algorithm through Q-Learning, solving the problems of static parameter setting and susceptibility to local optima in traditional genetic algorithms, enhancing the algorithm's global search capability and convergence speed. This method not only optimizes the multi-dimensional assembly parameters of the cable, such as bending stiffness, torsional stiffness, cable length, and the positions of the cable ends, but also improves the reliability and safety of the cable assembly by minimizing disturbance torques, reducing problems such as geometric deformation, stress concentration, and insulation layer cracks that may be caused by design defects. The optimization algorithm of this invention can adapt to the needs of different evolutionary stages, has better adaptability and robustness, and can find the optimal solution more effectively within a limited time. This invention significantly improves the stability of the entire system and reduces the probability of unplanned interruptions, thus providing an efficient and reliable solution for cable assembly design in industries such as aerospace, shipbuilding, automotive, and home appliances.

[0082] Additional aspects and advantages of the invention will become apparent in the following description or may be learned by practice of the invention. Attached Figure Description

[0083] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:

[0084] Figure 1 This is a flowchart of a flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to an embodiment of the present invention;

[0085] Figure 2 This is a flowchart illustrating the optimization of cable assembly parameters based on the Q-Learning genetic algorithm in a flexible cable assembly parameter optimization method according to an embodiment of the present invention. Detailed Implementation

[0086] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0087] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.

[0088] The following reference Figure 1 and Figure 2 This invention describes a method for optimizing flexible cable assembly parameters based on a Q-Learning genetic algorithm, according to some embodiments of the present invention.

[0089] Some embodiments of this application provide a method for optimizing flexible cable assembly parameters based on a Q-Learning genetic algorithm.

[0090] like Figure 1 As shown, the first embodiment of the present invention proposes a method for optimizing the assembly parameters of flexible cables based on the Q-Learning genetic algorithm, including the following steps S1-S3.

[0091] S1. The moving cable model is obtained by physically modeling the moving cable based on the static model of the elastic thin rod. Among them, the Kirchhoff equation under the action of no distributed force is first established based on the cable equilibrium state constraint. Then, based on the Kirchhoff equation under the action of no distributed force, the influence of surface contact force and external distributed force on the cable motion is considered to obtain the Kirchhoff equation considering the action of distributed force.

[0092] To simplify the analysis, this study focuses on bending and torsional deformation (bending twist), neglecting tensile and shear effects. The active cable model should satisfy the following cable equilibrium constraints:

[0093] Cross-sectional geometric symmetry: The cross-section of the moving cable is uniform, and the two principal axis directions have the same geometric dimensions;

[0094] Initial state regularity: In the relaxed state, the cable is straight with zero initial curvature and twist.

[0095] Simplified contact mechanics: neglecting the friction between the cable and the plane;

[0096] Constitutive consistency of materials: The cable is a homogeneous isotropic material with constant elastic constants, and stress and strain satisfy linear constitutive relations.

[0097] To better describe the attitude and stress conditions of flexible moving cables under various circumstances, this invention employs a modeling method based on Kirchhoff's elastic rod theory. Using calculus principles, the moving cable is divided into multiple extremely small arc-shaped units. The physical characteristics of these arc segments are analyzed to obtain the key physical quantities of the equilibrium state of each segment. After integration, the overall equilibrium characteristics of the moving cable, including its spatial shape and stress conditions, can be obtained.

[0098] In one specific embodiment, assuming no twist or original curvature, the Kirchhoff equation for the flexible moving cable under no distributed force is:

[0099]

[0100]

[0101] in, This indicates the bending stiffness of the cable in the x-axis direction; This indicates the bending stiffness of the cable in the y-axis direction; This indicates the bending stiffness of the cable in the z-axis direction; This indicates the internal force exerted on the cross section at point Pa on the cable by the adjacent cross section in the x-axis direction; This indicates the internal force exerted on the cross section at point Pa on the cable by the adjacent cross section in the y-axis direction; This indicates the internal force exerted on the cross section at point Pa on the cable by the adjacent cross section in the z-axis direction; This indicates the degree of torsion of the cable in the x-axis direction; This indicates the degree of torsion of the cable in the y-axis direction; This indicates the bending twist of the cable in the z-axis direction.

[0102] Solve the Kirchhoff equation to obtain , , and , , This allows us to obtain the orientation of the cross-section in space. In practical applications, by utilizing the geometric constraints at both ends of the moving cable, we can determine the boundary conditions of the system, thus transforming the problem into a boundary value problem of solving the Kirchhoff equation.

[0103] The Kirchoff equation has six unknown variables, which can be addressed using Euler quaternions. , , and These variables are expressed uniformly. Euler quaternions follow the following rules:

[0104]

[0105] Define a new set of variables , , and In order to represent , , and The derivative of the arc coordinate s is represented by the symbol:

[0106]

[0107] By introducing the theory of rigid bodies undergoing small, wireless rotations in space, a mathematical model can be established to relate the bending twist ω of the cable to... , , and as well as , , and In connection, the specific expression is as follows:

[0108]

[0109] Neglecting the existence of distributed forces, the principal vector F of the cross-section force is a constant and collinear with the ζ-axis in the inertial coordinate system (O-ξηζ), where the direction of F is opposite to the direction of gravity. Based on the above derivation, the three components of F in the principal axis coordinate system (P-xyz) can be further derived. , , The relationship with Euler quaternions is as follows:

[0110]

[0111] Where F0 is the modulus of the force applied at the end of the cable.

[0112] By combining Euler quaternions, we can obtain the formula for calculating the spatial pose of the moving cable in (O-ξηζ):

[0113]

[0114] Where σ is a variable in the integration process. Substituting the solution of the Kirchhoff equilibrium equation into the above equation, we can obtain:

[0115]

[0116] Where, q a,bIn this context, 'b' represents the node number, 'k' is the index value, and 'a' represents the Euler quaternion number. 'Δs' is determined by the point selection method. Based on this, the coordinates of all nodes in the cable can be determined using the Euler quaternion and 'Δs'.

[0117] The Kirchhoff equation mentioned above only considers the interaction forces between the cable segments and assumes that the cable moves without any external force. It does not consider the influence of surface contact force and external distributed force on the cable movement, which leads to the inability to accurately reflect the contact effect between the cable and external objects.

[0118] In the force analysis model of a movable cable segment considering distributed forces, the movable cable is affected by gravity and surface contact forces in three-dimensional space. To analyze the force balance of the cable segment, gravity... f g Surface contact force acting along the ζ-axis direction f p The direction is consistent with the normal to the contact surface and parallel to the ζ-axis. Therefore, considering gravity and contact surface constraints, the mechanical equilibrium equations considering the distributed forces are as follows: These equations include two parts: moment equilibrium and force equilibrium equations:

[0119]

[0120] Where ΔM is the change in torque, and F is the net external force (including gravity). f g Surface contact force f p Let Δr be the displacement change of the cable element, Δs be the arc coordinate increment, and f represent the gravity per unit arc length. The projected force balance equations can be obtained as follows:

[0121]

[0122] in, f 1. f 2 and f 3 represent the force distributed along each axis when the force F is projected onto the principal axis coordinate system (P-xyz) of the cross section.

[0123] By introducing Euler parameters to transform between the principal axis coordinate system and the three-dimensional inertial coordinate system, the direction cosine matrix of each axis can be obtained. as follows:

[0124]

[0125] in, It is the first principal axis coordinate system i a The first axis of the inertial coordinate system j a The angle between axes.

[0126] The net external force F is the resultant force of gravity and surface constraint forces. Since the directions of gravity and surface constraint forces are fixed and known, they can be decomposed into three axes in a three-dimensional inertial coordinate system (O-ξηζ). Then, the direction cosine matrix expressed by Euler parameters is used. By further decomposing the gravity and surface constraint forces into the three axes of the principal axis coordinate system (P-xyz), the component expressions of the distributed forces in the three axes are obtained:

[0127]

[0128] The absolute value of the surface constraint force fp in the above formula is the eighth unknown in the cable infinitesimal equation system. Simultaneously, the resultant force of the surface constraint force in the tangential direction is zero. Therefore, the surface constraint equation can be expressed as:

[0129]

[0130] in, The first in the direction cosine matrix i a row and number j a Column elements; f g The known magnitude of the weight of the cable element; , , These represent the cosine values ​​of gravity along the ξ, η, and ζ axes, respectively. , , The values ​​represent the cosine values ​​of the surface constraint forces along the ξ-axis, η-axis, and ζ-axis, respectively.

[0131] S2. Based on the Kirchhoff equation considering the distributed force, determine the pose of the moving cable and the solution method for the disturbance torque.

[0132] Motion simulation of flexible moving cables essentially involves solving for the pose of the cable at discrete moments throughout its motion, based on a physical model of the cable, thereby obtaining the overall shape of the cable. Since the cable pose solution includes differential terms, the differential equations need to be transformed into discrete numerical values ​​for computation by a computer. Specifically, the solution domain is discretized to generate discrete points, and the derivative value is approximated by a weighted sum of these points. Finally, the formulas used to solve the model are obtained, which take the form of an overdetermined system of algebraic equations.

[0133] The LM algorithm is used to solve the overdetermined algebraic equations. The cable assembly parameters that need to be substituted into the model include bending stiffness, torsional stiffness, cable length, and the position of the cable fixing end. P 0 = (p1, p2, p3) and the position of the moving end of the cable. Pl =(r1,r2,r3).

[0134] The general approach to solving overdetermined algebraic equation systems is to transform them into nonlinear optimization problems. After equation transformation and handling boundary conditions, the differential equation system becomes an overdetermined algebraic equation system, and solving the overdetermined algebraic equation system can be transformed into a nonlinear optimization problem. The LM algorithm is a numerical method widely used for solving nonlinear optimization problems. It iteratively updates variables by minimizing the objective function (usually the sum of squared residuals constructed from the algebraic equation system) to gradually approach the optimal solution; the specific solution method will not be elaborated here.

[0135] In the algorithm of this invention, the disturbance torque is calculated by projecting the principal vector F of the cable end element onto an auxiliary vertical plane perpendicular to the moving surface. This process simulates the dynamic response of the cable, such as torsion and bending, caused by the external environment. By calculating the product of force and lever arm, the disturbance torque generated by the element on the system can be obtained, which describes the rotational effect of the force on the system. Furthermore, the calculation of the disturbance torque is crucial for verifying the accuracy of the model. Through the calculation of this torque, the force situation of the cable under different motion states can be analyzed, thereby evaluating the feasibility of the proposed moving cable model in practical applications.

[0136] Specifically, the calculation method for the interference torque M of a single cable is as follows:

[0137]

[0138] in, , , These are the components of the cable's movable end element in the inertial coordinate system. , , The coordinates projected onto the auxiliary vertical plane; , , They are respectively with , , The corresponding lever arm length.

[0139] It should be noted that the theoretical analysis of the above steps S1 and S2 can be understood and extended by those skilled in the art by referring to the Chinese invention patent application number 202410303736.X, and the specific content will not be repeated here.

[0140] S3. Optimize cable assembly parameters based on Q-Learning genetic algorithm; the optimization objective is set to minimize the interference torque caused by multiple cables by adjusting the cable assembly parameters; the optimized cable assembly parameters include bending stiffness, torsional stiffness, cable length and cable end positions.

[0141] When multiple cables act on a platform, the optimization model becomes complex due to the coupling of their torques. Theoretically, when the directions of the interfering torques are consistent, multiple cables can be treated as a single cable for optimization. However, in practice, the directions of the interfering torques are usually different, requiring optimization of the entire system. Ordinary optimization methods face the problem of "combinatorial explosion," where the computational load surges as the number of cables increases, making it difficult for traditional methods to provide accurate solutions. Therefore, research has shifted towards finding satisfactory solutions, and evolutionary algorithms, especially genetic algorithms, have become an effective choice. Genetic algorithms simulate biological evolution, optimizing the solution space through crossover and mutation operations, and can approach the optimal solution without traversing all solutions, making them suitable for multi-objective optimization problems. The key lies in the design of the encoding strategy, selection operators, and termination conditions.

[0142] Q-Learning is a reinforcement learning algorithm that learns to dynamically adjust parameters to achieve better decisions through continuous interaction with the environment. By introducing Q-Learning, the algorithm can adaptively adjust the crossover and mutation rates in the genetic algorithm based on the current state of the population (such as population diversity and evolutionary stage), thereby enhancing its ability to balance exploration and development. When population diversity is high, Q-Learning can choose a higher mutation rate to encourage more exploration; while when the population is gradually converging, Q-Learning can choose a lower mutation rate to promote rapid convergence to the global optimum. This dynamic adjustment mechanism effectively avoids the algorithm getting trapped in local optima, accelerates the optimization process, and significantly improves the efficiency of genetic algorithms in solving complex problems.

[0143] Specifically, based on the physical model and numerical solution process of the flexible cable established in steps S1 and S2, we can obtain the spatial orientation and stress conditions of the cable. During operation, the cable is subjected to external disturbance forces and torques, which affect its behavior, especially during assembly. We focus on the disturbance torque, which is the rotational effect of the cable caused by external forces and torques. Excessive disturbance torque may lead to inaccurate assembly, cable wear, or performance degradation.

[0144] The objective function in the Q-Learning genetic algorithm is:

[0145]

[0146] in, This represents the total interference torque of n cables; This represents the interference force of the i-th cable; Let represent the lever arm length of the interference force of the i-th cable; our optimization objective is to minimize by adjusting the assembly parameters of each cable (such as bending stiffness, torsional stiffness, length, etc.). This refers to the sum of disturbance torques. By optimizing these parameters, assembly errors and system instability caused by torque can be reduced.

[0147] In some embodiments, step S3 includes the following steps S31-S36.

[0148] S31. Encode the physical characteristics of the cable assembly parameters using symbolization and piecewise functions.

[0149] In traditional genetic algorithm applications, common encoding methods include binary encoding and real number encoding. While binary encoding is suitable for discrete problems, for continuous parameters (such as stiffness and length), the conversion process is complex and unintuitive, resulting in low computational efficiency. Real number encoding can represent continuous parameters more directly, but it still suffers from insufficient precision and flexibility. Especially in complex engineering optimization problems, the setting of static parameters can easily lead the algorithm into local optima.

[0150] This invention provides a novel encoding method called piecewise expression encoding. Its core idea is to encode the physical characteristics of cable assembly parameters through symbolization and piecewise functions, so as to better map the relationship between assembly parameters and cable physical behavior, thereby enabling efficient optimization in genetic algorithms.

[0151] In this embodiment, each assembly parameter (such as bending stiffness, torsional stiffness, cable length, and end positions) is encoded using a piecewise function. This encoding method not only accurately represents the assembly parameters but also dynamically reflects changes in the assembly parameters under different operating conditions. Specifically, each assembly parameter is mapped to an actual physical quantity through a piecewise function, thereby achieving adaptive optimization in the genetic algorithm.

[0152] In one specific embodiment, step S31 includes:

[0153] Bending stiffness parameters ( , , The stiffness of the cable along different axes varies with angles or assembly conditions. Bending stiffness is represented by a piecewise function, including:

[0154]

[0155] in, This indicates the bending stiffness of the cable in the x-axis direction; This indicates the bending stiffness of the cable in the y-axis direction; This indicates the bending stiffness of the cable in the z-axis direction; This indicates the bending angle of the cable along the x-axis during assembly. This indicates the bending angle of the cable in the y-axis direction during assembly; This indicates the bending angle of the cable in the z-axis direction during assembly; This represents the encoding result of the cable's bending stiffness in the x-axis direction; This represents the encoded result of the cable's bending stiffness in the y-axis direction; This represents the encoded result of the cable's bending stiffness in the z-axis direction; and These represent the set values ​​of the bending stiffness of the cable under different bending states in the x-axis direction; and These represent the set values ​​of the bending stiffness of the cable under different bending states in the y-axis direction; and These represent the set values ​​of the bending stiffness of the cable under different bending states in the z-axis direction; if is a conditional decision operator;

[0156] Torsional stiffness varies with the torsional angle. It is represented by a piecewise function, including:

[0157]

[0158] in, Indicates the torsional stiffness of the cable; The encoding result represents the torsional stiffness of the cable; Indicates the twist angle of the cable; and These represent the set values ​​of torsional stiffness of the cable under different torsion angle ranges;

[0159] The cable length is represented by a linear function, including:

[0160]

[0161] Where L represents the cable length; The encoded result represents the cable length; d represents the actual length under dynamic deformation; c represents the fixed length.

[0162] Specifically, the cable length L is determined by both the fixed length c and the actual length d under dynamic deformation. During assembly, dynamic deformations such as bending and twisting cause d ≠ L. This change can be represented by a piecewise function:

[0163] The relationship between bending stiffness and bending angle: The bending stiffness of a cable adjusts with the change of bending angle, which directly affects its ability to resist bending deformation.

[0164] Relationship between torsional stiffness and torsion angle: Torsional stiffness is related to the torsion angle through a piecewise function, which determines the deformation characteristics of the cable under torsion.

[0165] The dynamic relationship between the above stiffness parameters and angles works together to affect the actual length of the cable, reflecting the variation pattern of the cable length.

[0166] The cable has two ends: a fixed end and a movable end; the positions of the cable ends are represented using three-dimensional coordinates, including:

[0167]

[0168] in, This indicates the fixed end of the cable, and its coordinates are... ; This indicates the active end of the cable, with coordinates as follows: These coordinate information can be used to accurately describe the geometry of the cable.

[0169] Solving the problem using the LM algorithm requires an initial solution x0 for a set of cable poses. If the cable is divided into m segments, the infinitesimal element of the j-th segment can be represented as:

[0170]

[0171] Here, each parameter represents the three components of the external force F acting on the j-th infinitesimal element in the principal axis coordinate system (P-xyz). , , And its corresponding Euler quaternion.

[0172] By mapping the cable assembly parameters to piecewise functions, we can construct a genetic expression for each cable. Each chromosome represents an assembly scheme, containing all combinations of assembly parameters. Therefore, the genetic expression constructed for each cable based on the encoding results is:

[0173]

[0174] in, This represents the encoding of assembly parameters for a single cable, i.e., the gene expression. This represents the initial solution for the cable pose.

[0175] For an assembly system containing n cables, the assembly parameters for each cable are... Expanded into a vector, representing all assembly parameters of the entire system; that is, the encoding of the entire system. It is a vector set consisting of the assembly parameters of n cables, represented as:

[0176]

[0177] in, This represents the encoding result of the i-th cable, where i = 1, 2, ..., n. These assembly parameters are encoded using piecewise functions and geometric position mappings, forming the optimization solution space for the entire cable system.

[0178] Unlike traditional real-number encoding and binary encoding, the piecewise expression encoding method of this invention can directly correlate physical characteristics with changes in assembly parameters, providing a more intuitive and efficient optimization method. This piecewise function expression approach can accurately describe the changes in assembly parameters under different operating conditions, thus avoiding the precision loss that may occur in traditional methods. Furthermore, this encoding method performs calculations directly in physical space, avoiding the complex decoding process required in traditional encoding and improving computational efficiency.

[0179] This more intuitive and precise representation of assembly parameters not only breaks through the limitations of traditional encoding methods but also provides physical support for optimization algorithms, making the optimization process more in line with actual needs. It also lays a solid foundation for subsequent fitness evaluation and parameter adjustment. This innovative encoding method enables the optimization method of this invention to better adapt to the multidimensional and nonlinear characteristics of flexible cable assembly parameters, effectively improving the application effect of genetic algorithms in large-scale optimization problems.

[0180] S32. Initialize the population according to preset constraints; wherein, the assembly parameters of each node on the cable are set as the gene values ​​of individuals in the population; the preset constraints include: the positions of both ends of the cable need to meet the geometric constraints of the assembly space, and the physical parameters of the cable are within the set range.

[0181] Specifically, the initial population is constructed through a random generation process, and the gene values ​​of each individual (i.e., the parameters of each node) are initialized according to preset constraints.

[0182] The first step in initialization is to determine the population size, which is the number of individuals in the genetic algorithm. Generally, a larger population size results in a stronger search capability for the algorithm, but also increases the computational cost. An appropriate population size can be chosen based on the complexity of the problem and the limitations of computational resources.

[0183] Bending stiffness represents a cable's resistance to bending in different directions. A reasonable range for bending stiffness is set based on the cable's design requirements and material properties, typically within the range [0.5, 1]. Torsional stiffness describes a cable's resistance to torsion; this value is usually set within a range based on the cable's diameter and material properties.

[0184] The initial solution consists of the Euler angle parameters and distributed force for each cable element. Each individual element comprises several parameters, including force components and Euler angles. The distributed force components are randomly generated within a small neighborhood of 0, simulating the minute effects of the force. The Euler angle parameter values ​​are constrained to the range (-1, 1) and conform to the normalization constraint, i.e., the sum of the squares of these values ​​is 1.

[0185] The randomly generated initial units must satisfy any physical and geometric constraints that may exist during the assembly process. For each unit, the positions of both ends of the cable must satisfy the geometric constraints of the assembly space, such as the maximum and minimum distance limits between the fixed and moving ends. Ensure... Within acceptable limits, avoid placing the two ends too close or too far apart. The physical parameters of the cable, such as bending stiffness and torsional stiffness, should be within reasonable ranges to avoid generating solutions that do not conform to physical properties.

[0186] Population diversity is crucial for the success of genetic algorithms. After initializing the population, it's necessary to check whether the individuals in the initial population can effectively cover different regions of the assembly parameter space. Insufficient population diversity may cause the algorithm to converge prematurely and get trapped in local optima. Therefore, checking population diversity and adjusting the generation strategy as needed, adding more random individuals, ensures population breadth.

[0187] After generating the initial population, we also need to evaluate its quality. The evaluation criteria include:

[0188] The fitness of each individual, that is, its performance in the optimization objective;

[0189] Are the parameter ranges of the initial population reasonable and do they meet the assembly requirements?

[0190] The aforementioned population initialization steps not only ensure the physical rationality of the initial population but also enhance population diversity through a carefully designed initialization strategy. This initialization method provides a more efficient and stable starting point for the genetic algorithm's optimization process, ensuring that the optimization process can find the optimal solution within a reasonable timeframe and reducing the waste of computational resources.

[0191] S33. Set the fitness function in the Q-Learning genetic algorithm; wherein, a penalty term for measuring the degree to which an individual violates the constraints is added to the fitness function.

[0192] Specifically, the fitness function in the Q-Learning genetic algorithm is set as follows:

[0193]

[0194] Where M(X) represents the objective function value corresponding to individual cable X; This represents the maximum value of the objective function in the current population. This represents the minimum value of the objective function in the current population, ensuring that the fitness value is within the range of [0,1]. This represents the penalty coefficient, used to control the impact of the penalty term; It represents the degree of violation by individual X under the i-th constraint. If the individual satisfies the constraint, then... ,otherwise ; m represents the total number of constraints.

[0195] In actual cable assembly, assembly parameters are not only affected by disturbance torques, but must also meet a series of physical and geometric constraints. For example, the cable length should not be too short to avoid the cable being too taut; the values ​​of parameters such as bending stiffness and torsional stiffness need to meet physical characteristics; and the positions and angles of the cable ends need to meet actual assembly requirements.

[0196] In the fitness function described above, normalization ensures the fitness value falls within the range of [0,1]. A smaller objective function value results in higher fitness. Adding a penalty term inflicts additional punishment on individuals violating constraints, thus reducing their fitness. The intensity of the penalty can be controlled by adjusting the penalty coefficient. Individuals with higher fitness are more likely to be selected for the next generation. During the selection process, the penalty term gradually eliminates individuals violating constraints in the evolutionary process. When the optimization problem has multiple constraints, using a penalty term effectively handles these constraints and prevents the algorithm from selecting invalid solutions.

[0197] This method, which integrates the optimization objective of disturbance torque with assembly constraints to construct a fitness function, and supplements it with a penalty term mechanism and objective normalization strategy, enables the genetic algorithm to efficiently achieve multi-objective collaborative optimization in the optimization of flexible cable assembly parameters. It significantly reduces disturbance torque while strictly ensuring the engineering feasibility of assembly parameters. This method effectively improves the stability and convergence efficiency of the optimization process, ultimately providing a reliable guarantee for obtaining the globally optimal solution that meets actual engineering requirements.

[0198] S34. Determine the crossover and mutation adaptive strategy based on Q-Learning; wherein, the parameters in the genetic algorithm are dynamically adjusted according to the fitness differences and diversity of the population.

[0199] In traditional genetic algorithms, parameters (such as crossover rate and mutation rate) are usually fixed, lacking flexibility and adaptability, and unable to be adjusted according to dynamic changes in the problem. This leads to genetic algorithms easily getting trapped in local optima when optimizing assembly parameters, reducing search efficiency, and even failing to find the global optimum. Especially in the optimization of flexible cable assembly, assembly parameters are closely related to mechanical properties, and there are complex interrelationships between parameters. Traditional algorithms struggle to effectively handle these complex assembly requirements when exploring the solution space.

[0200] To address these issues, this invention proposes an adaptive strategy based on a Q-Learning genetic algorithm. By dynamically adjusting key parameters in the genetic algorithm, particularly the crossover and mutation rates, the Q-Learning-based genetic algorithm can adaptively adjust its search strategy during the evolutionary process, thereby more efficiently solving the problem of optimizing flexible cable assembly parameters.

[0201] Because the cable assembly optimization problem has a multidimensional and nonlinear solution space, and requires consideration of the relationship between assembly parameters (such as bending stiffness, torsional stiffness, and cable length) and minimizing disturbance torque, while satisfying a series of physical and geometric constraints, efficiently exploring the solution space and avoiding getting trapped in local optima becomes a key challenge. By introducing Q-Learning, the genetic algorithm can dynamically adjust parameters based on the fitness differences and diversity of the population, making reasonable decisions at different evolutionary stages, thereby improving the optimization effect and ensuring that the global optimum is finally obtained.

[0202] In one specific embodiment, step S34 includes:

[0203] The core of Q-Learning is state-based evaluation and adjustment. In the optimization process of genetic algorithms, the state reflects the fitness distribution and diversity of the population, factors crucial for optimizing cable assembly parameters. In traditional genetic algorithms, when population diversity is low, the algorithm is prone to getting trapped in local optima; while when diversity is high, overexploration may lead to an increase in invalid solutions, thus reducing computational efficiency.

[0204] In each generation of evolution, Q-Learning calculates the current evolutionary state S based on the fitness differences and diversity of the population. This assessment helps determine whether the population is too concentrated (low diversity) or too dispersed (high diversity), thus deciding whether to adjust the selection strategy. The current evolutionary state S of the population can be defined by the difference between the fitness of the optimal solution and the fitness of the current solution.

[0205] Specifically, the current evolutionary state is calculated based on the fitness differences and diversity of the population. The calculation methods include:

[0206]

[0207] Here, S represents the current evolutionary state of the population; B represents the number of solutions in the population that are identical to the current best solution; and P represents the total population size. The state S reflects the diversity of the population; when the difference is large, the state is close to π / 2, and when the difference is small, the state is close to 0. This state value allows us to determine whether we are currently in the exploration or convergence phase, thereby dynamically adjusting the crossover rate and mutation rate to optimize cable assembly parameters.

[0208] Action sets are constructed based on the combinations of crossover rate and mutation rate values, forming a Q-table.

[0209] The action definition involves the crossover rate p c and the rate of variation p m The choice of crossover rate p. c and the rate of variation p m The choice of crossover rate directly affects the exploration and convergence capabilities of the genetic algorithm. The crossover rate determines the frequency of gene exchange between parents, while the mutation rate determines the probability of gene mutation in each individual. During assembly, the needs differ at different stages; earlier stages require more mutation to increase diversity, while a higher crossover rate is needed to accelerate optimization during convergence.

[0210] Specifically, the crossover rate p c and the rate of variation p m The range of values ​​for is as follows:

[0211]

[0212] These values ​​are combined to form the action set A. During the optimization process of each generation, the optimal combination of crossover rate and mutation rate can be selected from the Q table Q(S,A) based on the current evolutionary state S of the population.

[0213] Based on the current evolutionary state of the population, the optimal combination of crossover rate and mutation rate is selected from the Q table; among which, the ε-greedy strategy is used to select the optimal action.

[0214] Among them, when the population diversity is high, Q-Learning selects a larger variation rate p. m This increases the breadth of exploration and avoids premature convergence. As the population gradually converges, Q-Learning selects a higher crossover rate p. c and a smaller variation rate p m This accelerates convergence and ensures the discovery of the global optimum. Specifically, when selecting the optimal action, an ε-greedy strategy is adopted, which means selecting the combination of crossover rate and mutation rate that maximizes the Q value in the current state with probability 1-ε, thereby balancing exploration and exploitation; and randomly selecting the combination of crossover rate and mutation rate with probability ε to maintain a certain degree of exploration.

[0215] Based on the selected combination of crossover and mutation rates, the reward value for the selected action is calculated. The reward value *r* measures the effect of a particular combination (crossover and mutation rates). If the population's fitness improves after evolution following this combination, a positive reward is given; otherwise, a negative reward is given. Specifically, the reward value calculation method includes:

[0216]

[0217] Where r represents the reward value; This represents the optimal solution before updating the population; This represents the optimal solution after crossover and mutation.

[0218] The Q-Learning update formula is used to update the values ​​in the Q-table, ensuring that after each iteration, the Q-value for each action in the Q-table reflects its long-term gain in that state. The update process includes:

[0219]

[0220] Where Q(S,A) represents the Q-table; α Indicates the learning rate; This indicates possible combinations of actions for the next generation; Indicates a new state; This represents the discount factor, which measures the importance of future rewards.

[0221] After several iterations, the final Q-table result is obtained, which is used to adaptively adjust the genetic crossover mutation rate under different states.

[0222] S35. Select excellent individuals from the current population according to the fitness function to generate an intermediate population; wherein, a roulette wheel selection mechanism based on fitness adjustment is adopted, combined with Q-Learning to dynamically adjust the selection probability.

[0223] In genetic algorithms, selection operators simulate the "survival of the fittest" principle in nature. Their main function is to select high-performing individuals from the parent population and ensure that their superior genes are passed on to the next generation, thereby promoting the overall quality improvement of the new generation. Traditional selection methods (such as roulette and tournament selection) rely on the fitness value of individuals, typically selecting individuals with higher fitness through a certain probability. However, in the cable assembly parameter optimization problem, the optimization objective is not only to minimize the disturbance torque but also to satisfy multiple physical and geometric constraints. To ensure that a solution that meets actual assembly requirements is found, the selection process needs to be more flexible and precise.

[0224] In Q-Learning-based genetic algorithms, the selection operator still simulates the "survival of the fittest" principle in nature. Its main function is to select high-performing individuals from the parent population and ensure that the superior genes of these individuals are passed on to the next generation. However, unlike traditional genetic algorithms, Q-Learning-based selection operators can dynamically adjust the selection strategy based on the state and evolutionary stage of the population. This adaptive mechanism can automatically adjust the crossover and mutation rates according to different evolutionary stages, balancing exploration and development, and accumulating experience through learning, enabling the algorithm to improve diversity in the early stages and accelerate convergence in the later stages.

[0225] In one specific embodiment, step S35 includes:

[0226] All individuals in the current population are sorted according to their fitness; usually in descending order.

[0227] Based on the ranking, each individual is given a choice probability as follows:

[0228]

[0229] in, Indicates the ranking of an individual; Indicates population size; Indicates the selection of pressure parameters; Indicates an individual ID; dynamically adjusted. This is used to control population diversity and convergence speed. By dynamically adjusting the λ parameter, both population diversity and convergence speed can be controlled. Smaller... A higher fitness value increases population diversity, giving individuals with low fitness a higher probability of being selected; while a higher fitness value increases population diversity. The value emphasizes individuals with higher fitness, promoting rapid population convergence.

[0230] A roulette wheel selection mechanism based on fitness adjustment is adopted, combined with Q-Learning to dynamically adjust the selection probability; wherein, the selection probability is dynamically adjusted according to the state of the population.

[0231] In traditional genetic algorithms, the roulette wheel selection mechanism is used to determine the probability of selection for each individual based on its fitness. However, in the cable assembly parameter optimization problem, due to the complex relationships between assembly parameters, the traditional roulette wheel selection mechanism may lead to a rapid loss of population diversity or premature convergence. To address this, this disclosure proposes a fitness-adjusted roulette wheel selection mechanism that combines Q-Learning to dynamically adjust the selection probability, thereby optimizing the generation of solutions in each generation.

[0232] Guided by the Q-Learning adaptive strategy, the roulette wheel selection mechanism not only relies on the fitness of individuals but also dynamically incorporates the satisfaction of assembly constraints and physical conditions into the calculation of selection probabilities. By combining fitness and constraint satisfaction, we can ensure that excellent individuals in the population are appropriately selected and avoid generating invalid solutions due to unmet constraints.

[0233] The probability of choosing a roulette wheel option consists of two parts:

[0234] (1) Fitness factors;

[0235] An individual's fitness value directly affects its probability of being selected. Individuals with higher fitness are positioned higher on the roulette wheel, and their probability of being selected increases accordingly.

[0236] (2) Constraint satisfaction factors;

[0237] To ensure the rationality of assembly parameters, the selection probability is adjusted based on the constraint satisfaction when individuals meet physical and geometric constraints. For example, individuals that violate constraints are assigned a lower selection probability, thus preventing them from entering the next generation.

[0238] By introducing Q-Learning, the newly designed roulette wheel mechanism can dynamically adjust the selection probability based on the population state S. Specifically, at different stages of the evolutionary process:

[0239] (1) Exploration stage (high population diversity);

[0240] Q-Learning increases the diversity of individual choices, adjusts the selection range of the roulette wheel, and ensures that individuals with low fitness also have a certain probability of being selected, thereby promoting more exploration.

[0241] (2) Convergence phase (population tends to be uniform);

[0242] Q-Learning reduces the selection range and increases the selection probability of highly fit individuals, thereby accelerating convergence and helping the algorithm quickly find the optimal solution.

[0243] In one specific embodiment, the selection principle of the fitness-based roulette wheel betting mechanism includes:

[0244] Individuals with higher fitness levels are positioned higher on the roulette wheel and have a greater probability of being selected.

[0245] Individuals who violate the constraints will be assigned a lower probability of selection;

[0246] Determine whether the population is currently in the exploratory or convergent phase based on its current evolutionary state; in the exploratory phase, expand the selection range of the roulette wheel; in the convergent phase, reduce the selection range of the roulette wheel.

[0247] This dynamically adjusted roulette wheel mechanism effectively balances the needs of exploration and convergence, ensuring that the genetic algorithm can adaptively select the most suitable individuals for reproduction at different stages. Furthermore, by comprehensively considering individual fitness and constraint satisfaction, and adaptively adjusting the selection probability based on the population's evolutionary state, the performance of the genetic algorithm in optimizing flexible cable assembly parameters is significantly improved. This ensures that the algorithm can efficiently perform global searches in complex assembly constraints and multidimensional solution spaces, avoiding local optima and quickly converging to the global optimum.

[0248] S36. Based on selection, crossover, and mutation operations, new individuals are generated to continuously evolve the population, improve the population fitness, and approach the optimal solution until a predetermined stopping criterion is reached.

[0249] Iterative iteration is one of the core steps of a genetic algorithm. In each generation, selection, crossover, and mutation operations continuously evolve the population by generating new individuals. As the iteration progresses, the fitness of the population gradually improves, eventually approaching the optimal solution. In the problem of optimizing flexible cable assembly parameters, the algorithm iteratively adjusts the assembly parameters until a predetermined stopping criterion is reached.

[0250] In one specific embodiment, step S36 includes:

[0251] In each iteration, individuals with high fitness are first selected and added to the breeding pool through a selection operation; then, new individuals are generated through crossover and mutation operations; finally, the fitness of the new individuals is evaluated, and the population is updated. During the iteration process, Q-Learning dynamically adjusts the crossover and mutation rates based on the population state to ensure a balance between exploration and convergence during the optimization process.

[0252] The predetermined stopping criteria, i.e., the algorithm termination conditions, include:

[0253] Reaching the maximum number of iterations;

[0254] Or, the population fitness reaches a set threshold;

[0255] Alternatively, the population fitness changes little over several generations, indicating that the algorithm has converged.

[0256] Q-Learning adaptively adjusts the crossover and mutation rates based on the population state in each iteration, ensuring the algorithm can adapt to the optimization process at different stages. In the early stages, Q-Learning increases the mutation rate to enhance exploration; while in the later stages, Q-Learning decreases the mutation rate and increases the crossover rate to accelerate convergence.

[0257] Through continuous iterative iteration, the genetic algorithm can gradually improve the fitness of the population and eventually converge to the optimal solution. During the iteration process, the Q-Learning adaptive strategy dynamically adjusts the key parameters of the genetic algorithm to ensure that the population maintains an optimal balance between exploration and convergence, thus promoting the efficient optimization process.

[0258] In some embodiments, step S3 further includes S37.

[0259] S37. Evaluate the final solution and adjust the cable assembly parameters as needed.

[0260] The final solution evaluation is the last step in the genetic algorithm, aiming to find the optimal solution from the final population and comprehensively assess its quality. In the flexible cable assembly parameter optimization problem, the final solution must not only minimize the disturbance torque but also satisfy the assembly constraints.

[0261] In some embodiments, step S37 specifically includes:

[0262] The fitness of the final solution is calculated to ensure it meets a set threshold. After multiple iterations, the algorithm evaluates each individual in the final population based on the fitness function. The fitness function assesses the quality of the solution by minimizing disturbance torques and penalizing violations of constraints. The final solution is the individual with the highest fitness, representing the optimal combination of cable assembly parameters.

[0263] The assembly parameters in the final solution are adaptively adjusted based on the usage environment. For the optimal solution, some parameters may need to be fine-tuned according to actual assembly requirements. For example, the bending stiffness and torsional stiffness of the cable may need to be appropriately adjusted according to the usage requirements in different environments to ensure optimal performance matching.

[0264] After obtaining the optimal solution, it needs to be verified to ensure that it can achieve the expected performance during actual assembly. In flexible cable assembly, the optimal solution should effectively reduce interference torque while satisfying various physical and geometric constraints during the assembly process.

[0265] In practical applications, the optimization results may be adjusted based on changes encountered during the actual assembly process. The Q-Learning adaptive strategy can adjust the optimization process based on new feedback, ensuring that the cable assembly parameters are always in an optimal state.

[0266] Other embodiments of the present invention provide a computer device including a processor and a memory, wherein the memory stores a computer program that, when loaded and executed by the processor, implements the flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm as described in any of the above embodiments.

[0267] Other embodiments of the present invention provide a computer-readable storage medium storing a program that, when loaded by a processor, implements the flexible cable assembly parameter optimization method based on the Q-Learning genetic algorithm as described in any of the above embodiments.

[0268] In this specification, the illustrative expressions of the terms used do not necessarily refer to the same embodiments or examples. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0269] Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this invention shall be included within the scope of protection of this invention.

Claims

1. A flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm, characterized in that, The application comprises: a physical modeling of the active cable based on an elastic slender rod static model to obtain an active cable model; wherein, based on the cable balance state constraint, a Kirchhoff equation under the action of no distribution force is first established, and then a Kirchhoff equation under the action of distribution force is obtained by considering the influence of surface contact force and external distribution force on the cable movement; based on the Kirchhoff equation under the action of distribution force, a method for solving the active cable pose and disturbance torque is determined; optimizing the cable assembly parameters based on a Q-Learning genetic algorithm; wherein, the optimization goal is set to minimize the disturbance torque caused by multiple cables by adjusting the cable assembly parameters; the optimized cable assembly parameters include bending stiffness, torsional stiffness, cable length and cable end position; the optimization of the cable assembly parameters based on the Q-Learning genetic algorithm comprises: encoding the physical properties of the cable assembly parameters by symbolization and piecewise function; initializing the population according to the preset constraint condition; wherein, the assembly parameters of each node on the cable are set as the gene values of the individuals in the population; the preset constraint condition includes that the positions of the two ends of the cable need to meet the geometric constraint of the assembly space, and the physical parameters of the cable are within the set range; setting the fitness function in the Q-Learning genetic algorithm; wherein, a penalty term for measuring the degree of constraint violation of the individual is added in the fitness function; determining the cross-variation adaptive strategy based on Q-Learning; wherein, the parameters in the genetic algorithm are dynamically adjusted according to the fitness difference and diversity of the population; selecting excellent individuals in the current population according to the fitness function to generate an intermediate population; wherein, a roulette mechanism based on fitness adjustment is adopted, and the selection probability is dynamically adjusted combined with Q-Learning; new individuals are generated based on selection, crossover and mutation operations to continuously evolve the population, improve the fitness of the population, and approach the optimal solution until the predetermined stopping standard is reached; the encoding of the physical properties of the cable assembly parameters by symbolization and piecewise function comprises: the bending stiffness is represented by a piecewise function, including: wherein, represents the bending stiffness of the cable in the x-axis direction; represents the bending stiffness of the cable in the y-axis direction; represents the bending stiffness of the cable in the z-axis direction; represents the bending angle of the cable in the x-axis direction during assembly; represents the bending angle of the cable in the y-axis direction during assembly; represents the bending angle of the cable in the z-axis direction during assembly; represents the encoding result of the bending stiffness of the cable in the x-axis direction; represents the encoding result of the bending stiffness of the cable in the y-axis direction; represents the encoding result of the bending stiffness of the cable in the z-axis direction; and respectively represent the set values of the bending stiffness of the cable in the x-axis direction in different bending states; and respectively represent the set values of the bending stiffness of the cable in the y-axis direction in different bending states; and respectively represent the set values of the bending stiffness of the cable in the z-axis direction in different bending states; if is a conditional determinator; the torsional stiffness is represented by a piecewise function, including: wherein, represents the torsional stiffness of the cable; represents the encoding result of the torsional stiffness of the cable; represents the torsion angle of the cable; and respectively represent the set values of the torsional stiffness of the cable corresponding to different ranges of the torsion angle. the cable length is represented by a linear function, including: wherein L represents the cable length; wherein L represents the cable length; d represents the actual length under dynamic deformation; and c represents the fixed length. the two ends of the cable include fixed end and movable end; the positions of the two ends of the cable are represented by three-dimensional coordinates, including: wherein, represents the fixed end of the cable, whose coordinates are ; represents the mobile end of the cable, whose coordinates are ; a gene expression is constructed for each cable based on the encoding result as: wherein, represents the assembly parameter encoding of a single cable, i.e. the gene expression; represents the initial solution of the cable pose; For an assembly system comprising n cables, the assembly parameters of each cable are extended to a vector, representing all assembly parameters of the entire system; i.e. the encoding of the entire system is a set of vectors consisting of the assembly parameters of the n cables, represented as: is a set of vectors consisting of the assembly parameters of the n cables, represented as: wherein, represents the encoding result of the i-th cable, i = 1, 2,..., n.

2. The method of claim 1, wherein the Q-Learning genetic algorithm-based flexible cable assembly parameter optimization method is characterized by, the optimization objective function in the Q-Learning genetic algorithm is: wherein, denotes the total disturbing moment of n cables; denotes the disturbing force of the i-th cable; denotes the length of the force arm of the disturbing force of the i-th cable; the fitness function in the Q-Learning genetic algorithm is set as: wherein M(X) represents the objective function value corresponding to the cable individual X; denotes the maximum value of the objective function in the current population; denotes the minimum value of the objective function in the current population; denotes the penalty coefficient; is the violation degree of the individual X under the Ith constraint condition; m represents the total number of constraint conditions.

3. The method of claim 2, wherein the Q-Learning genetic algorithm-based flexible cable assembly parameter optimization method is characterized by, the cross-variation adaptive strategy based on Q-Learning comprises: the current evolution state is calculated according to the fitness difference and diversity of the population, and the calculation method comprises: wherein, S represents the current evolution state of the population; B represents the number of solutions in the population that are the same as the current best solution, and P represents the total population size; an action set is constructed based on the value combination of the crossover rate and the mutation rate to form a Q table; According to the current evolution state of the population, the optimal crossover rate and mutation rate combination is selected from the Q table; wherein, the ε-greedy strategy is used to select the optimal action; Based on the selected crossover rate and mutation rate combination, the reward value of the selected action is calculated, and the reward value calculation method includes: wherein r represents a reward value; represents the optimal solution before updating the population; represents the optimal solution after performing the crossover and mutation; The value in the Q table is updated using the update formula of Q-Learning, including: Wherein, Q(S, A) represents the Q table; a represents the learning rate; represents the next generation possible action combination; represents the new state; represents the discount factor.

4. The method of claim 3, wherein the Q-Learning genetic algorithm-based flexible cable assembly parameter optimization method is characterized by, According to the fitness function, the excellent individuals in the current population are selected to generate an intermediate population, including: All individuals in the current population are arranged according to their fitness size; Based on the ranking, each individual is given a selection probability: wherein, represents the rank of the individual; represents the population size; represents the selection pressure parameter; represents the individual number; The roulette mechanism based on fitness adjustment is adopted to dynamically adjust the selection probability combined with Q-Learning; wherein, the selection probability is dynamically adjusted according to the state of the population; the selection principle of the roulette mechanism based on fitness adjustment includes: The individuals with higher fitness have larger positions on the roulette and have a higher probability of being selected; Individuals that violate the constraint condition are given a lower selection probability; According to the current evolution state of the population, it is determined whether the population is currently in an exploration phase or a convergence phase; in the exploration phase, the selection range of the roulette is expanded; in the convergence phase, the selection range of the roulette is reduced.

5. The method of claim 1, wherein the Q-Learning genetic algorithm-based flexible cable assembly parameter optimization method is characterized by, The new individuals are generated based on the selection, crossover and mutation operations to continuously evolve the population, improve the population fitness, and approach the optimal solution until the predetermined stopping criterion is reached, including: Individuals with fitness meeting the requirements are selected into the breeding pool through the selection operation; new individuals are generated through the crossover operation and the mutation operation; the fitness of the new individuals is evaluated, and the population is updated; during the iteration process, the crossover rate and the mutation rate are dynamically adjusted according to the state of the population to balance the exploration and convergence in the optimization process; The predetermined stopping criterion includes: The maximum number of iterations is reached; Or, the population fitness reaches a set threshold; Or, the algorithm has converged.

6. The method of claim 1, wherein the Q-Learning genetic algorithm-based flexible cable assembly parameter optimization method is characterized by, The flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm further includes: The final solution is evaluated, and the cable assembly parameters are adjusted according to the requirements; including: The fitness of the final solution is calculated to determine whether the fitness of the final solution meets the set threshold requirement; The assembly parameters in the final solution are adaptively adjusted based on the use environment.

7. A computer device, comprising: A processor and a memory are included, and the memory stores a computer program, which, when loaded and executed by the processor, implements the flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that, A program is stored, which, when loaded by a processor, implements the flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Electronic product recovery order distriution method based on rapid non-dominated sorting method

    CN114037093A

  • Flexible cable assembly parameter optimization method based on genetic algorithm

    CN118821577A

  • Closed-loop supply chain network optimization method for improving non-dominated sorting genetic algorithm

    CN119990799A

  • K-parallel row sorting problem solving method considering multiple channels

    CN120525112A