Flexible cable assembly parameter optimization method and device based on Q-Learning genetic algorithm and medium

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 design and improving system stability and security.

CN120805732AActive Publication Date: 2025-10-1710TH RES INST OF CETC
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511271575.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-10-17
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 static parameter settings in traditional genetic algorithms and difficulties in finding the optimal solution within a limited time. They are particularly inefficient in multi-dimensional parameter optimization, making it difficult to meet the requirements of high-quality design.

Method used

The cable assembly parameters are optimized using a Q-Learning genetic algorithm. The model is accurately constructed using a static model of an elastic slender rod and the Kirchhoff equation. The crossover rate and mutation rate are dynamically adjusted using the Q-Learning genetic algorithm to optimize the bending stiffness, torsional stiffness, cable length, and the positions of the cable ends, thereby minimizing the interference torque.

Benefits of technology

It significantly improves the efficiency and quality of cable assembly design, enhances global search capabilities and convergence speed, reduces design defects, improves system stability and reliability, and reduces the probability of unplanned interruption events.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120805732A_ABST
    Figure CN120805732A_ABST
Patent Text Reader

Abstract

The invention 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 assembling.The method comprises the steps that physical modeling is conducted on a movable cable based on an elastic thin rod statics model to obtain a movable cable model; on the basis of the Kirchhoff equation considering the effect of the distribution force, a movable cable pose and disturbance torque solving method is determined; and cable assembly parameters are optimized on the basis of a Q-Learning genetic algorithm. According to the flexible cable assembly parameter optimization method based on the Q-Learning genetic algorithm, the efficiency and quality of cable assembly design are remarkably improved. Key parameters of the genetic algorithm are dynamically adjusted through the Q-Learning genetic algorithm, the problems that in a traditional genetic algorithm, parameters are statically set and are prone to falling into local optimum are solved, and the global search ability and the convergence speed of the algorithm are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of cable assembly, in particular to a flexible cable assembly parameter optimization method, device and medium based on Q-Learning genetic algorithm. BACKGROUND

[0002] In recent years, the rapid development of aerospace, shipbuilding, automotive and household appliance industries has made cable assemblies increasingly widely used in modern equipment, but their reliability and safety problems have become increasingly prominent. In the aviation power system, more than 40% of unplanned interruptions are related to abnormalities in peripheral transmission units, especially hydraulic conduit rupture and signal cable aging. These problems can trigger a chain reaction, leading to system function degradation or even failure, causing serious safety hazards. Current cable routing design relies on physical prototypes and repeated trial assembly, which is inefficient and difficult to meet high-quality design requirements, and design defects often lead to geometric deformation, stress concentration and insulation layer cracking. How to accurately simulate and optimize the dynamic behavior of cables, especially in the design of flexible active cables, has become a key to improving equipment reliability. Although existing research has tried to solve this problem, there are still obvious limitations in existing technology, and it is urgent to develop accurate physical modeling and efficient solution techniques to optimize design and improve system safety and stability.

[0003] The existing Chinese invention patent with application number 202410303736.X discloses a flexible cable assembly parameter optimization method based on genetic algorithm. The elastic slender rod model is used to accurately model the flexible cable, and then the model is converted into an overdetermined nonlinear algebraic equation set through discretization processing. The LM (Levenberg-Marquardt) algorithm is used to solve the attitude of each discrete point in the model, thereby obtaining the overall attitude of the cable. Then, the interference torque is calculated based on the obtained cable attitude, and the cable assembly parameters are further optimized by minimizing the interference torque. That is, in this method, the specific content of the physical modeling of the active cable based on the elastic slender rod statics model to obtain the active cable model and the determination of the active cable pose and interference torque solving method based on the Kirchhoff equation considering the distributed force action are explicitly introduced.

[0004] But in the method, the traditional genetic algorithm is used to solve the cable assembly parameters. The applicant found in application that the traditional genetic algorithm, although it can provide good global search ability on complex problems by means of selection, crossover and mutation operations, and is easy to implement, also has some obvious limitations. The main problems include: static setting of parameters and local optimal trap. The key parameters (such as crossover rate and mutation rate) in the traditional genetic algorithm are usually statically set, however, the demand for these parameters is dynamically changed at different evolution stages. For example, the algorithm needs a larger mutation rate in the early stage to maintain the diversity of the population and avoid premature convergence; while in the later stage, a lower mutation rate can help the population converge to the optimal solution faster. Because these parameters cannot be adaptively adjusted according to the evolution process in the traditional algorithm, it is easy to cause the algorithm to lack sufficient exploration in the early stage, or to fail to fully utilize the information around the current optimal solution in the later stage, which often leads to the algorithm being trapped in local optimum, affecting the quality of the final solution and the convergence speed.

[0005] That is, in the optimization of cable assembly parameters, due to the existence of multi-dimensional parameters to be optimized (such as bending stiffness, torsional stiffness, cable length, etc.), the problem is complex and has obvious nonlinear characteristics, and the traditional genetic algorithm is difficult to find the optimal solution within a limited time. SUMMARY

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

[0007] To this end, the first aspect of the present application provides a flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm.

[0008] The second aspect of the present application provides a computer device.

[0009] The third aspect of the present application provides a computer readable storage medium.

[0010] The flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm provided by the present application comprises: physically modeling the active cable based on the elastic slender rod statics model to obtain an active cable model; wherein, based on the cable balance state constraint, a Kirchhoff equation under the action of no distributed force is first established, and 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 a Kirchhoff equation considering the action of distributed force; determining an active cable pose and disturbance torque solving method based on the Kirchhoff equation considering the action of distributed force; The Q-Learning genetic algorithm is used to optimize the cable assembly parameters, wherein an optimization target is set to minimize the interference torque caused by the plurality of cables by adjusting the cable assembly parameters, and the optimized cable assembly parameters include bending stiffness, torsional stiffness, cable length, and cable end position.

[0011] According to the flexible cable assembly parameter optimization method based on the Q-Learning genetic algorithm, the following additional technical features can be further provided. In the above technical solution, the Q-Learning genetic algorithm is used to optimize the cable assembly parameters, including: The physical characteristics of the cable assembly parameters are encoded by using symbolicization and piecewise functions; The population is initialized according to a 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, and the preset constraint condition includes that the positions of the two ends of the cable need to satisfy the geometric constraint of the assembly space and the physical parameters of the cable need to be within a set range; A fitness function in the Q-Learning genetic algorithm is determined, wherein a penalty term for measuring the degree of violation of the constraint condition by the individual is added to the fitness function; A cross-variation adaptive strategy based on Q-Learning is determined, wherein the parameters in the genetic algorithm are dynamically adjusted according to the fitness difference and diversity of the population; According to the fitness function, excellent individuals are selected from the current population to generate an intermediate population, wherein a roulette mechanism based on fitness adjustment is used to dynamically adjust the selection probability in combination 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, approach the optimal solution, and reach a predetermined stopping criterion.

[0012] In the above technical solution, the physical characteristics of the cable assembly parameters are encoded by using symbolicization and piecewise functions, including: The bending stiffness is represented by using a piecewise function, including:

[0013] 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 the assembly process; represents the bending angle of the cable in the y-axis direction during the assembly process; 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 value of the bending stiffness of the cable in the x-axis direction under different bending states; and respectively represent the set value of the bending stiffness of the cable in the y-axis direction under different bending states; and respectively represent the set value of the bending stiffness of the cable in the z-axis direction under different bending states; if is a conditional operator; a piecewise function is used to represent the torsional stiffness, including:

[0014] 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 value of the torsional stiffness of the cable corresponding to different torsion angle ranges; a linear function is used to represent the length of the cable, including:

[0015] wherein, L represents the length of the cable; represents the encoding result of the length of the cable; d represents the actual length under dynamic deformation; c represents the fixed length; The two ends of the cable include a fixed end and a movable end; the positions of the two ends of the cable are represented by three-dimensional coordinates, including:

[0016] wherein, represents the fixed end of the cable, and its coordinates are ; represents the movable end of the cable, and its coordinates are ; A gene expression is constructed for each cable based on the encoding result as:

[0017] wherein, represents the assembly parameter encoding of a single cable, i.e. the gene expression; represents the initial solution of the pose of the cable; For an assembly system containing n cables, the assembly parameters of each cable are Expanded to 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, expressed as:

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

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

[0020] in, represents the total interference torque of n cables; represents the interference force of the i-th cable; represents the length of the moment arm of the interference force of the i-th cable; The fitness function in the Q-Learning genetic algorithm is set to:

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

[0022] In the above technical solution, the cross-mutation adaptive strategy based on Q-Learning includes: The current evolutionary state is calculated based on the fitness difference and diversity of the population. The calculation methods include:

[0023] Among them, 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; P represents the total population size; The action set is constructed based on the combination of crossover rate and mutation rate values ​​to form a Q table; According to the current evolutionary state of the population, the optimal combination of crossover rate and mutation rate is selected from the Q table; 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. The reward value calculation method includes:

[0024] wherein, r represents a reward value; represents the optimal solution before updating the population; represents the optimal solution after performing crossover and mutation; the value in the Q table is updated using the update formula of Q-Learning, including:

[0025] wherein, Q(S, A) represents the Q table; and a represents a learning rate; represents a possible action combination of the next generation; represents a new state; represents a discount factor.

[0026] In the above technical solution, the excellent individuals in the current population are selected according to the fitness function, and an intermediate population is generated, including: all individuals in the current population are arranged according to their fitness sizes; based on the ranking, each individual is given a selection probability as follows:

[0027] wherein, represents the ranking of the individual; represents the population size; represents a selection pressure parameter; represents the individual number; a roulette mechanism based on fitness adjustment is adopted to dynamically adjust the selection probability in combination 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 individual with higher fitness has a larger position on the roulette and has a greater probability of being selected; the individual that violates the constraint condition is given a lower selection probability; the current evolution state of the population is determined to determine whether the population is currently in an exploration stage or a convergence stage; in the exploration stage, the selection range of the roulette is expanded; in the convergence stage, the selection range of the roulette is reduced.

[0028] In the above technical solution, the new individuals are generated based on the selection, crossover and mutation operations to continuously evolve the population, improve the population fitness, approximate the optimal solution, and reach the predetermined stop standard, including: The individuals with fitness meeting the requirements are selected into a breeding pool by the selection operation; new individuals are generated by the crossover operation and the mutation operation; the fitness of the new individuals is evaluated, and the population is updated; in the iteration process, the crossover rate and the mutation rate are dynamically adjusted according to the state of the population, so that the balance between exploration and convergence in the optimization process is ensured. The predetermined stopping criterion comprises: The maximum number of iterations is reached. Or, the fitness of the population reaches a set threshold. Or, the algorithm has converged.

[0029] In the above technical solution, the Q-Learning genetic algorithm for optimizing the cable assembly parameters further comprises: The final solution is evaluated, and the cable assembly parameters are adjusted according to requirements, comprising: The fitness of the final solution is calculated, and it is determined that the fitness of the final solution meets a set threshold requirement. The assembly parameters in the final solution are adaptively adjusted based on the use environment.

[0030] The present application provides a computer device, comprising a processor and a memory, the memory stores a computer program, when the computer program is loaded and executed by the processor, the flexible cable assembly parameter optimization method based on the Q-Learning genetic algorithm is realized.

[0031] The present application provides a computer readable storage medium, which stores a program, when the program is loaded by a processor, the flexible cable assembly parameter optimization method based on the Q-Learning genetic algorithm is realized.

[0032] In summary, due to the adoption of the above technical features, the present application has the following advantages: The present application significantly improves the efficiency and quality of cable assembly design by using a flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm. By using the elastic thin rod statics model and Kirchhoff equation for accurate physical modeling of the active cable, the present application can accurately describe the balance state of the cable under different forces, thereby providing a solid theoretical basis for the design and optimization of the cable. In addition, the present application dynamically adjusts the key parameters of the genetic algorithm through the Q-Learning genetic algorithm, solving the problems of static parameter setting and easy falling into local optimum in traditional genetic algorithm, and enhancing the global search ability and convergence speed of the algorithm. This method not only optimizes the multi-dimensional assembly parameters of the cable, such as bending stiffness, torsional stiffness, cable length and cable end position, but also improves the reliability and safety of the cable assembly by minimizing the disturbance torque, reducing problems such as geometric deformation, stress concentration and insulation layer cracks caused by design defects. The optimization algorithm of the present application can adapt to the needs of different evolution stages, has better adaptability and robustness, and can find the optimal solution more effectively in a limited time. Through this method, the present application can significantly improve the stability of the entire system and reduce the probability of unplanned interruption events, thereby providing an efficient and reliable solution for cable assembly design in the aerospace, ship, automobile and home appliance industries.

[0033] Additional aspects and advantages of the present application will become apparent in the light of the following detailed description of the application. BRIEF DESCRIPTION OF DRAWINGS

[0034] The above and / or additional aspects and advantages of the present application will become apparent and be readily understood by considering the following detailed description of embodiments, taken in conjunction with the accompanying drawings, in which: Figure 1 is a flowchart of a flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to an embodiment of the present application; Figure 2 is a flowchart of optimization of cable assembly parameters based on Q-Learning genetic algorithm in a flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to an embodiment of the present application. DETAILED DESCRIPTION

[0035] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the present application will be further described in detail below in conjunction with the drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0036] In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. However, it will be apparent to one skilled in the art that the present application can be practiced without the specific details set forth in this description. In other instances, well-known methods have not been described in detail in order to avoid obscuring the present application.

[0037] In the following, the Q-Learning genetic algorithm-based flexible cable assembly parameter optimization method according to some embodiments of the present application will be described with reference to Figure 1 and Figure 2 .

[0038] Some embodiments of the present application provide a Q-Learning genetic algorithm-based flexible cable assembly parameter optimization method.

[0039] As shown in Figure 1 , the first embodiment of the present application proposes a Q-Learning genetic algorithm-based flexible cable assembly parameter optimization method, which includes the following steps S1-S3.

[0040] S1, a flexible cable model is obtained by physically modeling the active cable based on the statics model of an elastic slender rod; wherein, based on the cable balance state constraint, the Kirchhoff equation under the action of no distributed force is first established, and then the Kirchhoff equation considering the influence of surface contact force and external distributed force on the cable movement is obtained based on the Kirchhoff equation under the action of no distributed force.

[0041] Wherein, in order to simplify the analysis, the bending and torsional deformation (bending and torsional degree) are mainly considered, and the tensile and shear effects are ignored. The active cable model should satisfy the following cable balance state constraints: Cross-section geometric symmetry: the cross-section of the active cable is equal in cross-section, and the two principal axis directions have the same geometric dimension; Initial state regularity: the cable is in a straight line form in the relaxed state, and the initial curvature and torsion rate are both zero; Contact mechanics simplification: ignore the friction between the cable and the plane; Material consistency: the cable is a homogeneous isotropic material, the elastic constant is constant, and the stress and strain satisfy the linear constitutive relationship.

[0042] In order to better describe the posture and stress condition of the flexible active cable in various cases, the present application adopts a modeling method based on the Kirchhoff elastic slender rod theory, divides the active cable into multiple infinitesimal arc segment units through the calculus principle, analyzes the physical properties of these arc segments, and obtains the key physical quantities of the balance state of each arc segment. After integration processing, the overall balance characteristics of the active cable can be obtained, including its spatial form and stress condition.

[0043] In one embodiment, assuming no torsion and original curvature, the Kirchhoff equation of the flexible active cable under no distributed force is:

[0044]

[0045] 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 internal force acting on the positive section of the point Pa of the cable in the x-axis direction by the adjacent section; represents the internal force acting on the positive section of the point Pa of the cable in the y-axis direction by the adjacent section; represents the internal force acting on the positive section of the point Pa of the cable in the z-axis direction by the adjacent section; represents the bending-torsion stiffness of the cable in the x-axis direction; represents the bending-torsion stiffness of the cable in the y-axis direction; represents the bending-torsion stiffness of the cable in the z-axis direction.

[0046] Solving , , and , , in the Kirchhoff equation, the attitude of the section in space can be obtained. In actual application scenarios, the boundary conditions of the system can be determined by means of the geometric constraint conditions of the two end points of the active cable, and then the problem is converted into a boundary value problem of solving the Kirchhoff equation.

[0047] There are six unknown variables in the Kirchhoff equation, which can be expressed by using Euler quaternions , , and . The Euler quaternions follow:

[0048] A set of new variables , , and are defined to represent , , and respectively. The derivative value of the arc coordinate s is represented by the symbol:

[0049] The wireless small rotation theory of rigid body in space is introduced to establish a mathematical model to link the bending and torsion degree ω of the cable with 、 、 and and 、 、 and , and the specific expressions are as follows:

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

[0051] where F0 is the modulus of the force at the end of the cable.

[0052] Combined with the Euler quaternion, the spatial pose calculation formula of the moving cable in (O-ξηζ) can be obtained as follows:

[0053] where σ is a variable in the integration process. Substituting the solution of the Kirchhoff equilibrium equation into the above formula can obtain:

[0054] where b in q a,b represents the serial number of the node, and k is the index value; a represents the serial number of the Euler quaternion. Δs is determined by the selection method. Based on this, the coordinates of all nodes in the cable can be determined from the Euler quaternion and Δs.

[0055] The above Kirchhoff equation only considers the interaction force between the cable micro-element segments, assumes that the cable moves under the action of no external force, and does not consider the influence of surface contact force and external distributed force on the movement of the cable, which leads to the inability to accurately reflect the contact effect of the cable with external objects.

[0056] In the force analysis model of the moving cable micro-element segment under the action of the distributed force, the moving cable is affected by the gravity and the surface contact force in the three-dimensional space. To analyze the force balance of the cable micro-element segment, the gravity f g acts along the ζ axis direction, and the surface contact force f pThe direction is consistent with the normal of the contact surface and parallel to the z axis. Then, considering the gravity and the contact surface constraint, the mechanical equilibrium equation considering the distributed force is formed, including the moment equilibrium and the force equilibrium two equations as follows:

[0057] Where, ΔM is the moment change, F is the resultant external force (including gravity f g and the surface contact force f p ), Δr is the displacement change of the cable micro-element, Δs is the arc coordinate increment, and f represents the gravity per unit arc length. The projected force equilibrium equation can be obtained as follows:

[0058] Where, f 1, f 2 and f 3 respectively represent the distributed force of the force F projected onto each axis of the cross-sectional principal axis coordinate system (P-xyz).

[0059] The conversion between the principal axis coordinate system and the three-dimensional inertial coordinate system is completed by introducing the Euler parameters, and the direction cosine matrix of each axis can be obtained as follows:

[0060] Where, is the angle between the first i a axis of the principal axis coordinate system and the first j a axis of the inertial coordinate system.

[0061] The resultant external force F is the resultant force of the gravity and the surface constraint force. Since the directions of the gravity and the surface constraint force are fixed and known, they can be first decomposed into three axes of the three-dimensional inertial coordinate system (O-ξηζ). Then, by using the direction cosine matrix represented by the Euler parameters , the gravity and the surface constraint force can be further decomposed into three axes of the cross-sectional principal axis coordinate system (P-xyz), so as to obtain the component expressions of the distributed force in three axes:

[0062] The absolute value of the surface constraint force fp in the above formula is the eighth unknown in the cable micro-element equation set, and the resultant force of the surface constraint force in the tangent direction is 0. The surface constraint equation can be expressed as:

[0063] Where, represents the first i a row and the first j column of the direction cosine matrix.a elements of the column; f g is the known cable micro-element gravity size; 、 、 represents the cosine value of gravity on the ξ axis, the η axis and the ζ axis respectively; 、 、 represents the cosine value of surface constraint force on the ξ axis, the η axis and the ζ axis respectively.

[0064] S2, based on the Kirchhoff equation considering the distribution force action, determine the active cable pose and interference torque solving method.

[0065] The motion simulation of flexible active cable is essentially to solve the pose of active cable at each discrete time in the whole motion process on the basis of the physical model of flexible active cable, and then obtain the overall shape of the active cable. Since the cable pose solving contains differential terms, it is necessary to convert the differential equation into discrete numerical values, so that the computer can be used for calculation. The specific conversion method is to discretize the solving region to generate discrete points, and to approximate the value of the derivative through the weighted sum of these points. Finally, the formula for solving the model is obtained, which is in the form of over-determined algebraic equations.

[0066] The LM algorithm is used to solve the over-determined algebraic equations; the cable assembly parameters needed to be substituted into the model include bending stiffness, torsional stiffness, cable length, position of the fixed end of the cable P 0=(p1,p2,p3) and the position of the active end of the cable P l =(r1,r2,r3).

[0067] The general idea of solving over-determined algebraic equations is to convert them into nonlinear optimization problems. After equation conversion and boundary condition processing, the differential equation group is converted into an over-determined algebraic equation group, and the problem of solving the over-determined algebraic equation group can be converted into a nonlinear optimization problem. The LM algorithm is a numerical method widely used in solving nonlinear optimization problems. By minimizing the objective function (usually the sum of squares of residuals constructed by algebraic equations), the variables are updated and the optimal solution is gradually approached; the specific solving method is not described here.

[0068] In the algorithm of the present application, the interference torque is calculated by projecting the principal vector F of the cable end element onto the auxiliary vertical plane perpendicular to the moving plane. This process simulates the dynamic response of the cable to external environment, such as twisting and bending. By calculating the product of force and force arm, the interference torque generated by the element to the system can be obtained, which describes the rotating effect of the force on the system. In addition, the calculation of the interference torque is crucial for verifying the accuracy of the model. Through the calculation of the torque, the stress of the cable under different motion states can be analyzed, and the feasibility of the proposed moving cable model in practical application can be evaluated.

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

[0070] wherein, , , are the components of the cable moving end element in the inertial coordinate system , , projected onto the auxiliary vertical plane; , , are the corresponding force arm lengths.

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

[0072] S3, optimizing the cable assembly parameters based on Q-Learning genetic algorithm; wherein the optimization goal 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 position.

[0073] ​​​When multiple cables act on the platform, the optimization model becomes complex due to the mutual coupling of moments. In theory, when the disturbance moment directions are consistent, multiple cables can be considered as a single cable for optimization, but in practice, the disturbance moment directions are usually different, and the entire system needs to be optimized. The ordinary optimization method faces the problem of "combinatorial explosion", and the calculation amount increases sharply with the increase of the number of cables, which makes it difficult for traditional methods to accurately solve. Therefore, the research turns to find a satisfactory solution, and evolutionary algorithms become an effective choice, especially genetic algorithms. Genetic algorithms simulate biological evolution, optimize the solution space through crossover and mutation operations, and can approach the optimal solution without traversing all solutions, which is suitable for multi-objective optimization problems. The key lies in the design of coding strategy, selection operator and termination condition.

[0074] Q-Learning is a reinforcement learning algorithm that can learn how to dynamically adjust parameters to make better decisions through continuous interaction with the environment. After introducing Q-Learning, the algorithm can adaptively adjust the crossover rate and mutation rate in genetic algorithms according to the current state of the population (such as population diversity and evolution stage), thereby enhancing its balance between exploration and exploitation. When the population diversity is high, Q-Learning can choose a higher mutation rate to encourage more exploration; while the population gradually converges, Q-Learning can choose a lower mutation rate to promote the algorithm to quickly converge to the global optimal solution. This dynamic adjustment mechanism can effectively avoid the algorithm falling into local optima, while accelerating the optimization process, significantly improving the efficiency of genetic algorithms in solving complex problems.

[0075] Specifically, according to the flexible cable physical model and numerical solution process established in steps S1 and S2, we can get the spatial pose and force of the cable. The cable will be affected by external disturbance forces and moments during the activity, especially during assembly. We focus on the disturbance moment, which is the rotational effect of the cable due to external forces and moments. Excessive disturbance moment may lead to inaccurate assembly, cable wear or performance degradation.

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

[0077] where, represents the total disturbance moment of n cables; represents the disturbance force of the i-th cable; represents the force arm length of the i-th cable disturbance force; Our optimization goal is to minimize , i.e. the sum of interference torques. By optimizing these parameters, the assembly errors and system instability due to torques are reduced.

[0078] In some embodiments, step S3 comprises steps S31-S36.

[0079] S31, encode the physical characteristics of the cable assembly parameters through symbolic and piecewise functions.

[0080] In traditional genetic algorithm applications, common encoding methods include binary encoding and real number encoding. Binary encoding is suitable for discrete problems, but for continuous parameters such as stiffness, length, etc., the conversion process is complex and not intuitive, and the computational efficiency is low. Real number encoding can directly represent continuous parameters, but there are still problems of insufficient precision and flexibility, especially in complex engineering optimization problems, the setting of static parameters can easily lead the algorithm to fall into local optimum.

[0081] The present application provides a new encoding method, called piecewise expression encoding, the core idea of which is to encode the physical characteristics of the cable assembly parameters through symbolic and piecewise functions, in order to better map the relationship between the assembly parameters and the physical behavior of the cable, and thus efficiently optimize in the genetic algorithm.

[0082] In this embodiment, each assembly parameter (such as bending stiffness, torsional stiffness, cable length, end position, etc.) is encoded by a piecewise function. This encoding method not only accurately represents the assembly parameters, but also dynamically reflects the changes of the assembly parameters under different working conditions. Specifically, each assembly parameter is mapped to the actual physical quantity through a piecewise function, so as to realize adaptive optimization in the genetic algorithm.

[0083] In one specific embodiment, step S31 comprises: The bending stiffness parameter ( , , ) is the stiffness of the cable in different axial directions, which changes with the angle or assembly conditions. For bending stiffness, a piecewise function is used to represent it, including:

[0084] 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 the assembly process; represents the encoding result of the cable bending stiffness in the x-axis direction; represents the encoding result of the cable bending stiffness in the y-axis direction; represents the encoding result of the cable bending stiffness in the z-axis direction; and respectively represent the set value of the bending stiffness of the cable in different bending states in the x-axis direction; and respectively represent the set value of the bending stiffness of the cable in different bending states in the y-axis direction; and respectively represent the set value of the bending stiffness of the cable in different bending states in the z-axis direction; if is a conditional symbol; The torsional stiffness changes with the change of the torsion angle, and a piecewise function is used to represent the torsional stiffness, including:

[0085] wherein, represents the torsional stiffness of the cable; represents the encoding result of the cable torsional stiffness; represents the torsion angle of the cable; and respectively represent the set value of the corresponding torsional stiffness of the cable under different torsion angle ranges; The cable length is represented by a linear function, including:

[0086] wherein, L represents the cable length; represents the encoding result of the cable length; d represents the actual length under dynamic deformation; c represents the fixed length; Specifically, the cable length L is determined by the fixed length c and the actual length d under dynamic deformation. During the assembly process, the cable is deformed due to bending and torsion, etc. Therefore, d≠L. This change can be reflected by a piecewise function: That is, the correlation between the bending stiffness and the bending angle: the bending stiffness of the cable adjusts with the change of the bending angle, which directly affects its ability to resist bending deformation.

[0087] The correlation between the torsional stiffness and the torsion angle: the torsional stiffness is related to the torsion angle through a piecewise function, which determines the deformation characteristics of the cable in the torsion state.

[0088] The dynamic relationship between the above stiffness parameters and the angles jointly acts on the actual length of the cable, reflecting the length change law of the cable.

[0089] Two ends of the cable include fixed end and movable end; for the cable two end position using three-dimensional coordinates to express, including:

[0090] Among them, The fixed end of the cable, the coordinates are ; The movable end of the cable, the coordinates are ; through these coordinate information, the geometric shape of the cable can be accurately described; Using LM algorithm to solve the problem needs to give a set of initial solution x0 of cable pose, if the cable is divided into m segments, the microelement of the jth segment can be expressed as:

[0091] Among them, each parameter is the 3 components of the microelement of the jth segment under the main shaft coordinate system (P-xyz) coordinate system , , And its corresponding Euler four-element.

[0092] By mapping the assembly parameters of the cable into a segmented function, we can construct a gene expression for each cable. Each chromosome represents an assembly scheme, containing the combination of all assembly parameters, then based on the coding results, the gene expression constructed for each cable is:

[0093] Among them, The assembly parameter coding of single cable, that is, the gene expression; The initial solution of cable pose.

[0094] For an assembly system containing n cables, the assembly parameters of each cable Are extended into a vector, representing all assembly parameters of the whole system; that is, the coding of the whole system Is a vector set composed of the assembly parameters of n cables, expressed as:

[0095] Among them, The coding result of the ith cable, i=1, 2,..., n. These assembly parameters are coded by segmented function and geometric position mapping, which constitutes the optimization solution space of the whole cable system.

[0096] Unlike traditional real number encoding and binary encoding, the piecewise expression encoding method of the present application can directly associate the changes of physical properties with assembly parameters, providing a more intuitive and efficient optimization method. This piecewise function expression method can accurately describe the changes of assembly parameters in different working states, thereby avoiding the precision loss that may occur in traditional methods. At the same time, the encoding method is directly calculated in the physical space, avoiding the complex decoding process required in traditional encoding, and improving the calculation efficiency.

[0097] This more intuitive and accurate assembly parameter representation 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, while laying a solid foundation for subsequent fitness evaluation and parameter adjustment. This innovative encoding method enables the optimization method of the present application to better adapt to the multi-dimensional and nonlinear characteristics of flexible cable assembly parameters, effectively improving the application effect of genetic algorithms in large-scale optimization problems.

[0098] S32, 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 satisfy the geometric constraint of the assembly space, and the physical parameters of the cable are within the set range.

[0099] 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 the preset constraint condition.

[0100] The first step of initialization is to determine the population size, i.e. the number of individuals in the genetic algorithm. Generally, the larger the size of the population, the stronger the search ability of the algorithm, but the computational cost also increases. According to the complexity of the problem and the limitation of computing resources, a suitable population size can be selected.

[0101] Bending stiffness represents the bending resistance of the cable in different directions. According to the design requirements and material properties of the cable, a reasonable range of bending stiffness is set, and the value is usually in the interval [0.5, 1]. The torsional stiffness describes the torsional resistance of the cable; usually the value is set according to the diameter and material properties of the cable.

[0102] The initial solution is composed of the Euler angle parameters and the distributed force of each cable element, and each individual is composed of several parameters, including force components and Euler angles. The distributed force component is randomly generated within a small neighborhood of 0, simulating the small influence of force. The parameter value of Euler angle is limited in the range of (-1, 1) and satisfies the normalization constraint, i.e. the sum of the squares of these values is 1.

[0103] The randomly generated initial individuals need to satisfy the physical and geometric constraints that may exist in the assembly process. For each individual, the positions of the two ends of the cable need to satisfy the geometric constraints of the assembly space, such as the maximum and minimum distance limits between the fixed end and the movable end. Ensure Within the acceptable range, avoid too close or too far apart. The physical parameters such as bending stiffness and torsional stiffness of the cable should be within a reasonable range to avoid generating solutions that do not meet the physical characteristics.

[0104] The diversity of the population is the key to the success of genetic algorithms. After completing the population initialization, we need to check whether the individuals in the initial population can effectively cover different areas of the assembly parameter space. If the diversity of the population is insufficient, it may cause the algorithm to converge prematurely and fall into a local optimal solution. Therefore, check the diversity of the population and adjust the generation strategy as needed to increase more random individuals to ensure the breadth of the population.

[0105] After generating the initial population, we also need to evaluate the quality of the population. The evaluation criteria include: The fitness of each individual, that is, its performance in the optimization target; Whether the parameter range of the initial population is reasonable and meets the assembly requirements.

[0106] The above population initialization steps not only ensure the physical reasonableness of the initial population, but also improve the diversity of the population through carefully designed initialization strategies. Such initialization methods provide a more efficient and stable starting point for the optimization process of genetic algorithms, ensuring that the optimization process can find the optimal solution within a reasonable time and reducing the waste of computing resources.

[0107] S33, set the fitness function in the Q-Learning genetic algorithm; wherein, a penalty term for measuring the degree of violation of the individual to the constraint condition is added in the fitness function.

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

[0109] Where M(X) represents the objective function value corresponding to the cable individual X; Max(M) represents the maximum value of the objective function in the current population, Min(M) represents the minimum value of the objective function in the current population, ensuring that the fitness value is within the range [0, 1]; P represents the penalty coefficient for controlling the influence of the penalty term; is the degree of violation of individual X under the Ith constraint condition, if the individual satisfies the constraint condition, then , otherwise ; m represents the total number of constraint conditions.

[0110] In actual cable assembly, the assembly parameters are not only affected by the interference torque, but also must meet a series of physical and geometric constraints. For example: the length of the cable should not be too short to avoid the cable being too tight; the value range of parameters such as bending stiffness, torsional stiffness, etc. needs to meet the physical characteristics; the position and angle of the two ends of the cable need to meet the actual assembly requirements.

[0111] In the above fitness function, the fitness value is normalized to be within the range of [0, 1], and the smaller the objective function value is, the higher the fitness is. After adding the penalty term, individuals that violate the constraints will be additionally penalized, and the fitness will decrease. By adjusting the penalty coefficient, the strength of the penalty can be controlled. Individuals with higher fitness are more likely to be selected into the next generation. During the selection process, the penalty term causes individuals that violate the constraints to be gradually eliminated in evolution. When the optimization problem has multiple constraints, using the penalty term can effectively handle these constraints and avoid the algorithm selecting illegal solutions.

[0112] This method of constructing a fitness function by fusing the optimization target of interference torque and assembly constraints, supplemented by a penalty term mechanism and objective normalization strategy, enables the genetic algorithm to efficiently achieve multi-objective collaborative optimization in flexible cable assembly parameter optimization: significantly reducing the interference torque while strictly ensuring the engineering feasibility of the assembly parameters. This method effectively improves the stability and convergence efficiency of the optimization process, and ultimately provides a reliable guarantee for obtaining a global optimal solution that meets the actual engineering requirements.

[0113] S34, determine 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.

[0114] In traditional genetic algorithms, parameters such as crossover rate and mutation rate are usually fixed, lacking flexibility and adaptability, and cannot be adjusted according to the dynamic changes of the problem. This leads to the genetic algorithm being easily trapped in local optima when optimizing assembly parameters, reducing search efficiency, and even failing to find a global optimal solution. Especially in flexible cable assembly optimization, assembly parameters are closely related to mechanical properties, and there are complex relationships between parameters, making it difficult for traditional algorithms to effectively cope with these complex assembly requirements when exploring the solution space.

[0115] To solve these problems, the present application proposes a genetic algorithm adaptive strategy based on Q-Learning. By dynamically adjusting the key parameters in the genetic algorithm, especially the crossover rate and mutation rate, the genetic algorithm based on Q-Learning can adaptively adjust the search strategy during evolution, thereby more efficiently solving the flexible cable assembly parameter optimization problem.

[0116] Since the cable assembly optimization problem has a multi-dimensional and non-linear solution space, and needs to consider the relationship between assembly parameters (such as bending stiffness, torsional stiffness, cable length, etc.) and the minimization of disturbance torque, while meeting a series of physical and geometric constraints, how to efficiently explore the solution space and avoid falling into local optimum becomes a key challenge. By introducing Q-Learning, the genetic algorithm can dynamically adjust parameters according to the fitness difference and diversity of the population, make reasonable decisions at different evolution stages, and thus improve the optimization effect and ensure the final global optimal solution.

[0117] In one specific embodiment, step S34 comprises: The core of Q-Learning is the evaluation and adjustment based on "state". In the optimization process of genetic algorithm, the state reflects the fitness distribution and diversity of the population, which are crucial for cable assembly parameter optimization. In traditional genetic algorithm, when the population diversity is low, the algorithm is prone to fall into local optimum; while when the diversity is high, excessive exploration may lead to an increase in invalid solutions, thus reducing the computational efficiency.

[0118] In each generation of evolution, Q-Learning calculates the current evolution state S according to the fitness difference and diversity of the population. The evaluation of this state helps to judge whether the population is too concentrated (low diversity) or dispersed (high diversity), and thus decides whether to adjust the selection strategy. The current evolution state S of the population can be defined by the fitness difference between the optimal solution and the current solution.

[0119] Specifically, the current evolution state is calculated according to the fitness difference and diversity of the population, and the calculation method includes:

[0120] Where 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. The state S reflects the diversity of the population, and when the difference is large, the state is close to π / 2, and when the difference is small, the state is close to 0. Through this state value, it can be judged whether it is in the exploration stage or the convergence stage, so as to dynamically adjust the crossover rate and mutation rate to optimize the cable assembly parameters.

[0121] Based on the value combination of the crossover rate and the mutation rate, an action set is constructed to form a Q table.

[0122] The action definition involves the selection of the crossover rate p c and the mutation rate p m . The crossover rate p c and the mutation rate p mThe selection of the crossover rate p and the mutation rate p directly affects the exploration and convergence ability 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 for each individual. During the assembly process, different stages have different needs. More mutations are needed in the early stages to increase diversity, while the crossover rate needs to be increased to speed up optimization when converging.

[0123] Specifically, the crossover rate p c and the mutation rate p m are selected as follows:

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

[0125] 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.

[0126] Wherein, when the population diversity is high, Q-Learning selects a larger mutation rate p m to increase the breadth of exploration and avoid premature convergence. When the population gradually converges, Q-Learning selects a higher crossover rate p c and a smaller mutation rate p m to speed up convergence and ensure that the global optimal solution is found. When selecting the optimal action, the ε-greedy strategy is used, i.e. with a probability of 1-ε, the crossover rate and mutation rate combination with the maximum Q value in the current state is selected, thereby balancing exploration and development; with a probability of ε, the crossover rate and mutation rate combination is randomly selected to maintain a certain degree of exploration.

[0127] Based on the selected crossover rate and mutation rate combination, the reward value of the selected action is calculated. The reward value r is used to measure the effect of a combination (crossover rate and mutation rate). If the fitness of the population improves after evolution with this combination, a positive reward is given; if it does not improve, a negative reward is given. Specifically, the reward value calculation method includes:

[0128] where r represents the reward value; represents the optimal solution before updating the population; represents the optimal solution after crossover and mutation.

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

[0130] where Q(S, A) represents the Q-table; α denotes the learning rate; denotes the next generation of possible action combinations; denotes the new state; denotes the discount factor, which measures the importance of future rewards.

[0131] After several iterations, the final Q-table result is obtained for adaptive adjustment of genetic crossover and mutation rates in different states.

[0132] S35, select excellent individuals in the current population according to the fitness function, and 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.

[0133] The selection operator simulates the "survival of the fittest" principle in nature in genetic algorithms, and its main function is to select individuals with excellent performance from the parent population and ensure that the excellent genes of these individuals 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 values of individuals, and usually select individuals with higher fitness values through certain probabilities. However, in the cable assembly parameter optimization problem, the optimization goal is not only to minimize the interference torque, but also to meet multiple physical and geometric constraint conditions. In order to ensure that solutions that meet the actual assembly requirements are searched, the selection process needs to be more flexible and accurate.

[0134] In the Q-Learning-based genetic algorithm, the selection operator still simulates the "survival of the fittest" principle in nature, and its main function is to select individuals with excellent performance from the parent population and ensure that the excellent genes of these individuals are passed on to the next generation. However, unlike traditional genetic algorithms, the Q-Learning-based selection operator can dynamically adjust the selection strategy according to the state of the population and the evolution stage. This adaptive mechanism can automatically adjust the selection of crossover rate and mutation rate according to different evolution stages, balance exploration and development, and accumulate experience through learning, so that the algorithm improves diversity in the early stage and accelerates convergence in the later stage.

[0135] In one specific embodiment, step S35 includes: Arrange all individuals in the current population according to their fitness values; usually in descending order.

[0136] Based on the ranking, give each individual a selection probability:

[0137] wherein, denotes the ranking of the individual; represents the population size; represents the selection pressure parameter; represents the individual number; by dynamically adjusting the population diversity and convergence speed. By dynamically adjusting the parameter, the population diversity and convergence speed can be controlled. Smaller values increase the diversity of the population, making low-adaptation individuals have a higher probability of being selected; while larger values emphasize individuals with higher fitness, promoting rapid convergence of the population.

[0138] A roulette 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.

[0139] In traditional genetic algorithms, the roulette mechanism is used to determine the probability of selection of each individual according to its fitness. However, in the cable assembly parameter optimization problem, due to the complex interrelationship between assembly parameters, the traditional roulette mechanism may lead to rapid loss of population diversity or premature convergence. Therefore, the present disclosure proposes a roulette mechanism based on fitness adjustment, combined with Q-Learning to dynamically adjust the selection probability, thereby optimizing the generation of solutions in each generation.

[0140] Under the guidance of the Q-Learning adaptive strategy, the roulette mechanism not only depends on the fitness of individuals, but also dynamically introduces the satisfaction of assembly constraints and physical conditions into the calculation of the selection probability. By combining fitness and constraint satisfaction, we can ensure that excellent individuals in the population are properly selected and avoid generating invalid solutions due to unsatisfied constraints.

[0141] The selection probability of the roulette consists of two parts: (1) Fitness factor; The fitness value of an individual directly affects its probability of being selected. Individuals with higher fitness have a larger position on the roulette, and their probability of being selected also increases.

[0142] (2) Constraint satisfaction factor; In order to ensure the rationality of assembly parameters, when an individual satisfies physical and geometric constraints, the selection probability will be adjusted according to the constraint satisfaction. For example, individuals that violate constraint conditions will be assigned a lower selection probability, thereby avoiding their entry into the next generation.

[0143] By introducing Q-Learning, the newly set roulette mechanism can dynamically adjust the selection probability according to the state S of the population. Specifically, at different stages of the evolution process: (1) Exploration stage (high population diversity); Q-Learning increases the diversity of individual selection, adjusts the selection range of roulette, ensures that individuals with low fitness also have a certain probability of being selected, thereby promoting more exploration.

[0144] (2) Convergence phase (population tends to be consistent); Q-Learning reduces the selection range and increases the selection probability of individuals with high fitness, thereby accelerating convergence and helping the algorithm quickly find the optimal solution.

[0145] In one specific embodiment, the selection principle of the fitness-based roulette mechanism includes: Individuals with higher fitness have a larger position on the roulette and a higher probability of being selected; Individuals that violate the constraint condition are assigned 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.

[0146] This dynamically adjusted roulette 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. Moreover, by considering the individual fitness and constraint satisfaction, and adaptively adjusting the selection probability based on the evolution state of the population, the effectiveness of the genetic algorithm in flexible cable assembly parameter optimization is significantly improved, ensuring that the algorithm can efficiently perform global search in complex assembly constraints and multi-dimensional solution space, avoid local optimum, and quickly converge to the global optimal solution.

[0147] S36, based on selection, crossover and mutation operations, generates new individuals to continuously evolve the population, improves the fitness of the population, and approaches the optimal solution until the predetermined stopping criteria are met.

[0148] Loop iteration is one of the core steps of genetic algorithm. In each generation, selection, crossover and mutation operations continuously evolve the population by generating new individuals. As the iteration proceeds, the fitness of the population will gradually improve, eventually approaching the optimal solution. In the flexible cable assembly parameter optimization problem, the algorithm continuously adjusts the assembly parameters through iteration until the predetermined stopping criteria are met.

[0149] In one specific embodiment, step S36 includes: In each iteration, first, select individuals with high fitness into the breeding pool through the selection operation; then generate new individuals through the crossover operation and the mutation operation; finally, evaluate the fitness of the new individuals and update the population. During the iteration process, Q-Learning dynamically adjusts the crossover rate and mutation rate according to the state of the population, ensuring a balance between exploration and convergence during optimization.

[0150] The predetermined stopping criteria, i.e., the algorithm termination conditions, include: reaching a maximum number of iterations; or, the population fitness reaching a set threshold; or, the population fitness changing little over several generations, i.e., the algorithm has converged.

[0151] Q-Learning adaptively adjusts the crossover rate and mutation rate based on the state of the population in each iteration, ensuring that the algorithm can adapt to the optimization process at different stages. In the early stages, Q-Learning increases the mutation rate to improve exploration; while in the later stages, Q-Learning reduces the mutation rate and increases the crossover rate, accelerating convergence.

[0152] Through continuous iterative cycles, genetic algorithms 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, ensuring that the population maintains the best balance between exploration and convergence, promoting the efficient progress of the optimization process.

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

[0154] S37, evaluate the final solution and adjust the cable assembly parameters as needed.

[0155] The evaluation of the final solution is the last step in the genetic algorithm, aiming to identify the optimal solution from the final population and conduct a comprehensive assessment of the solution's quality. In the flexible cable assembly parameter optimization problem, the final solution not only minimizes the interference torque, but also must satisfy the assembly constraints.

[0156] In some embodiments, step S37 specifically includes: Calculate the fitness of the final solution and determine whether the fitness of the final solution meets the set threshold requirement. After multiple iterations, the algorithm evaluates each individual in the final population according to the fitness function. The fitness function assesses the quality of the solution by minimizing the interference torque and penalizing violations of the constraints. The final solution is the individual with the highest fitness, which represents the optimal combination of cable assembly parameters.

[0157] Based on the usage environment, adaptively adjust the assembly parameters in the final solution. 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 the best match of its performance.

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

[0159] In practical applications, the optimization result can be adjusted according to the changes encountered in the actual assembly process. The Q-Learning adaptive strategy can adjust the optimization process according to the new feedback, so that the cable assembly parameters are always in the optimal state.

[0160] Some other embodiments of the present application provide a computer device comprising a processor and a memory, wherein the memory stores a computer program which, when loaded and executed by the processor, implements the flexible cable assembly parameter optimization method based on the Q-Learning genetic algorithm as described in any of the above embodiments.

[0161] Some other embodiments of the present application provide a computer readable storage medium storing a program which, 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.

[0162] In this specification, illustrative descriptions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any suitable manner in one or more embodiments or examples.

[0163] Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm, characterized in that: include: Based on the statics model of an elastic thin rod, a movable cable model is obtained by physically modeling the movable cable. First, the Kirchhoff equation without distributed forces is established based on the cable equilibrium constraint. Then, based on the Kirchhoff equation without distributed forces, the effects of surface contact forces and external distributed forces on cable motion are considered to obtain the Kirchhoff equation with distributed forces. Based on the Kirchhoff equation considering the distributed force, the method for solving the movable cable posture and the interference torque is determined; The cable assembly parameters are optimized based on the Q-Learning genetic algorithm. The optimization goal 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 cable end positions.

2. The flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to claim 1, characterized in that: The optimization of cable assembly parameters based on the Q-Learning genetic algorithm includes: Encode the physical characteristics of cable assembly parameters through symbolic and piecewise functions; Initializing the population according to preset constraints; wherein the assembly parameters of each node on the cable are set to the genetic values ​​of individuals in the population; the preset constraints include: the positions of the two ends of the cable must meet the geometric constraints of the assembly space, and the physical parameters of the cable must be within the set range; Setting a fitness function in a Q-Learning genetic algorithm; wherein a penalty term for measuring the degree to which an individual violates a constraint condition is added to the fitness function; Determine a crossover-mutation adaptive strategy based on Q-Learning, in which the parameters in the genetic algorithm are dynamically adjusted according to the fitness differences and diversity of the population; According to the fitness function, excellent individuals are selected from the current population to generate an intermediate population. A roulette wheel mechanism based on fitness adjustment is used, combined with Q-Learning to dynamically adjust the selection probability. 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 the predetermined stopping criteria are reached.

3. The flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to claim 2, characterized in that: The physical characteristics of the cable assembly parameters are encoded by symbolization and piecewise functions, including: The flexural stiffness is represented by a piecewise function, including: in, Indicates the bending stiffness of the cable in the x-axis direction; Indicates the bending stiffness of the cable in the y-axis direction; Indicates the bending stiffness of the cable in the z-axis direction; Indicates the bending angle of the cable in the x-axis direction during assembly; Indicates the bending angle of the cable in the y-axis direction during assembly; Indicates the bending angle of the cable in the z-axis direction during assembly; Indicates the encoding result of the cable bending stiffness in the x-axis direction; Indicates the encoding result of the cable bending stiffness in the y-axis direction; Indicates the encoding result of the cable bending stiffness in the z-axis direction; and They represent the set values ​​of the bending stiffness of the cable under different bending states in the x-axis direction; and They represent the set values ​​of the bending stiffness of the cable under different bending states in the y-axis direction; and They respectively represent the set values ​​of the bending stiffness of the cable under different bending states in the z-axis direction; if is a conditional determiner; The torsional stiffness is represented by a piecewise function, including: in, Indicates the torsional stiffness of the cable; The encoding result representing the torsional stiffness of the cable; Indicates the twist angle of the cable; and They represent the set values ​​of the torsional stiffness of the cable under different torsion angle ranges; The cable length is represented by a linear function, including: Where L represents the cable length; Indicates the encoding result of the cable length; d indicates the actual length under dynamic deformation; c indicates the fixed length; The two ends of the cable include a fixed end and a movable end. The positions of the two ends of the cable are represented by three-dimensional coordinates, including: in, Indicates the fixed end of the cable, its coordinates are ; represents the active end of the cable, and its coordinates are ; Based on the encoding results, a gene expression is constructed for each cable: in, 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 containing n cables, the assembly parameters of each cable are Expanded to 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, expressed as: in, represents the encoding result of the i-th cable, i=1,2,...,n.

4. The flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to claim 3, characterized in that: The optimization objective function in the Q-Learning genetic algorithm is: in, represents the total interference torque of n cables; represents the interference force of the i-th cable; represents the length of the moment arm of the interference force of the i-th cable; The fitness function in the Q-Learning genetic algorithm is set to: Where M(X) represents the objective function value corresponding to the cable individual X; Indicates the maximum value of the objective function in the current population; Represents the minimum value of the objective function in the current population; represents the penalty coefficient; is the degree of violation of individual X under the I-th constraint; m represents the total number of constraints.

5. The flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to claim 4, characterized in that: The cross-mutation adaptive strategy based on Q-Learning includes: The current evolutionary state is calculated based on the fitness difference and diversity of the population. The calculation methods include: Among them, 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; P represents the total population size; The action set is constructed based on the combination of crossover rate and mutation rate values ​​to form a Q table; According to the current evolutionary state of the population, the optimal combination of crossover rate and mutation rate is selected from the Q table; 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. The reward value calculation method includes: Among them, r represents the reward value; represents the optimal solution before updating the population; Represents the optimal solution after cross-mutation; Use the Q-Learning update formula to update the values ​​in the Q table, including: Among them, Q(S,A) represents the Q table; α represents the learning rate; Represents possible action combinations for the next generation; Indicates a new state; Represents the discount factor.

6. The flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to claim 5, characterized in that: The process of selecting excellent individuals from the current population according to the fitness function to generate an intermediate population includes: Arrange all individuals in the current population according to their fitness; Based on the ranking, each individual is given a selection probability: in, represents the ranking of individuals; Indicates the population size; Indicates the selection pressure parameter; Indicates individual number; A roulette wheel mechanism based on fitness adjustment is used, combined with Q-Learning to dynamically adjust the selection probability. The selection probability is dynamically adjusted according to the state of the population. The selection principles of the roulette wheel mechanism based on fitness adjustment include: Individuals with higher fitness have larger positions on the roulette wheel and are more likely to be selected; Individuals who violate the constraints are assigned a lower probability of selection; According to the current evolutionary state of the population, it is determined whether the population is currently in the exploration stage or the convergence stage; in the exploration stage, the selection range of the roulette wheel is expanded; in the convergence stage, the selection range of the roulette wheel is reduced.

7. The flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to claim 2, characterized in that: The generation of 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: Through the selection operation, individuals with fitness that meets the requirements are selected to enter the breeding pool; new individuals are generated through crossover and mutation operations; the fitness of 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 status of the population to ensure the balance between exploration and convergence in the optimization process; The predetermined stopping criteria include: Reached the maximum number of iterations; Or, the population fitness reaches the set threshold; Or, the algorithm has converged.

8. The flexible cable assembly parameter optimization method based on Q-Learning genetic algorithm according to claim 2, characterized in that: The optimization of cable assembly parameters based on the Q-Learning genetic algorithm further includes: Evaluate the final solution and adjust the cable assembly parameters as needed; including: Calculate the fitness of the final solution and make sure that the fitness of the final solution meets the set threshold requirements; Adaptively adjust the assembly parameters in the final solution based on the usage environment.

9. A computer device, characterized in that: The method comprises a processor and a memory, wherein a computer program is stored in the memory, and when the computer program is loaded and executed by the processor, the flexible cable assembly parameter optimization method based on the Q-Learning genetic algorithm as described in any one of claims 1 to 8 is implemented.

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

Citation Information

Patent Citations

  • Infrared spectroscopy PLS (Partial Least Square) modeling method based on genetic algorithm self-adaptive selection segment point

    CN103411913A

  • 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