Real-time optimization method of process parameters in die casting process, terminal device and medium
Patent Information
- Application Number
- CN202310791678.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2043-06-30
AI Technical Summary
[0003]本申请提供了压铸过程中工艺参数的实时优化方法、终端设备及介质,可以解决目前压铸过程中工艺参数的准确性低,且实时性不强的问题
[0046]本申请通过随机初始化工艺参数对应的粒子群,并通过更新粒子群中粒子的速度和位置,实现粒子群的迭代,并将满足更新终止条件的粒子群对应的全局最优粒子位置确定为工艺参数的值,能够实现自动寻优,减小了对人为主观经验的依赖,提高了工艺参数的准确性;将适应度比例满足保存条件的粒子的位置保存在短期记忆中,全局最优粒子位置保存在长期记忆中,并根据短期记忆和长期记忆中粒子的位置更新粒子群,利用历史环境中的最优解和上一个环境中的较优解进行寻优,更容易找到全局最优解,加快了寻优速度,提高了工艺参数的准确性;通过计算环境变化检测因子,能够在环境变化时,实时更新工艺参数,提高了工艺参数的实时性。
Smart Images

Figure CN116822364B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of die casting process parameter optimization technology, and particularly relates to real-time optimization methods, terminal equipment and media for process parameters in the die casting process. Background Technology
[0002] Die casting is a casting process that uses pressure to force molten alloy into a mold cavity, where it is then cooled and solidified under pressure. Compared to conventional casting methods, die casting offers a smoother filling process, greater controllability, and produces castings with higher purity, better formability, and more precise structures, making it suitable for casting large, thin-walled, and complex parts. However, during die casting, variations in process parameters can lead to surface defects in aluminum alloy die castings, such as shrinkage, porosity, and cold shuts. Currently, there is a lack of unified and complete standards and specifications for designing and determining process parameters such as casting temperature, casting pressure, and casting speed. In actual production, these die casting process parameters are mostly determined through worker experience and repeated trials, resulting in high labor costs and low accuracy of the final parameters, severely impacting casting quality. Furthermore, as production progresses, unpredictable changes occur in the production environment, rendering previously optimal production parameters unsuitable for the current environment, leading to poor optimization results and insufficient real-time performance. Summary of the Invention
[0003] This application provides a method, terminal equipment, and medium for real-time optimization of process parameters in the die casting process, which can solve the problems of low accuracy and poor real-time performance of process parameters in the current die casting process.
[0004] In a first aspect, this application provides a method for real-time optimization of process parameters during die casting, including:
[0005] Step 1: Determine the process parameters to be optimized and the casting quality evaluation indicators during the die casting process; the casting quality evaluation indicators include casting hardness, casting surface roughness, casting porosity, and casting surface defect area.
[0006] Step 2: Randomly initialize the initial particle swarm corresponding to the process parameters; wherein, the position of each particle in the initial particle swarm represents a set of values of the process parameters, and the positions of multiple particles in the initial particle swarm are all different.
[0007] Step 3: Based on the casting quality evaluation index corresponding to the position of each particle in the initial particle swarm, obtain the fitness ratio of each particle in the current environment; the fitness ratio is used to characterize the excellence of the particles.
[0008] Step 4: For each particle, if the fitness ratio of the particle meets the preset storage conditions, the position of the particle is stored in short-term memory to obtain the first set of process parameter values.
[0009] Step 5: Update the velocity and position of each particle in the initial particle swarm to obtain a new particle swarm. If the new particle swarm meets the update termination condition, save the global optimal particle position in the new particle swarm in long-term memory to obtain the second set of process parameters; otherwise, use the new particle swarm as the initial particle swarm in step 3 and return to execute step 3.
[0010] Step 6: Calculate the environmental change detection factor corresponding to the current environment. If the environmental change detection factor is greater than or equal to the preset threshold, a new initial particle swarm is obtained based on the first value set and the second value set. The new initial particle swarm is then used as the initial particle swarm in Step 3, and Step 3 is returned to be executed. Otherwise, the values of the process parameters in the current environment are optimized to the global optimal particle position.
[0011] Optionally, step 3 includes:
[0012] Through calculation formula
[0013] f(X i |k)=t1f1(X i |k)-t2f2(X i |k)-t3f3(X i |k)-t4f4(X i |k)
[0014] Get the fitness f(X) of the i-th particle in the current environment. i |k); where f1(X) i |k) represents the casting hardness corresponding to the position of the i-th particle, i = 1, 2, ..., M, where M represents the total number of particles, f2(X i |k) represents the surface roughness of the casting corresponding to the position of the i-th particle, f3(X i |k) represents the casting porosity corresponding to the position of the i-th particle, f4(X i |k) represents the surface defect area of the casting corresponding to the position of the t-th particle, t1 represents the weight of casting hardness, t2 represents the weight of casting surface roughness, t3 represents the weight of casting porosity, and t4 represents the weight of surface defect area of the casting.
[0015] Through calculation formula
[0016]
[0017] The fitness ratio R of each particle is obtained. i Among them, Ri f represents the fitness ratio of the i-th particle. best (k) represents the optimal fitness in the current environment, f worst (k) represents the worst fitness in the current environment.
[0018] Optionally, the saving condition in step 4 is R. l ≤R i ≤R u Among them, R l R represents the lower bound of the proportion of particles with fitness in short-term memory. u This represents the upper bound of the proportion of particles in short-term memory.
[0019] Optionally, step 5 updates the velocity and position of each particle in the initial particle swarm, including:
[0020] Through calculation formula
[0021] V i (t+1)=wV i (t)+c1r1[p id (t)-X i (t)]+c2r2[p gd (t)-X i (t)]
[0022] Obtain the updated velocity V for each particle i (t+1); where V i (t+1) represents the velocity of the i-th particle in generation t+1, p id (t) represents the optimal position of the i-th particle before generation t, p gd (t) represents the optimal position of all particles before generation t, w represents the inertia weight, c1 represents the influence weight of the local optimal position, c2 represents the influence weight of the global optimal position, and r1 and r2 are both random numbers, r1 and r2 ∈ (0, 1).
[0023] By calculating formula X i (t+1)=X i (t)+V i (t+1), obtain the updated position X of each particle. i (t+1); where X i (t+1) represents the position of the i-th particle in generation t+1.
[0024] Optionally, step 6 calculates the environmental change detection factor corresponding to the current environment, including:
[0025] Through calculation formula
[0026]
[0027] The environmental change detection factor δ(k) corresponding to the current environment is obtained; where ε represents an arbitrarily small positive number, N represents the number of randomly selected particles, j = 1, 2, ..., N.
[0028] Optionally, in step 6, a new initial particle swarm is obtained based on the first set of values and the second set of values, including:
[0029] Through calculation formula
[0030]
[0031] The position X′ of each particle in the new initial particle swarm is obtained. i Among them, SM u LM represents the position of the u-th particle in the first set of values SM. v P represents the position of the v-th particle in the second set of values LM. sm ∈[0,1],p lm ∈[0,1],p sm +p lm <1, where n represents the total number of particles in the new initial particle swarm;
[0032] The velocity of each particle in the new initial particle swarm is randomly initialized to obtain the new initial particle swarm.
[0033] Optionally, the update termination condition is that the generation of the new particle swarm is greater than or equal to the preset maximum generation of the particle swarm; where the generation of the new particle swarm represents the number of times step 5 is executed.
[0034] Optionally, before performing step 4, the real-time optimization method for process parameters during die casting provided in this application further includes:
[0035] Clear short-term memory.
[0036] Secondly, this application provides a device for real-time optimization of process parameters during die casting, comprising:
[0037] The optimization and determination module is used to determine the process parameters to be optimized and the casting quality evaluation indicators during the die casting process; the casting quality evaluation indicators include casting hardness, casting surface roughness, casting porosity, and casting surface defect area;
[0038] The initial particle swarm module is used to randomly initialize the initial particle swarm corresponding to the process parameters; where the position of each particle in the initial particle swarm represents a set of values of the process parameters, and the positions of multiple particles in the initial particle swarm are all different.
[0039] The fitness ratio calculation module is used to obtain the fitness ratio of each particle in the current environment based on the casting quality evaluation index corresponding to the position of each particle in the initial particle swarm; the fitness ratio is used to characterize the excellence of the particles.
[0040] The short-term memory storage module is used to store the position of each particle in short-term memory if the fitness ratio of the particle meets the preset storage conditions, thus obtaining the first set of process parameter values.
[0041] The long-term memory storage module is used to update the velocity and position of each particle in the initial particle swarm to obtain a new particle swarm. If the new particle swarm meets the update termination condition, the global optimal particle position in the new particle swarm is saved in the long-term memory to obtain the second set of process parameters; otherwise, the new particle swarm is used as the initial particle swarm in the fitness ratio calculation module, and the execution of the fitness ratio calculation module is returned.
[0042] The process parameter optimization module is used to calculate the environmental change detection factor corresponding to the current environment. If the environmental change detection factor is greater than or equal to the preset threshold, a new initial particle swarm is obtained based on the first value set and the second value set. The new initial particle swarm is then used as the initial particle swarm in the fitness ratio calculation module, and the module is returned to be executed. Otherwise, the values of the process parameters under the current environment are optimized to the globally optimal particle positions.
[0043] Thirdly, this application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-mentioned method for real-time optimization of process parameters during the die-casting process.
[0044] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for real-time optimization of process parameters during die casting.
[0045] The above-mentioned solution in this application has the following beneficial effects:
[0046] This application achieves automatic optimization by randomly initializing the particle swarm corresponding to the process parameters and updating the velocity and position of the particles in the swarm to realize the iteration of the particle swarm. The position of the globally optimal particle corresponding to the particle swarm that meets the update termination condition is determined as the value of the process parameter. This reduces the reliance on human subjective experience and improves the accuracy of the process parameters. The positions of particles whose fitness ratio meets the storage condition are stored in short-term memory, and the positions of the globally optimal particles are stored in long-term memory. The particle swarm is updated based on the positions of particles in short-term and long-term memory. Optimization is performed by using the best solution in the historical environment and the better solution in the previous environment, which makes it easier to find the globally optimal solution, speeds up the optimization process, and improves the accuracy of the process parameters. By calculating the environmental change detection factor, the process parameters can be updated in real time when the environment changes, improving the real-time performance of the process parameters.
[0047] Other beneficial effects of this application will be described in detail in the following detailed description section. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0049] Figure 1 A flowchart illustrating a real-time optimization method for process parameters during die casting, as provided in an embodiment of this application;
[0050] Figure 2 This is a schematic diagram of the structure of an LMBP model provided in an embodiment of this application;
[0051] Figure 3 This is a schematic diagram of the structure of a data sliding window provided in an embodiment of this application;
[0052] Figure 4 A schematic diagram of the structure of a real-time optimization device for process parameters in the die-casting process provided in an embodiment of this application;
[0053] Figure 5 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation
[0054] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0055] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0056] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0057] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0058] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0059] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0060] To address the issues of low accuracy and poor real-time performance of process parameters in current die-casting processes, this application provides a real-time optimization method, terminal equipment, and medium for process parameters during die-casting. By randomly initializing the particle swarm corresponding to the process parameters and updating the velocity and position of particles within the swarm, iterative processing of the particle swarm is achieved. The globally optimal particle position corresponding to the particle swarm that meets the update termination condition is determined as the value of the process parameter. This enables automatic optimization, reducing reliance on human subjective experience and improving the accuracy of process parameters. The positions of particles whose fitness ratios meet the storage conditions are stored in short-term memory, while the globally optimal particle position is stored in long-term memory. The particle swarm is updated based on the particle positions in both short-term and long-term memory. Optimization is performed using the best solution from the historical environment and a relatively good solution from the previous environment, making it easier to find the globally optimal solution, accelerating the optimization speed, and improving the accuracy of process parameters. By calculating an environmental change detection factor, process parameters can be updated in real-time when the environment changes, improving the real-time performance of process parameters.
[0061] like Figure 1 As shown, the real-time optimization method for process parameters during die casting provided in this application includes the following steps:
[0062] Step 1: Determine the process parameters to be optimized and the quality evaluation indicators of the castings during the die casting process.
[0063] The above-mentioned casting quality evaluation indicators include casting hardness, casting surface roughness, casting porosity, and casting surface defect area.
[0064] The following explanation uses aluminum alloy die casting as an example to illustrate the specific process of step 1:
[0065] Step 1.1: Use historical die-casting data of aluminum alloy die casting as a data sample, replace missing values in the data sample with the average value of similar data, remove data samples with duplicate values and outliers, and then normalize the data sample.
[0066] This ensures the validity of the data samples, and the normalized data samples are easier to process in subsequent calculations.
[0067] Step 1.2: Calculate the correlation coefficients between each process parameter and the casting quality evaluation index during the aluminum alloy die casting process, and sort each process parameter in descending order of correlation coefficient, selecting the top 6 process parameters as the process parameters to be optimized.
[0068] For example, the process parameters to be optimized are the liquid injection pressure, filling pressure, holding pressure, holding time, initial molten alloy temperature, and initial mold temperature.
[0069] Step 1.3: Construct an initial casting quality prediction model based on the process parameters to be optimized and the casting quality evaluation indicators.
[0070] Specifically, an initial casting quality prediction model is constructed based on the Levenberg-Marquardt Backpropagation (LMBP) algorithm, using the process parameters to be optimized as input and the casting quality evaluation index as output. For example... Figure 2 As shown in the embodiments of this application, the structure of the LMBP model can be set as 6-9-9-4. Here, x1, x2, x3, x4, x5, and x6 correspond to the liquid injection pressure, filling pressure, holding pressure, holding time, initial molten alloy temperature, and initial mold temperature, respectively; f1, f2, f3, and f4 correspond to the casting hardness, casting surface roughness, casting porosity, and casting surface defect area, respectively.
[0071] Step 1.4: Based on the casting quality prediction model, construct the die casting process parameter optimization problem.
[0072] Specifically, the above-mentioned die-casting process parameter optimization problem can be expressed as:
[0073]
[0074] Among them, a i (i = 1, 2, ..., 6) represent the process parameters x to be optimized. i The lower bound of the values of (i = 1, 2, ..., 6), b i (i = 1, 2, ..., 6) represent the process parameters x to be optimized. i The upper limit of the values of (i = 1, 2, ..., 6).
[0075] Solving the above optimization problem will allow us to determine the process parameters in the aluminum alloy die-casting process.
[0076] Step 2: Randomly initialize the initial particle swarm corresponding to the process parameters.
[0077] For example, the number of particles in the particle swarm can be set to 80, and the solution space corresponding to the particle swarm is a 6-dimensional space composed of the process parameters to be optimized in step 1.
[0078] The positions and velocities of each particle are randomly initialized in the solution space. The position of each particle in the initial particle swarm represents a set of process parameters, and the positions of multiple particles in the initial particle swarm are distinct.
[0079] It should be noted that randomly initializing the position and velocity of each particle can increase the diversity of process parameter schemes (values of process parameters), which is beneficial for determining the optimal process parameters.
[0080] Step 3: Based on the casting quality evaluation index corresponding to the position of each particle in the initial particle swarm, obtain the fitness ratio of each particle in the current environment.
[0081] The fitness ratio mentioned above is used to characterize the excellence of a particle. Specifically, the higher the fitness ratio of a particle, the more excellent the particle is, and the greater the probability of it being selected.
[0082] Step 4: For each particle, if the fitness ratio of the particle meets the preset storage conditions, the position of the particle is stored in short-term memory to obtain the first set of process parameter values.
[0083] The above storage conditions are R l ≤R i ≤R u Among them, R l R represents the lower bound of the proportion of particles with fitness in short-term memory. u This represents the upper bound of the proportion of particles in short-term memory.
[0084] The first set of values mentioned above includes the positions of multiple particles.
[0085] In the embodiments of this application, the aforementioned short-term memory is used to store the position of particles and can be any kind of data storage medium, without any limitation on its specific form.
[0086] It should be noted that, before the loop returns to step 4, the real-time optimization method for process parameters during die casting provided in this application also includes:
[0087] Clear short-term memory.
[0088] Step 5: Update the velocity and position of each particle in the initial particle swarm to obtain a new particle swarm. If the new particle swarm meets the update termination condition, save the global optimal particle position in the new particle swarm in long-term memory to obtain the second set of process parameters; otherwise, use the new particle swarm as the initial particle swarm in step 3 and return to execute step 3.
[0089] The second set of values mentioned above includes the globally optimal particle positions of the particle swarm in the historical environment.
[0090] In the embodiments of this application, the long-term memory used to store the position of particles can be any kind of data storage medium, and its specific form is not limited herein.
[0091] It should be noted that the above update termination condition is that the generation of the new particle swarm is greater than or equal to the preset maximum generation of the particle swarm; where the generation of the new particle swarm represents the number of times step 5 is executed.
[0092] Step 6: Calculate the environmental change detection factor corresponding to the current environment. If the environmental change detection factor is greater than or equal to the preset threshold, a new initial particle swarm is obtained based on the first value set and the second value set. The new initial particle swarm is then used as the initial particle swarm in Step 3, and Step 3 is returned to be executed. Otherwise, the values of the process parameters under the current environment are optimized to the global optimal particle position.
[0093] In some embodiments of this application, after obtaining the values of the process parameters, the following steps are performed to achieve real-time optimization of the process parameters during die casting:
[0094] Step a: Use a data sliding window to select data samples for model training.
[0095] Specifically, a data sliding window can be represented as:
[0096]
[0097] Where N represents the total number of data samples pre-stored in the database, and (x1, y1) represents the earliest stored data sample in the database. N y N This indicates that the database stores the most recent data sample.
[0098] It should be noted that the size of the data sliding window is fixed at L. Therefore, when the number of data samples in the data sliding window reaches L, the oldest data sample in the data sliding window will be deleted when new data samples are added to the data sliding window in the next scroll.
[0099] Specifically, such as Figure 3 As shown, N=1 represents a sliding window of data (e.g. Figure 3 In the context of 301, the sliding window contains data sample (x1, y1). N=2 indicates that the sliding window contains data sample (x1, y1) and data sample (x2, y2), and so on. When N=L, it means the sliding window contains (x1, y1), (x2, y2), ..., (x...). N y N At this point, the number of samples in the data sliding window reaches its maximum value. When the data sliding window includes the (L+1)th data sample, the first data sample (x1, y1) needs to be removed. The subsequent process is the same.
[0100] In one embodiment of this application, taking into account both the limitations of modeling time and the requirements of model accuracy, the size of the data sliding window can be set to 400.
[0101] Step b: Based on the initial casting quality prediction model, calculate the output of each node in the hidden layer and output layer of the BP neural network.
[0102] Step c, through calculation formula
[0103]
[0104]
[0105] The model error vector E is obtained; where e i Let μ represent the training error of the i-th data sample, and μ represent the forgetting factor, which makes the latest data sample in the data sliding window have a higher weight in the model training.
[0106] Step d, calculate formula W k+1 =W k -(J T J+μI -1 )J T E, to obtain the weights W of each layer in the LMBP neural network. k+1 .
[0107] Among them, W k+1 W represents the weights of each layer in the LMBP neural network during the (k+1)th iteration. k Let J represent the weights of each layer in the LMBP neural network during the k-th iteration, and let J represent the Jacobian matrix of the derivative of the model error vector E with respect to the weights.
[0108] The following is an illustrative example of the specific process of step 3 (obtaining the fitness ratio of each particle in the current environment based on the casting quality evaluation index corresponding to the position of each particle in the initial particle swarm).
[0109] Step 3.1, using the calculation formula
[0110] f(X i |k)=t1f1(X i |k)-t2f2(X i |k)-t3f3(X i |k)-t4f4(X i |k)
[0111] Obtain the fitness f(X) of the i-th particle in the current environment. i |k).
[0112] Where, f1(X) i |k) represents the casting hardness corresponding to the position of the i-th particle, i = 1, 2, ..., M, where M represents the total number of particles, f2(X i |k) represents the surface roughness of the casting corresponding to the position of the i-th particle, f3(X i |k) represents the casting porosity corresponding to the position of the i-th particle, f4(X i|k) represents the surface defect area of the casting corresponding to the position of the i-th particle, t1 represents the weight of casting hardness, t2 represents the weight of casting surface roughness, t3 represents the weight of casting porosity, and t4 represents the weight of surface defect area of the casting.
[0113] Step 3.2, using the calculation formula
[0114]
[0115] Obtain the fitness ratio R of each particle in the current environment. i .
[0116] Among them, R i f represents the fitness ratio of the i-th particle. best (k) represents the optimal fitness in the current environment, f worst (k) represents the worst fitness in the current environment.
[0117] The following is an exemplary description of the specific process of updating the velocity and position of each particle in the initial particle swarm in step 5.
[0118] Step 5.1, using the calculation formula
[0119] V i (t+1)=wV i (t)+c1r1[p id (t)-X i (t)]+c2r2[p gd (t)-X i (t)]
[0120] Obtain the updated velocity V for each particle i (t+1).
[0121] Among them, V i (t+1) represents the velocity of the t-th particle in generation t+1, p id (t) represents the optimal position of the i-th particle before generation t, p gd (t) represents the optimal position of all particles before generation t, w represents the inertia weight, c1 represents the influence weight of the local optimal position, c2 represents the influence weight of the global optimal position, and r1 and r2 are both random numbers, r1 and r2 ∈ (0, 1).
[0122] Step 5.2, calculate X using formula i (t+1)=X i (t)+V i (t+1), obtain the updated position X of each particle. i (t+1).
[0123] Among them, X i (t+1) represents the position of the i-th particle in generation t+1.
[0124] The following is an exemplary description of the specific process for calculating the environmental change detection factor corresponding to the current environment in step 6.
[0125] Specifically, through the calculation formula
[0126]
[0127] The environmental change detection factor δ(k) corresponding to the current environment is obtained.
[0128] Where ε represents an arbitrarily small positive number, N represents the number of randomly selected particles, j = 1, 2, ..., N.
[0129] The following is an exemplary description of the specific process in step 6 of obtaining a new initial particle swarm based on the first set of values and the second set of values.
[0130] Step 6.1, using the calculation formula
[0131]
[0132] The position X′ of each particle in the new initial particle swarm is obtained. i .
[0133] Among them, SM u LM represents the position of the u-th particle in the first set of values SM. v p represents the position of the v-th particle in the second set of values LM. sm ∈[0,1],p lm ∈[0,1],p sm +p lm <1, where n represents the total number of particles in the new initial particle swarm.
[0134] Step 6.2: Randomly initialize the velocity of each particle in the new initial particle swarm to obtain the new initial particle swarm.
[0135] The following is an exemplary description of the real-time optimization device for process parameters during the die casting process provided in this application.
[0136] like Figure 4 As shown, the real-time optimization device 400 for process parameters during the die-casting process includes:
[0137] The optimization and determination module 401 is used to determine the process parameters to be optimized and the casting quality evaluation indicators during the die casting process; the casting quality evaluation indicators include casting hardness, casting surface roughness, casting porosity and casting surface defect area.
[0138] The initial particle swarm module 402 is used to randomly initialize the initial particle swarm corresponding to the process parameters; wherein, the position of each particle in the initial particle swarm represents a set of values of the process parameters, and the positions of multiple particles in the initial particle swarm are all different.
[0139] The fitness ratio calculation module 403 is used to obtain the fitness ratio of each particle in the current environment based on the casting quality evaluation index corresponding to the position of each particle in the initial particle swarm; the fitness ratio is used to evaluate the excellence of the particles.
[0140] The short-term memory storage module 404 is used to store the position of each particle in the short-term memory if the fitness ratio of the particle meets the preset storage conditions, thereby obtaining the first set of process parameter values.
[0141] The long-term memory storage module 405 is used to update the velocity and position of each particle in the initial particle swarm to obtain a new particle swarm. If the new particle swarm meets the update termination condition, the global optimal particle position in the new particle swarm is saved in the long-term memory to obtain the second set of process parameters; otherwise, the new particle swarm is used as the initial particle swarm in the fitness ratio calculation module, and the execution of the fitness ratio calculation module is returned.
[0142] The process parameter optimization module 406 is used to calculate the environmental change detection factor corresponding to the current environment. If the environmental change detection factor is greater than or equal to the preset threshold, a new initial particle swarm is obtained according to the first value set and the second value set, and the new initial particle swarm is used as the initial particle swarm in the fitness ratio calculation module, and the execution of the fitness ratio calculation module is returned; otherwise, the value of the process parameter in the current environment is optimized to the global optimal particle position.
[0143] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0144] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0145] like Figure 5 As shown, embodiments of this application provide a terminal device, such as... Figure 5 As shown, the terminal device D10 of this embodiment includes: at least one processor D100 ( Figure 5 The diagram shows only one processor, a memory D101, and a computer program D102 stored in the memory D101 and executable on the at least one processor D100, wherein the processor D100 executes the computer program D102 to implement the steps in any of the above method embodiments.
[0146] Specifically, when the processor D100 executes the computer program D102, it determines the process parameters to be optimized and the casting quality evaluation index during the die casting process. Then, it randomly initializes the initial particle swarm corresponding to the process parameters. Based on the casting quality evaluation index corresponding to the position of each particle in the initial particle swarm, it obtains the fitness ratio of each particle. For each particle, if the fitness ratio of the particle meets the preset storage conditions, the particle's position is stored in short-term memory, resulting in the first set of process parameter values. Then, the velocity and position of each particle in the initial particle swarm are updated to obtain a new particle swarm. If the new particle swarm meets the update termination condition, the globally optimal particle position in the new particle swarm is stored in long-term memory, resulting in the second set of process parameter values. Then, the environmental change detection factor corresponding to the current environment is calculated. If the environmental change detection factor is greater than or equal to a preset threshold, a new initial particle swarm is obtained based on the first and second value sets, and the fitness ratio of each particle in the new initial particle swarm is recalculated. Otherwise, the value of the process parameters in the current environment is optimized to the globally optimal particle position. Specifically, the particle swarm corresponding to the random initialization of process parameters is used to iterate the particle swarm by updating the velocity and position of particles in the swarm. The globally optimal particle position corresponding to the particle swarm that meets the update termination condition is determined as the value of the process parameter. This enables automatic optimization, reduces reliance on human subjective experience, and improves the accuracy of process parameters. The positions of particles whose fitness ratio meets the storage condition are stored in short-term memory, while the globally optimal particle position is stored in long-term memory. The particle swarm is updated based on the particle positions in short-term and long-term memory. Optimization is performed using the best solution in the historical environment and the better solution in the previous environment, making it easier to find the globally optimal solution, accelerating the optimization speed, and improving the accuracy of process parameters. By calculating the environmental change detection factor, process parameters can be updated in real time when the environment changes, improving the real-time performance of process parameters.
[0147] The processor D100 can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0148] In some embodiments, the memory D101 may be an internal storage unit of the terminal device D10, such as a hard disk or memory of the terminal device D10. In other embodiments, the memory D101 may be an external storage device of the terminal device D10, such as a plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the terminal device D10. Furthermore, the memory D101 may include both internal and external storage units of the terminal device D10. The memory D101 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory D101 can also be used to temporarily store data that has been output or will be output.
[0149] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0150] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the above-described method embodiments.
[0151] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a real-time optimization device / terminal device for process parameters in the die-casting process, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0152] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0153] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0154] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0155] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0156] The real-time optimization method for process parameters during die casting provided in this application has the following advantages:
[0157] 1. Establish a quality prediction model based on real-time collected data, and optimize parameters based on the quality prediction model to reduce the number of real experiments in the parameter optimization process, thereby reducing costs and improving efficiency.
[0158] 2. The quality prediction model and parameter optimization problem are updated continuously with the collection of data. Since the casting process is based on certain processing conditions, while actual casting conditions are dynamically changing, errors exist between the actual casting results and the predicted results. Optimized casting parameters may not be applicable to the current casting conditions. Therefore, this application proposes feeding the obtained optimal parameters back into the physical die-casting process for production, collecting production results in real time, and iteratively updating the quality prediction model and parameter optimization problem accordingly. This continuously and dynamically generates optimal process parameters, enhancing the adaptability and anti-interference capabilities of the optimal die-casting process parameters.
[0159] 3. Considering the potential connection between two consecutive environments, and that information from previous environments may aid in the optimization process in the current environment, a particle swarm optimization algorithm based on long short-term memory is proposed for parameter optimization. After environmental changes cause changes in the objective function, the algorithm utilizes the optimal solution from historical environments and a relatively good solution from the previous environment to optimize the new objective function. This makes it easier for the algorithm to find the global optimum, accelerates the optimization speed, and enhances the real-time performance of the optimal die-casting process parameters.
[0160] 4. Use a sliding window during the online update of the prediction model to avoid slow model building due to excessive data volume, which would affect the real-time performance of prediction and optimization. At the same time, because the production conditions of the newly collected data are more similar to the current production conditions, a forgetting factor is introduced during the learning process of the quality prediction model on the sample data, so that the new data has a higher weight in the prediction model.
[0161] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles described in this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for real-time optimization of process parameters during die casting, characterized in that, include: Step 1: Determine the process parameters to be optimized and the casting quality evaluation indicators during the die casting process; the casting quality evaluation indicators include casting hardness, casting surface roughness, casting porosity, and casting surface defect area. Step 2: Randomly initialize the initial particle swarm corresponding to the process parameters; wherein, the position of each particle in the initial particle swarm represents a set of values of the process parameters, and the positions of multiple particles in the initial particle swarm are all different. Step 3: Based on the casting quality evaluation index corresponding to the position of each particle in the initial particle swarm, obtain the fitness ratio of each particle in the current environment; the fitness ratio is used to characterize the excellence of the particles. Step 4: For each particle, if the fitness ratio of the particle meets the preset storage conditions, the position of the particle is stored in short-term memory to obtain the first set of values for the process parameters. Step 5: Update the velocity and position of each particle in the initial particle swarm to obtain a new particle swarm. If the new particle swarm meets the update termination condition, save the global optimal particle position in the new particle swarm in long-term memory to obtain the second set of values for the process parameters; otherwise, use the new particle swarm as the initial particle swarm in step 3 and return to execute step 3. Step 6: Calculate the environmental change detection factor corresponding to the current environment. If the environmental change detection factor is greater than or equal to a preset threshold, then a new initial particle swarm is obtained based on the first value set and the second value set, including: Through calculation formula The position of each particle in the new initial particle swarm is obtained. ;in, Represents the first set of values The first in The position of each particle. Represents the second set of values The first in The position of each particle. , , , This represents the total number of particles in the new initial particle swarm; The velocity of each particle in the new initial particle swarm is randomly initialized to obtain the new initial particle swarm, and the new initial particle swarm is used as the initial particle swarm in step 3. Then, step 3 is returned to be executed. Otherwise, the value of the process parameter in the current environment is optimized to the global optimal particle position.
2. The real-time optimization method according to claim 1, characterized in that, Step 3 includes: Through calculation formula Get the current environment Fitness of individual particles ;in, Indicates the first The position of each particle corresponds to the casting hardness. , This represents the total number of particles. Indicates the first The surface roughness of the casting corresponding to the position of each particle Indicates the first The porosity of the casting corresponding to the position of each particle. Indicates the first The area of surface defects on the casting corresponding to the position of each particle. The weight representing the hardness of the casting. The weight representing the surface roughness of the casting. The weight representing the porosity of the casting. The weight representing the area of surface defects in the casting; Through calculation formula The fitness ratio of each particle is obtained. ;in, Indicates the first The fitness ratio of individual particles This represents the optimal fitness in the current environment. This represents the worst fitness in the current environment.
3. The real-time optimization method according to claim 2, characterized in that, The storage conditions in step 4 are as follows: ;in, This represents the lower bound of the proportion of particles with fitness in short-term memory. This represents the upper bound of the proportion of particles in short-term memory.
4. The real-time optimization method according to claim 3, characterized in that, Step 5, which updates the velocity and position of each particle in the initial particle swarm, includes: Through calculation formula Get the updated velocity of each particle ;in, Indicates the first The particle in the first The speed of generation Indicates the first The particle in the first The optimal position that appeared in the previous generation. Indicates that all particles are in the first... The optimal position that appeared in the previous generation. Indicates inertia weight, The weight representing the influence of the local optimal position. The weight representing the influence of the global optimal position. All represent random numbers. ; Through calculation formula To obtain the updated position of each particle ;in, Indicates the first The particle in the first The position of the generation.
5. The real-time optimization method according to claim 4, characterized in that, Step 6 involves calculating the environmental change detection factor corresponding to the current environment, including: Through calculation formula Obtain the environmental change detection factor corresponding to the current environment. ;in, Represent an arbitrarily small positive number. This indicates the number of randomly selected particles. .
6. The real-time optimization method according to claim 1, characterized in that, The update termination condition is that the generation of the new particle swarm is greater than or equal to the preset maximum generation of the particle swarm; wherein, the generation of the new particle swarm represents the number of times step 5 is executed.
7. The real-time optimization method according to claim 1, characterized in that, Before performing step 4, the real-time optimization method further includes: Clear short-term memory.
8. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the real-time optimization method for process parameters during die casting as described in any one of claims 1 to 7.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the real-time optimization method for process parameters in the die-casting process as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Laser welding process parameter optimization method based on Bagging integrated prediction model and particle swarm optimization algorithm
CN110405343A
Method for optimizing flash groove parameters and forging process parameters of hinge beam forging die
CN116227181A