Function global optimization method, computer device and computer readable storage medium

By simulating elastic collision motion and fragment generation, the local convergence and high cost problems of traditional optimization methods in high-dimensional scenarios are solved, and the global minimum value of the fast detection function is realized, reducing calculation cost and time.

CN120449468APending Publication Date: 2025-08-08ZHUHAI LIANGYIN TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510548610.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Traditional gradient optimization methods are prone to local convergence in high-dimensional scenarios. The heuristic algorithm is cost-effective and takes too long to optimize high-dimensional functions, making it difficult to effectively find the global minimum value of the function.

Method used

By simulating elastic collision movement, the target elastomer is used to freely fall motion in the simulated space and interact with the objective function to generate collision points, calculate the next trajectory based on the collision angle and kinetic energy, and quickly detect the global minimum value based on the fragment generation and gradient descent.

Benefits of technology

Reduces the number of calculations and computer execution time, reduces the calculation cost, avoids local convergence, and improves the detection speed of the global minimum value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120449468A_ABST
    Figure CN120449468A_ABST
Patent Text Reader

Abstract

The invention provides a function global optimization method, a computer device and a computer readable storage medium, and the method comprises the steps: obtaining a target function, and drawing a simulation graph of the target function in a simulation space; acquiring a target elastomer, determining an initial position of the target elastomer in the simulation space, and setting the target elastomer to simulate free falling motion in the simulation space by taking the initial position as a starting point; setting a target elastomer to simulate elastic collision motion on the simulation graph to form a first collision point; judging whether the target function value of the first collision point is smaller than a minimum value stored in a memory or not, and if yes, setting the target function value of the first collision point as the latest minimum value; and setting a target elastomer to continuously simulate elastic collision motion on the simulation graph. The method can reduce the number of calculation times, and reduce the execution time and calculation cost of the computer device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer system parameter optimization, and in particular to a method for global function optimization, a computer device, and a computer-readable storage medium. Background Art

[0002] Function optimization techniques are widely used to solve extreme value problems in engineering design and system optimization. For example, in silicon photonic modulators, photodetectors, and lasers, these problems involve carrier transport equations coupled with Maxwell's equations. Solving for the minimum value can minimize the drive voltage or power consumption of modulators, reducing losses and increasing modulation speed, while minimizing carrier transit time in detectors to increase bandwidth.

[0003] Traditional methods use gradient-based optimization, but these methods rely on first-order or higher-order derivatives of the objective function to guide the search. However, in high-dimensional scenarios, these methods face exponential local convergence issues: because the gradient only reflects the function's trend in a local neighborhood, the algorithm may quickly converge to a local minimum near the initial point, failing to jump to a region with a better solution.

[0004] Existing function optimization algorithms can use heuristic algorithms, such as ant colony optimization algorithm, genetic algorithm and simulated annealing. These algorithms improve global search capabilities by introducing randomness. However, when optimizing high-dimensional functions, heuristic algorithms take too long to execute and have high computational costs. Summary of the Invention

[0005] A first object of the present invention is to provide a method for global optimization of a function with reduced time and computational cost.

[0006] A second object of the present invention is to provide a computer device using the above function global optimization method.

[0007] A third object of the present invention is to provide a computer-readable storage medium using the above function global optimization method.

[0008] To achieve the first purpose of the present invention, the present invention provides a method for global optimization of a function, which includes obtaining a target function and drawing a simulation graph of the target function in a simulation space; obtaining a target elastic body, determining the initial position of the target elastic body in the simulation space, and setting the target elastic body to simulate free fall motion in the simulation space with the initial position as the starting point; setting the target elastic body to simulate elastic collision motion on the simulation graph to form a first collision point; judging whether the target function value of the first collision point is less than the minimum value stored in the memory, and if so, updating the minimum value to the target function value of the first collision point; judging whether the number of collisions of the target elastic body reaches a preset number of executions, and if so, taking the minimum value stored in the current memory as the global minimum and outputting the global minimum; if the number of collisions of the target elastic body does not reach the preset number of executions, setting the target elastic body to continue simulating elastic collision motion on the simulation graph to form a latest collision point, and updating the minimum value according to the target function value of the latest collision point.

[0009] As can be seen from the above scheme, when the target elastic body freely falls from its initial position in the simulation space, its potential energy is converted into kinetic energy. After the target elastic body and the simulated graph of the target function produce the first collision point, that is, after the target elastic body and the target function intersect, the target elastic body at this position determines the collision angle based on the derivative of the target function. The next trajectory of the detection point is calculated based on the kinetic energy and the collision angle. By simulating elastic collision motion on the simulation graph while the target elastic body is in free fall, the search range of the target elastic body is not limited to searching for a local minimum near the initial point. Under the force of the elastic collision, the minimum value can be adjusted to other areas to find the global minimum of the function. Furthermore, the present invention does not require user intervention and can avoid rapid convergence to a local minimum near the initial point. The present invention searches for the global minimum by simulating elastic collisions and updating the state when a collision occurs. This eliminates the need for frame-by-frame trajectory calculation and avoids continuous time integration operations. This can significantly reduce the number of calculations, reducing the execution time and computational cost of the computer device.

[0010] In a further scheme, after the first collision point is formed, the following is also executed: simulating and generating at least one first fragment at the first collision point, setting the first fragment to take the position of the first collision point as the starting point, randomly selecting any direction in the simulation space to simulate elastic collision motion to form a second collision point; judging whether the objective function value of the second collision point is less than the minimum value, and if so, updating the minimum value to the objective function value of the second collision point.

[0011] It can be seen that by generating the first fragment at the first collision point to detect the surrounding area, the speed of detecting the global minimum is accelerated.

[0012] In a further solution, after the collision point is formed, the following steps are performed: generating a second fragment at the first collision point, setting the second fragment to move in a gradient descent manner, and obtaining the objective function value of the second fragment at the final position; judging whether the objective function value of the second fragment is less than the minimum value; if so, updating the minimum value to the objective function value of the second fragment at the final position.

[0013] This shows that by generating the second fragment to detect the surrounding area, the speed of detecting the global minimum is accelerated.

[0014] In a further solution, before determining whether the objective function value of the first collision point is less than the minimum value stored in the memory, the following steps are further performed: setting a first time interval, and obtaining the first collision point of the target elastic body after the first time interval.

[0015] It can be seen that by setting the first time interval, the calculation process and calculation time are shortened.

[0016] In a further solution, after outputting the global minimum value, the following steps are further performed: obtaining second position information of the simulation space, setting the target elastic body to simulate free fall motion with the second position information as the starting point; and setting the target elastic body to simulate elastic collision motion on the simulation graph.

[0017] It can be seen that the second position information is another position selected by the user, which increases the probability of the retrieval result of the global minimum.

[0018] In a further solution, after setting the target elastic body to simulate elastic collision motion on the simulation graph, it is also executed: judging whether the height of the current position of the target elastic body is lower than the height of the simulation graph corresponding to the position of the target elastic body; if so, setting the target elastic body to collide.

[0019] It can be seen from this that due to computer calculation errors, the target elastic body and the target function did not collide when they produced an intersection, forming a collision point, which led to errors in the detection of the target elastic body. Therefore, at this time, the target elastic body was made to collide and return to the height of the initial position to continue detection.

[0020] In order to achieve the second purpose, the computer device provided by the present invention includes a processor and a memory, characterized in that the memory stores a computer program, and when the computer program is executed by the processor, the above-mentioned function global optimization method is implemented.

[0021] In order to achieve the third purpose, the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned method for global function optimization when the computer program is executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1It is a flow chart of an embodiment of the method for global optimization of functions of the present invention.

[0023] Figure 2 It is a two-dimensional space simulation diagram of an embodiment of the method for global optimization of functions of the present invention.

[0024] Figure 3 It is a motion analysis diagram of a target elastic body in a two-dimensional space according to an embodiment of the method for global optimization of a function of the present invention.

[0025] Figure 4 It is a three-dimensional space simulation diagram of an embodiment of the method for global optimization of functions of the present invention.

[0026] Figure 5 It is a simulation diagram of generating the first fragment in the three-dimensional space of the method embodiment of the global optimization of the function of the present invention.

[0027] Figure 6 It is a simulation diagram of generating second fragments in three-dimensional space in an embodiment of the method for global optimization of functions of the present invention.

[0028] The present invention will be further described below with reference to the accompanying drawings and embodiments. DETAILED DESCRIPTION

[0029] The method for global function optimization of the present invention sets a target elastic body, which collides with the target function when it intersects with the target function during free fall, so that the target elastic body can detect the global minimum value of the target function.

[0030] Example of a method for global optimization of a function: See also Figure 1 When the objective function needs to be globally optimized, the computer device first executes step S11 to obtain the objective function and draws a simulation graph of the objective function in the simulation space. Figure 2 As shown, if the objective function is a two-dimensional objective function, a simulation graph of the objective function is drawn in a two-dimensional simulation space.

[0031] After drawing the simulation graph of the objective function, step S12 is executed to obtain the target elastic body, determine the initial position of the target elastic body in the simulation space, and set the target elastic body to simulate free fall motion in the simulation space with the initial position as the starting point. When the target elastic body performs free fall motion from the initial position, the potential energy of the target elastic body is converted into kinetic energy. Figure 2 In this embodiment, the initial position is point A, and the target elastic body 11 starts to perform free fall motion from point A. In another embodiment, if the global maximum value of the objective function is to be detected, the target elastic body can be set to perform anti-gravity motion in the simulation space at the initial position.

[0032] After the target elastic body is set to simulate free fall motion with its initial position as the starting point in the simulation space, step S13 is executed to simulate elastic collision motion of the target elastic body on the simulation graph, forming a first collision point. After the target elastic body and the simulated graph of the objective function generate the first collision point (i.e., after the target elastic body and the objective function intersect), the collision angle of the target elastic body at that location is determined based on the derivative of the objective function. The next trajectory of the detection point is calculated based on the kinetic energy and the collision angle, where the kinetic energy is calculated based on the height of the target elastic body's descent. The angle of the target elastic body's trajectory after the collision is analyzed to determine whether the target elastic body is ascending or descending, thereby determining whether the target elastic body's kinetic energy is converted into potential energy or vice versa.

[0033] See also Figure 2 , since the initial position is point A, the target elastic body can jump out of the local area where point B is located and reach the second area to find the minimum value. Of course, Figure 2 In this example, the maximum value of the objective function is at point N. When determining the initial position, the user should set the height of the initial position to be greater than the maximum value of the objective function so that the objective function can search a larger space.

[0034] See also Figure 3 For the two-dimensional case, taking the target elastic body as an example, the motion equations of the displacement and velocity of the target elastic body on the horizontal axis x'x and the normal axis y'y after time t are: Among them, the horizontal velocity of the target elastic body at the final velocity V after time t is in, is the initial velocity The horizontal velocity of the target elastic body is the displacement distance of the horizontal axis x'x. The normal velocity of the target elastic body after time t is the final velocity v. .in, is the initial velocity The normal velocity is g, and g is the gravitational acceleration of free fall. The displacement distance of the target elastic body on the normal axis y'y is .

[0035] See also Figure 4 , Figure 4 The trajectory of the target elastic body in three-dimensional space is displayed. The green part is the simulation graph of the objective function.

[0036] In another embodiment, after forming the first collision point, the following further steps are performed: generating at least one first fragment at the first collision point. Figure 5, set the target elastic body 11 to break and produce at least one fragment during collision, which is the first fragment 12. The target elastic body 11 continues to perform elastic collision on the simulation graph according to the original trajectory, and multiple first fragments 12 can be scattered in random directions. That is, the computer device sets the first fragment 12 to take the position of the first collision point as the starting point, and randomly selects any direction in the simulation space to simulate the elastic collision motion to form a second collision point. After the second collision point is formed, it is determined whether the objective function value of the second collision point is less than the minimum value. If so, the objective function value of the second collision point is set to the latest minimum value. By generating the first fragment 12 at the first collision point to detect the surrounding area of the first collision point, the speed of detecting the global minimum is accelerated.

[0037] In another embodiment, after the first collision point is formed, a second fragment is simulated and generated at the first collision point, and the second fragment is set to move in a gradient descent manner to obtain the objective function value of the second fragment. Figure 6 , the target elastic body 11 generates a second fragment 13 at the first collision point, and the second fragment 13 moves in a gradient descent manner to search for the minimum objective function value of the area near the first collision point. After the minimum objective function value of the area near the first collision point is obtained by the second fragment in a gradient descent manner, that is, the objective function value of the second fragment at the final position, it is determined whether the objective function value of the second fragment at the final position is less than the minimum value. If so, the minimum value is updated to the objective function value of the second fragment. By generating the second fragment to detect the surrounding area, the speed of detecting the global minimum is accelerated.

[0038] When the target elastic body simulates elastic collision motion on the simulation pattern, the target body's current position is determined to be lower than the height of the target elastic body's corresponding position on the simulation pattern. If so, the target elastic body is set to collide. This method allows the target elastic body to return to its initial position and continue detection if an error occurs in the target elastic body detection.

[0039] After the first collision point is formed, step S14 is executed to determine whether the objective function value of the first collision point is less than the minimum value stored in the memory. The first minimum value stored in the memory is the objective function value of the first collision point formed by the target elastic body simulating elastic collision motion on the simulation graph. If the objective function value of the first collision point is less than the minimum value stored in the memory, step S15 is executed to update the minimum value as the objective function value of the first collision point. If the objective function value of the first collision point is greater than the minimum value stored in the memory, step S16 is executed without updating the minimum value.

[0040] Before updating the minimum value, that is, before determining whether the objective function value of the first collision point is less than the minimum value stored in the memory, a first time interval is set, and the first collision point of the target elastic body is obtained after the first time interval, and the objective function value of the first collision point is calculated, which can reduce the amount of calculation.

[0041] After updating the latest minimum value, step S17 is further executed to determine whether the number of collisions of the target elastic body is greater than the preset number of executions. If so, step S18 is executed to output the stored minimum value as the global minimum value. If not, step S13 is continued to set the target elastic body to continue simulating elastic collision motion on the simulation graph to form the latest collision point, and the minimum value is updated according to the objective function value of the latest collision point. In the updating of the minimum value according to the objective function value of the latest collision point, it is necessary to execute the judgment of step S14, that is, to determine whether the objective function value of the latest collision point is less than the minimum value. If so, the minimum value is updated to the objective function value of the latest collision point.

[0042] After outputting the global minimum, the second position in the simulation space is obtained. The target elastic body is set to simulate free fall motion with the second position as the starting point, and the target elastic body is set to simulate elastic collision motion on the simulation graph. The second position is another position selected by the user, which increases the probability of finding the global minimum search result.

[0043] The method of the present invention can be applied to optical communication devices such as resonators, modulators, detectors and lasers. The application of the present invention to optical communication devices can reduce loss and increase modulation speed, minimize carrier transit time to increase bandwidth, etc.

[0044] The present invention avoids rapid convergence to a local minimum near the initial point without user intervention. It simulates elastic collisions to query the global minimum, updating the state when a collision occurs. This eliminates the need for frame-by-frame trajectory calculations and avoids continuous time integration operations, significantly reducing the number of calculations, execution time, and computational costs of the computer.

[0045] Computer device embodiment: The computer device of this embodiment includes a processor and a memory. The memory stores a computer program. When the processor executes the computer program, the above-mentioned function global optimization method is implemented.

[0046] A computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that a computer device may include more or fewer components, or a combination of certain components, or different components. For example, a computer device may also include input and output devices, network access devices, a bus, and the like.

[0047] Computer readable storage medium embodiment: The method for global optimization of a function in a computer device described in the above embodiment can be stored in a computer-readable storage medium in the form of a computer program. When the computer program is executed by a processor, the steps of the above embodiment of the method for global optimization of a function in a computer device can be completed. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0048] The above are only preferred embodiments of the present invention, but the design concept of the invention is not limited to this. Without departing from the concept of the present invention, it can also include more other equivalent embodiments. It is obvious that various changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention.

Claims

1. A method for global optimization of a function, characterized in that: The method includes: Obtaining an objective function, and drawing a simulation graph of the objective function in a simulation space; Acquiring a target elastic body, determining an initial position of the target elastic body in the simulation space, and setting the target elastic body to simulate free fall motion in the simulation space with the initial position as a starting point; Setting a target elastic body to simulate elastic collision motion on the simulation graph to form a first collision point; determining whether the objective function value of the first collision point is less than a minimum value stored in a memory, and if so, updating the minimum value as the objective function value of the first collision point; Determine whether the number of collisions of the target elastic body reaches a preset number of executions, and if so, take the minimum value currently stored in the memory as the global minimum value and output the global minimum value; If the number of collisions of the target elastic body does not reach the preset number of executions, the target elastic body is set to continue simulating elastic collision motion on the simulation graph to form a latest collision point, and the minimum value is updated according to the objective function value of the latest collision point.

2. The method for global function optimization according to claim 1, wherein: After the first collision point is formed, the following steps are further executed: Simulating and generating at least one first fragment at the first collision point, setting the first fragment to take the position of the first collision point as a starting point, and randomly selecting any direction in the simulation space to simulate elastic collision motion to form a second collision point; It is determined whether the objective function value of the second collision point is less than the minimum value. If so, the minimum value is updated as the objective function value of the second collision point.

3. The method for global function optimization according to claim 1, wherein: After the first collision point is formed, the following steps are further executed: generating a second fragment at the first collision point, setting the second fragment to move in a gradient descent manner, and obtaining an objective function value of the second fragment at a final position; Determine whether the objective function value of the second fragment at the final position is less than the minimum value; if so, update the minimum value to the objective function value of the second fragment at the final position.

4. The method for global function optimization according to any one of claims 1 to 3, characterized in that: Before determining whether the objective function value of the first collision point is less than the minimum value stored in the memory, further executing: A first time interval is set, and a first collision point of the target elastic body is acquired after the first time interval.

5. The method for global function optimization according to claim 4, wherein: After outputting the global minimum, also execute: Acquiring second position information of the simulation space, and setting the target elastic body to simulate free fall motion with the second position as a starting point; A target elastic body is set to simulate elastic collision motion on the simulation graph.

6. The method for global function optimization according to any one of claims 1 to 3, characterized in that: After setting the target elastic body to simulate elastic collision motion on the simulation graph, the following steps are further performed: It is determined whether the height of the current position of the target elastic body is lower than the height of the simulation graphic corresponding to the position of the target elastic body. If so, it is set that the target elastic body collides.

7. A computer device comprising a processor and a memory, characterized in that The memory stores a computer program, and when the computer program is executed by the processor, the method for global function optimization according to any one of claims 1 to 6 is implemented.

8. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed, the method for global function optimization according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Collision positioning method based on minimum discrete variance

    CN121522751A