Method for predicting anodic oxidation dyeing time, electronic equipment and storage medium
By constructing the prior parameter feature matrix and using the staining time prediction model, calculating the staining time residual and compensating the staining time residual, the problem of low accuracy in predicting anodized dyeing time in the prior art was solved, and higher prediction accuracy and process efficiency were achieved.
Patent Information
- Application Number
- CN202411795390.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-07
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, the accuracy of predicting the anodized dyeing time is not high, resulting in the impact of the dyeing quality.
By obtaining the prior process data, the prior parameter feature matrix is constructed, and the staining time prediction model and linear regression equation system are used to calculate the staining time residual and the compensation staining time residual, correct the previous staining time, and obtain the predicted staining time of this anodized dyeing process.
It improves the accuracy of predicting dyeing time, improves the efficiency of the anodizing process, and reduces resource waste.
Smart Images

Figure CN119889507A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of production and manufacturing technology, and in particular to a method for predicting anodizing dyeing time, an electronic device and a storage medium. Background Art
[0002] In the industrial processing, when some metal materials (for example, aluminum alloy) are made into metal products, they need to be anodized and dyed to improve the wear resistance of the metal products. The anodizing and dyeing process can also be called the anodic dyeing process. The anodic dyeing process can include multiple processing processes, such as degreasing, alkali biting, chemical polishing, oxidation, dyeing, etc. Each process corresponds to one or more slots. In order to avoid waste of resources due to dyeing failure, the dyeing time is usually predicted before dyeing.
[0003] In the related art, a prediction model is usually used to predict the dyeing time. Such prediction models usually use the total dyeing time as a training label during training, which cannot adapt to the changes of different workpieces and different dyeing requirements, which may cause the prediction model to deviate when predicting the dyeing time, thereby affecting the dyeing quality. Summary of the invention
[0004] The embodiments of the present application disclose a method for predicting anodizing dyeing time, an electronic device, and a storage medium, which solve the technical problem of low accuracy in predicting dyeing time in the related art.
[0005] The present application provides a method for predicting anodizing dyeing time, the method comprising: obtaining prior process data and constructing a prior parameter feature matrix; wherein the prior parameter feature matrix comprises parameter feature values corresponding to a set of related parameter types in the process data; the set of related parameter types comprises a plurality of processing parameter types whose correlation with anodizing dyeing process satisfies preset conditions; based on the prior parameter feature matrix and a dyeing time prediction model, a dyeing time residual value is obtained; based on a preset linear regression equation group and the prior parameter feature matrix, a compensated dyeing time residual is obtained; based on the dyeing time residual value and the compensated dyeing time residual, a previous dyeing time of a previous anodizing dyeing process is corrected to obtain a predicted dyeing time of a workpiece in this anodizing dyeing process.
[0006] In some optional embodiments, the method also includes: acquiring historical process data, constructing a historical parameter feature matrix and a historical dyeing time difference matrix; wherein, the historical parameter feature matrix contains parameter feature values corresponding to each dyeing process; the historical dyeing time difference matrix contains the dyeing time difference between two adjacent dyeing processes; according to the correlation between the historical parameter feature matrix and the historical dyeing time difference matrix, determining multiple types of processing parameter types in the historical parameter feature matrix whose correlation with the historical dyeing time difference matrix meets the preset conditions, and constructing the related parameter type set; performing linear regression iterations on the parameter feature values corresponding to each type of parameter type in the related parameter type set in the historical parameter feature matrix and the historical dyeing time difference matrix, obtaining the linear regression equation group and the dyeing time residual matrix corresponding to each dyeing process; using the historical parameter feature matrix and the dyeing time residual matrix as training sets, training candidate prediction models, and obtaining the dyeing time prediction model.
[0007] In some optional embodiments, the steps of acquiring historical process data and constructing a historical parameter feature matrix and a historical dyeing time difference matrix include: performing feature processing on chemical detection data in the historical process data to acquire a historical detection parameter feature matrix; performing feature processing on high-frequency data and / or low-frequency data in the historical process data to acquire a historical high-frequency parameter feature matrix and / or a historical low-frequency parameter feature matrix; wherein the high-frequency data is process data collected more than a set threshold value in a single anodizing dyeing process; the low-frequency data is process data collected no more than the set threshold value in a single anodizing dyeing process; and constructing the historical parameter feature matrix based on the historical detection parameter feature matrix, the historical high-frequency parameter feature matrix, and / or the historical low-frequency parameter feature matrix.
[0008] In some optional embodiments, the step of determining, based on the correlation between the historical parameter feature matrix and the historical dyeing time difference matrix, multiple types of processing parameter types in the historical parameter feature matrix whose correlation with the historical dyeing time difference matrix meets the preset conditions, and constructing the set of related parameter types includes: step 11, using the historical parameter feature matrix as an iterative parameter feature matrix; step 12, obtaining the correlation between each type of parameter characteristic value in the iterative parameter feature matrix and the historical dyeing time difference matrix, and taking the processing parameter type with the highest correlation as the parameter type for this iteration; step 13, eliminating the parameter characteristic values corresponding to the parameter type for this iteration in the iterative parameter feature matrix, and updating the iterative parameter feature matrix; step 14, repeating steps 12 to 13 until the iteration ends, and constructing the set of related parameter types based on the parameter types for this iteration obtained in previous iterations.
[0009] In some optional embodiments, the step of obtaining the correlation between each type of parameter characteristic value in the iterative parameter characteristic matrix and the historical dyeing time difference matrix includes: calculating the j-th type of parameter characteristic value in the iterative parameter characteristic matrix according to a first calculation formula The correlation with the historical dyeing time difference matrix; wherein the first calculation formula includes:
[0010]
[0011] Among them, x ij is the j-th parameter characteristic value of the i-th dyeing process in the iterative parameter characteristic matrix; is the mean of the characteristic values of the j-th parameter; y i is the dyeing time difference between the i-th dyeing process and the i-1-th dyeing process in the historical dyeing time difference matrix; is the mean of the dyeing time difference; m is the total number of dyeing processes; and n is the ordinal number of the parameter characteristic value.
[0012] In some optional embodiments, the step 12 also includes: constructing the current linear regression equation based on the parameter characteristic values corresponding to the parameter types of the current iteration and the historical dyeing time difference matrix; the step 14 also includes: constructing the linear regression equation group based on the current linear regression equation obtained in previous iterations.
[0013] In some optional embodiments, the step of obtaining the compensatory dyeing time residual based on the preset linear regression equation group and the prior parameter feature matrix includes: calculating the compensatory dyeing time residual Δt according to a second calculation formula; wherein the second calculation formula includes:
[0014]
[0015] Among them, ψ k It represents the result of substituting the first K parameter eigenvalues of the prior parameter characteristic matrix into the linear regression equation system; a k and b k represents the regression coefficient; K represents the number of parameter eigenvalues.
[0016] In some optional embodiments, the step of obtaining the predicted dyeing time of the workpiece in the current anodizing dyeing process based on the dyeing time residual value, the compensated dyeing time residual and the previous dyeing time of the previous anodizing dyeing process comprises: calculating the predicted dyeing time T of the workpiece according to a third calculation formula; wherein the third calculation formula comprises:
[0017]
[0018] Where T0 represents the last staining time, represents the residual value of dyeing time, and Δt represents the compensated dyeing time residual.
[0019] The present application also provides an electronic device, which includes a processor and a memory, and the processor is used to implement the method for predicting the anodizing dyeing time when executing a computer program stored in the memory.
[0020] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for predicting the anodizing dyeing time is implemented.
[0021] In the prediction method of anodizing dyeing time provided in the present application, a prior parameter feature matrix is constructed according to the process data before the workpiece enters the dyeing tank in this anodizing dyeing process, and the prior parameter feature matrix constructed with the process data of the previous rod of the current rod is used as the basic value. Based on the prior parameter feature matrix, the dyeing time prediction model is used to predict the dyeing time difference between the current rod and the previous rod, that is, the residual value of the dyeing time. The estimated difference between the current rod and the previous rod is regressed using a preset linear regression equation group and the prior parameter feature matrix, that is, the compensated dyeing time residual. The predicted dyeing time of the workpiece in this anodizing dyeing process is obtained through the residual value of the dyeing time, the compensated dyeing time residual and the previous dyeing time of the previous anodizing dyeing process. It can improve the accuracy of predicting the dyeing time and improve the efficiency of the anodizing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is an application environment architecture diagram of the anodizing dyeing time prediction method provided in the embodiment of the present application.
[0023] Figure 2 It is a flow chart of the method for predicting anodizing dyeing time provided in an embodiment of the present application.
[0024] Figure 3 It is a flow chart of the anodic dyeing process provided in the embodiment of the present application.
[0025] Figure 4 It is a schematic diagram of the process of current and voltage of the anode cell provided in the embodiment of the present application.
[0026] Figure 5 It is a training flow chart of the dyeing time prediction model provided in the embodiment of the present application.
[0027] Figure 6 It is a flow chart for constructing a set of related parameter types provided in an embodiment of the present application.
[0028] Figure 7It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0029] To facilitate understanding, some illustrations of concepts related to the embodiments of the present application are given by way of example for reference.
[0030] It should be noted that in this application, "at least one" means one or more, and "more than one" means two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0031] In order to solve the technical problem of low accuracy in predicting dyeing time in the related art, the present application proposes a method for predicting anodizing dyeing time, an electronic device and a storage medium, which can reduce the error of predicting dyeing time and improve the accuracy of predicting dyeing time by calculating and compensating the residual of dyeing time. The application scenario of the method for predicting anodizing dyeing time of the present application is first described below.
[0032] Figure 1 It is an application environment architecture diagram of the prediction method of anodizing dyeing time provided by the embodiment of the present application. The prediction method of anodizing dyeing time provided by the embodiment of the present application is applied to electronic equipment 10, and the electronic equipment 10 is connected with dyeing equipment 20 by communication. The mode of communication connection includes wired network communication and wireless network communication. Wherein, the wired network can be any one of a local area network, a metropolitan area network and a wide area network, and the wireless network can be any one of Bluetooth (Bluetooth Technology), wireless local area network (Wireless Fidelity, Wi-Fi), near field communication (Near Field Communication, NFC), self-organizing network wireless communication (ZigBee Wireless Networks, ZigBee) technology, infrared data organization (Infrared Data Association, IrDA) technology, ultra-wideband (Ultra Wideband, UWB) technology, wireless universal serial bus (Universal Serial Bus, USB) and the like.
[0033] The electronic device 10 can be a computer device, a mobile phone, a tablet computer, a personal digital assistant (PDA), a cloud server, a physical server, etc. The embodiment of the present application does not impose any restrictions on the specific type of the electronic device.
[0034] The dyeing equipment 20 may be an anodizing production line for performing an anodizing dyeing process. The dyeing equipment 20 may include a plurality of tanks 210 and a data acquisition device 220. The plurality of tanks 210 may include a degreasing tank, an alkali biting tank, a chemical polishing tank, a cleaning tank, an anodizing tank, and a dyeing tank, etc., and the number of each type of tank is not limited. The degreasing tank is used to remove grease and dirt from the metal surface; the alkali biting tank is used to micro-corrode the metal surface through an alkaline solution; the chemical polishing tank is used to make the metal surface smoother through a chemical reaction; the cleaning tank is used to remove residual chemicals and impurities after each processing node to ensure the cleanliness of the metal surface; the anodizing tank is used to form an oxide film on the metal surface through electrolysis; and the dyeing tank is used to change the color of the oxide film and increase its adhesion.
[0035] The data acquisition device 220 may include one or more of a sensor, a data source table, and a data recorder. The data acquisition device 220 is used to collect process data of the plurality of tanks 210 and send the process data to the electronic device 10 .
[0036] The indication Figure 1 The application scenarios are merely examples and do not constitute a limitation of the application scenarios. The application scenarios may also include more or fewer devices, components of the electronic device 10 or components of the dyeing device 20 than shown in the figure, or a combination of certain components or different components. In one example, the electronic device 10 may also include input and output devices, network access devices, etc., and the dyeing device 20 may include an adjustable power supply, etc.
[0037] Figure 2 is a flow chart of a method for predicting anodizing dyeing time provided in an embodiment of the present application, which is applied to electronic devices (such as Figure 1 According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted.
[0038] Step S201, obtaining prior process data and constructing a prior parameter feature matrix; wherein the prior parameter feature matrix includes parameter feature values corresponding to a set of related parameter types in the process data; the set of related parameter types includes a variety of processing parameter types whose correlation with the anodizing dyeing process meets preset conditions.
[0039] In some embodiments of the present application, anodizing dyeing may include multiple anodizing dyeing processes, and the anodizing dyeing process currently to be performed is referred to as this anodizing dyeing process. Figure 3 Describe the process of anodic dyeing. Figure 3 As shown, in some embodiments of the present application, the tanks that the anodic dyeing process mainly passes through may include at least a degreasing tank, an alkali biting tank, a chemical polishing tank, an oxidation tank, and a dyeing tank, and finally the holes are sealed. Among them, the number of each type of tank is not limited. Among them, a gloss measurement position can be set after the chemical polishing tank for random inspection of gloss; a color measurement position is set after the dyeing tank for random inspection of color LAB value, wherein L represents brightness, and A and B represent the red to green range and blue to yellow range of color opposite dimensions, respectively. In order to ensure the physical and chemical quality of the material when passing through these tanks, it must pass through multiple cleaning tanks in the middle. Among them, the P6 cleaning between the anodizing tank and the dyeing tank can remove sulfuric acid, aluminum ions and other impurities that may remain on the surface of the aluminum parts during the anodizing process.
[0040] In some embodiments of the present application, the prior process data may be process data before the workpiece enters the dyeing tank in the current anodizing dyeing process.
[0041] In some embodiments of the present application, taking the processing of the mobile phone middle frame as an example, each process can use a flying rod as a unit (each flying rod can mount 400 workpieces). When the flying rod drives the workpiece to immerse in each tank, the data of the workpiece in each tank can be collected through the data acquisition device to obtain process data. The process data includes but is not limited to: prior low-frequency data, prior high-frequency data, and prior detection data.
[0042] Among them, the process data collected in a single anodizing dyeing process for a number of times not exceeding the set threshold is taken as the prior low-frequency data. For example, the data collected once for one rod is called the prior low-frequency data. The prior low-frequency data include: the concentration, temperature, and residence time detected in the degreasing tank; the tank body number of the alkali biting tank where the workpiece is located, the concentration, temperature, and residence time detected in the alkali biting tank, in addition; the tank body number of the chemical polishing tank where the workpiece is located, the specific gravity, aluminum ion concentration, temperature, and residence time detected in the chemical polishing tank; the tank body number of the anodizing tank where the workpiece is located, the sulfuric acid concentration, oxalic acid concentration, aluminum ion concentration, and residence time detected in the anodizing tank; the concentration, temperature, pH value, conductivity, ultrasonic current, and residence time detected in the P6 cleaning tank; the tank body number of the dyeing tank where the workpiece is located, the dye A concentration, dye B concentration, dye C concentration, temperature, pH value, and residence time detected in the dyeing tank; the conductivity and residence time detected in the general cleaning tank.
[0043] The process data collected more than the set threshold in a single anodizing dyeing process is regarded as the prior high-frequency data. For example, the data detected every 10 seconds is referred to as the prior high-frequency data. The prior high-frequency data includes: Since the workpiece stays in the anode tank for a long time (about 1.5 hours) and there are three steps, it is necessary to collect the temperature, current and voltage in the anodizing tank according to the preset cycle. The temperature, current and voltage detected in the anode tank are regarded as the prior high-frequency data.
[0044] The glossiness obtained at the glossiness measuring position and the color LAB value obtained at the color measuring position are used as the prior detection data. The prior detection data includes: glossiness and color LAB value.
[0045] In some embodiments of the present application, after determining the prior process data of the workpiece before entering the dyeing tank in the anodizing dyeing process, a prior parameter feature matrix can be constructed according to the prior process data, which is recorded as ξ=(ξ1,…,ξ n ), n represents the number of parameter characteristic values. Among them, the prior parameter characteristic matrix includes parameter characteristic values corresponding to the relevant parameter type set in the process data, and the relevant parameter type set includes a plurality of processing parameter types whose correlation with the anodizing dyeing process meets the preset conditions. The preset conditions can be a set number of processing parameter types ranked first from high to low in correlation degree, or a plurality of processing parameter types whose correlation degree exceeds a set correlation threshold value, which can be adjusted and set according to actual needs.
[0046] In order to construct the prior parameter feature matrix, feature processing is performed on the prior low-frequency data, the prior high-frequency data, and the prior detection data to obtain the parameter feature values corresponding to the set of related parameter types in the process data. In the process of processing the prior low-frequency data, since there are multiple tanks for alkali biting, anodizing, and dyeing in the dyeing process, but only one tank will be selected from each type to process the workpiece, the tank number of this type of tank needs to be obtained. For example: there are multiple alkali biting tanks in the dyeing process, and multiple alkali biting tanks dye different workpieces at the same time. Therefore, in order to ensure the accuracy of the acquired process data of the workpiece, it is necessary to obtain the tank number of the alkali biting tank corresponding to the workpiece. Among them, the tank number can be recorded as a numerical feature in the form of one hot coding.
[0047] Because chemical polishing and dyeing may be subjected to a second chemical polishing or a second dyeing due to the sampling results not meeting the specifications, the process data detected in the tank can be taken as a weighted average according to the residence time. For example, the first chemical polishing is 60 seconds, the second back polishing is 20 seconds, the temperature collected in the first chemical polishing is 80.8 degrees, and the temperature collected in the second chemical polishing is 81.4 degrees, then the temperature feature in the chemical polishing tank is T 化 , the residence time is 80 seconds.
[0048]
[0049] Perform feature processing on the prior high-frequency data. For the high-frequency data part, the parameter characteristic values corresponding to the high-frequency data can be obtained by statistically analyzing the average value, standard deviation, maximum value and minimum value of the current, voltage and temperature. The parameter characteristic values corresponding to the prior high-frequency data include: the average value corresponding to the high-frequency data of the workpiece; the standard deviation corresponding to the high-frequency data of the workpiece; the maximum value corresponding to the high-frequency data of the workpiece; the minimum value corresponding to the high-frequency data of the workpiece; the segmented average value corresponding to the high-frequency data of the workpiece; the segmented standard deviation corresponding to the high-frequency data of the workpiece; and the segmented processing time corresponding to the high-frequency data of the workpiece.
[0050] Among them, Figure 4 As shown in the figure, the voltage is divided into three stages: boost, first stage constant voltage, and second stage constant voltage. Then, the process can be segmented according to the process, and the average value, standard deviation, and area under the curve of the high-frequency data in each stage can be statistically analyzed. The area under the curve can be calculated by the gradient method.
[0051] Perform feature processing on the previous test data. Because there may be back-throwing and back-staining, the data of the last test result is used as the parameter feature value of the test data.
[0052] Step S202, based on the prior parameter feature matrix and the dyeing time prediction model, obtain the dyeing time residual value.
[0053] In some embodiments of the present application, the dyeing time prediction model can be a trained xgboost model, and the training process can refer to Figure 5 The embodiment shown.
[0054] The prior parameter feature matrix ξ=(ξ1,…,ξ n ) is input into the dyeing time prediction model to obtain the dyeing time residual value output by the dyeing time prediction model
[0055] Step S203, based on the preset linear regression equation group and the prior parameter characteristic matrix, the compensation dyeing time residual is obtained.
[0056] In some embodiments of the present application, the linear regression equation system is y=a k x+b k , k=1,…,K, the construction of the linear regression equation group can refer to Figure 5 From the prior parameter feature matrix ξ=(ξ1,…,ξ n ) to extract the first k features ξ k , will k Input y = a kx+b k , we get ψ k =a k ξ k +b k ,k=1,…,K,ψ=(ψ1,…,ψ k ). The second calculation formula is used to calculate the compensation dyeing time residual Δt, and the second calculation formula is expressed as follows:
[0057]
[0058] In the formula, ξ k represents the first K features of the previous feature matrix; a k and b k represents the regression coefficient.
[0059] Step S204, based on the dyeing time residual value, the compensated dyeing time residual and the previous dyeing time of the previous anodizing dyeing process, obtain the predicted dyeing time of the workpiece in the current anodizing dyeing process.
[0060] In some embodiments of the present application, the previous dyeing time of the previous anodizing dyeing process is recorded as T0. Compensate for the dyeing time residual Δt and the previous dyeing time of the previous anodizing dyeing process to obtain the predicted dyeing time of the workpiece in this anodizing dyeing process, which is expressed by the following formula:
[0061]
[0062] In the above embodiment, a prior parameter feature matrix is constructed based on the process data before the workpiece enters the dyeing tank in this anodizing dyeing process, and the prior parameter feature matrix constructed with the process data of the previous rod of the current rod is used as the basic value. Based on the prior parameter feature matrix, the dyeing time prediction model is used to predict the dyeing time difference between the current rod and the previous rod, that is, the residual value of the dyeing time. The estimated difference between the current rod and the previous rod is regressed using the preset linear regression equation group and the prior parameter feature matrix, that is, the compensated dyeing time residual. The predicted dyeing time of the workpiece in this anodizing dyeing process is obtained through the residual value of the dyeing time, the compensated dyeing time residual and the previous dyeing time of the previous anodizing dyeing process. It can improve the accuracy of the predicted dyeing time and improve the efficiency of the anodizing process.
[0063] Figure 5 is a training flow chart of the dyeing time prediction model provided in the embodiment of the present application, such as Figure 5 As shown, when executing Figure 2 Before the embodiment shown, that is, before obtaining the process data before the workpiece enters the dyeing tank in this anodizing dyeing process, the dyeing time prediction model can be trained first. Figure 5 As shown, the following steps are included:
[0064] Step S501, acquiring historical process data, constructing a historical parameter feature matrix and a historical dyeing time difference matrix; wherein the historical parameter feature matrix includes parameter feature values corresponding to each dyeing process; and the historical dyeing time difference matrix includes the dyeing time difference between two adjacent dyeing processes.
[0065] In some embodiments of the present application, feature processing is performed on chemical detection data in historical process data to obtain a historical detection parameter feature matrix. The chemical detection data is included in Figure 3 The glossiness detected by the gloss measurement position and the color LAB value detected by the color measurement position are shown. In addition, since the color measurement data is available only after dyeing, the color measurement data of the current rod uses the color measurement data of the previous rod as the eigenvalue of the historical detection parameter feature matrix during the training process.
[0066] Perform feature processing on the high-frequency data in the historical process data to obtain the historical high-frequency parameter feature matrix. Among them, the high-frequency data is the process data collected more than the set threshold in a single anodizing dyeing process. Figure 2 Step S201 in the illustrated embodiment is a process of processing the previous high-frequency data.
[0067] Perform feature processing on the low-frequency data in the historical process data to obtain the historical low-frequency parameter feature matrix. Among them, the low-frequency data is the process data collected in a single anodizing dyeing process and the number of collection times does not exceed the set threshold. Figure 2 In the embodiment shown, step S201 is a process for processing the previous low-frequency data. In addition, since the low-frequency data is collected only after the workpiece is immersed in the tank, the data of the anode dyeing tank of the current rod in the training process uses the data of the previous rod in the anode dyeing tank.
[0068] After determining the historical detection parameter feature matrix, the historical high-frequency parameter feature matrix, and the historical low-frequency parameter feature matrix, the historical parameter feature matrix and the historical dyeing time difference matrix can be constructed according to one or more combinations of the historical detection parameter feature matrix, the historical high-frequency parameter feature matrix, and the historical low-frequency parameter feature matrix. The historical parameter feature matrix includes the parameter feature values corresponding to each dyeing process; the historical dyeing time difference matrix includes the dyeing time difference between two adjacent dyeing processes.
[0069] The historical parameter characteristic matrix is expressed as follows:
[0070]
[0071] Where n represents the number of eigenvalues in the historical parameter feature matrix, and m represents the number of workpieces.
[0072] The total coloring time difference between the current bar and the previous bar, that is, the historical coloring time difference matrix, is expressed by the following formula:
[0073] y=(y1,…,y m ).
[0074] Step S502, according to the correlation between the historical parameter feature matrix and the historical dyeing time difference matrix, multiple types of processing parameter types in the historical parameter feature matrix whose correlation with the historical dyeing time difference matrix meets preset conditions are determined, and a set of related parameter types is constructed.
[0075] In some embodiments of the present application, the following Figure 6 To describe the construction process of a set of related parameter types.
[0076] Figure 6 is a flow chart for constructing a set of related parameter types provided in an embodiment of the present application, such as Figure 6 As shown, the following steps are included:
[0077] Step S5021: Use the historical parameter feature matrix as the iteration parameter feature matrix.
[0078] Step S5022, obtaining the correlation between each type of parameter characteristic value in the iterative parameter characteristic matrix and the historical dyeing time difference matrix, and taking the processing parameter type with the highest correlation as the parameter type for this iteration.
[0079] In some embodiments of the present application, the correlation between each type of parameter feature value in the iterative parameter feature matrix and the historical dyeing time difference matrix is calculated according to a first calculation formula, wherein the first calculation formula may be a Pearson correlation coefficient calculation formula. The first calculation formula is as follows:
[0080]
[0081] Among them, x ij is the j-th parameter characteristic value of the i-th dyeing process in the iterative parameter characteristic matrix; is the mean of the characteristic values of the j-th parameter; y i is the dyeing time difference between the i-th dyeing process and the i-1-th dyeing process in the historical dyeing time difference matrix; is the mean of the dyeing time difference; m is the total number of dyeings; and n is the ordinal number of the parameter characteristic value.
[0082] and The formula is as follows:
[0083]
[0084] After determining the correlation, the processing parameter type with the highest correlation is selected as the parameter type for this iteration. Among them, the most relevant feature is selected, that is, The biggest feature is that the processing parameter type with the highest correlation is the parameter type j1 of this iteration, which is expressed by the following formula:
[0085]
[0086] In addition, the data points for this iteration are obtained based on the selection of the above correlation in, Indicates the parameter characteristic value corresponding to the parameter type of this iteration, for example, represents the parameter eigenvalue corresponding to the parameter type j1 of this iteration corresponding to the nth rod; y1,…, n represents the historical coloring time difference matrix, for example, y n Represents the dyeing time difference matrix between the nth rod and the n-1th rod. Using the data points for linear regression, we get the regression coefficients a1, b1, and the linear regression equation, as follows.
[0087] y=a1x+b1.
[0088] In addition, according to the linear regression equation and the dyeing time y1,…,y m Calculate the dyeing time residual matrix, which is expressed as follows:
[0089]
[0090] Step S5023, remove the parameter characteristic values corresponding to the parameter types of this iteration in the iteration parameter characteristic matrix, and update the iteration parameter characteristic matrix.
[0091] In some embodiments of the present application, the parameter feature values corresponding to the parameter type j1 of this iteration are removed from the iterative parameter feature matrix, and the remaining parameter feature values in the parameter feature matrix are as the new parameter feature matrix.
[0092] According to the same process as step S5023, the remaining parameter characteristic values are The processing parameter type with the highest correlation is selected as the parameter type j2 of this iteration. The linear regression equation and the residual matrix of dyeing time are as follows:
[0093] y=a2x+b2;
[0094]
[0095] Step S5024, determine whether the iteration is completed.
[0096] In some embodiments of the present application, it is set to repeat steps S5022 to S5023 in a loop. Since too low a correlation will cause the residual to become larger, an iterative termination condition is set in the process of repeating steps S5022 to S5023 in a loop. When the termination condition is met, it is determined that the iteration is finished, and the iterative repetition of steps S5022 to S5023 is stopped. When the termination condition is not met, it is determined that the iteration is not finished, and the iterative repetition of steps S5022 to S5023 is continued.
[0097] Among them, if the absolute residual sum corresponding to the K+1th iteration is greater than the absolute residual sum corresponding to the Kth iteration, it is determined that the termination condition is met. If the absolute residual sum corresponding to the K+1th iteration is less than the absolute residual sum corresponding to the Kth iteration, it is determined that the termination condition is not met, which is expressed by the following formula:
[0098]
[0099] In some embodiments of the present application, if it is determined that the iteration is finished, step S5025 is executed. If it is determined that the iteration is not finished, the process returns to step S5022 to repeat steps S5022 to S5023.
[0100] Step S5025, constructing a set of related parameter types according to the parameter types of this iteration obtained in previous iterations.
[0101] In some embodiments of the present application, if the termination condition is determined to be satisfied in the Kth iteration, the parameter type of this iteration is determined based on the previous K iterations, and a related parameter type set is constructed.
[0102] Step S503, performing linear regression iteration according to the parameter characteristic values corresponding to the historical parameter characteristic matrix and the historical dyeing time difference matrix of each parameter type in the relevant parameter type set, to obtain a linear regression equation group and a dyeing time residual matrix corresponding to each dyeing process.
[0103] In some embodiments of the present application, if the termination condition is determined to be satisfied at the Kth iteration, the linear regression equation group and the dyeing time residual matrix corresponding to each dyeing process are expressed by the following formula:
[0104] y=a k x+b k ,k=1,…,k;
[0105]
[0106] in,
[0107] Step S504, using the historical parameter feature matrix and the dyeing time residual matrix as a training set, training the candidate prediction model to obtain a dyeing time prediction model.
[0108] In some embodiments of the present application, the candidate prediction model can be an xgboost model, which is an optimized gradient boosting decision tree algorithm. Before training the candidate prediction model, the initial model parameters of the candidate prediction model are set, and the initial model parameters include: eval_metreic = 'mae', indicating that the mean absolute error is used as the evaluation index for evaluating the candidate preset model; eta = 1, indicating the model learning rate; num_boost_round = 1000 indicating the number of model iterations; max_depth = 5 indicating the depth of the tree; min_child_weight = 1 indicating the sum of child node weights; gamma = 0 indicating the minimum loss required for node splitting; subsample = 0.8 indicating the sampling rate of subtree training samples; colsample_bytree: 0.8 indicating the sampling rate of subtree training features; early_stopping_rounds = 50 indicating that the training is stopped if the cross validation value (CV) does not decrease after 50 iterations.
[0109] The historical parameter feature matrix X and the coloring time residual matrix The training set is cross-validated to obtain multiple training sample sets, each of which includes an intermediate test set and an intermediate training set, and the intermediate test set and the intermediate training set are obtained based on random division of the training set.
[0110] In order to reduce the risk of overfitting, multiple candidate prediction models may be trained, and then one candidate prediction model may be selected from the trained multiple candidate prediction models as the dyeing time prediction model.
[0111] Specifically, multiple candidate prediction models are trained using each training sample set, and when multiple candidate prediction models do not meet the conditions for stopping training, model parameters of the multiple candidate prediction models are readjusted along the back propagation path.
[0112] The order of adjusting model parameters includes: adjusting num_boost_round parameters, and stopping when the error of a certain round increases, indicating that the candidate model is overfitting during the training process, and then stopping training. For max_depth and min_child_weigtht parameters, the parameter grid points are [3,5,7,9]×[1,3,5]. According to the error of each parameter grid point recorded during training, the parameter point with the minimum error is selected for parameter adjustment. For gamma parameter adjustment, the parameter grid points are [0.1,0.2,0.3,0.4]. According to the error of each parameter grid point recorded during training, the parameter point with the minimum error is selected for parameter adjustment. For subsample and colsample_bytree parameters, the parameter grid points are [0.6,0.7,0.8,0.9]×[0.6,0.7,0.8,0.9]. According to the error of each parameter grid point recorded during training, the parameter point with the minimum error is selected for parameter adjustment. The model learning rate eta is adjusted, and the parameter grid points are [0.01, 0.02, 0.03, …, 0.19]. According to the error of each parameter grid point recorded during training, the parameter point with the minimum error is selected for parameter adjustment.
[0113] When multiple candidate prediction models meet the conditions for stopping training, the candidate prediction model with the smallest CV value is used as the trained dyeing time prediction model.
[0114] Different from directly using the xgboost model to predict the dyeing time. The embodiment of the present application adopts the PGA+xgboost composite model to predict the dyeing time. The linearity is first regressed through the PGA algorithm and then the residual is learned by the xgboost model, which can effectively improve the accuracy of the prediction model. Among them, the PGA algorithm is a phase gradient autofocus algorithm (Phase Gradient Autofocus Algorithm), which is used to estimate and correct the phase error in the echo signal.
[0115] The advantages of the PGA+xgboost composite model used in the embodiment of the present application are highlighted by comparing the mean absolute error (MAE), mean percentage error (MAPE), determination coefficient (R2) and other evaluation indicators. As shown in Table 1, xgboost in Table 1 is abbreviated as XGB.
[0116] Table 1
[0117]
[0118] Among them, the smaller the MAE and MAPE, the higher the accuracy of the model, and the larger the R2, the better the fitting effect of the model.
[0119] In the above embodiment, the linear regression is first performed through the PGA algorithm and then the residual is learned by the xgboost model. The combination of the PGA algorithm and the xgboost model ensures the accuracy of the prediction results output by the dyeing time prediction model, and improves the success rate of one-time dyeing to a certain extent.
[0120] Figure 7 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Figure 1 The electronic device 10 shown may include a communication module 701, a memory 702, a processor 703, an input / output (I / O) interface 704 and a bus 705. The processor 703 is coupled to the communication module 701, the memory 702 and the I / O interface 704 through the bus 705.
[0121] The communication module 701 may include a wired communication module and / or a wireless communication module. The wired communication module may provide one or more wired communication solutions such as universal serial bus (USB), controller area network bus (CAN, Controller Area Network). The wireless communication module may provide one or more wireless communication solutions such as wireless fidelity (wireless fidelity, Wi-Fi), bluetooth (bluetooth, BT), mobile communication network, frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR), etc.
[0122] The memory 702 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory may be directly read and written by the processor 703, and may be used to store executable programs (such as machine instructions) of an operating system or other running programs, and may also be used to store user and application data. The random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), etc.
[0123] The non-volatile memory may also store executable programs and user and application data, etc., and may be pre-loaded into the random access memory for direct reading and writing by the processor 110. The non-volatile memory may include a disk storage device and a flash memory.
[0124] The memory 702 is used to store one or more computer programs. The one or more computer programs are configured to be executed by the processor 703. The one or more computer programs include a plurality of instructions, and when the plurality of instructions are executed by the processor 703, the method for predicting the anodizing dyeing time executed on the electronic device 10 can be implemented.
[0125] In other embodiments, the electronic device 10 further includes an external memory interface for connecting to an external memory to expand the storage capacity of the electronic device 10 .
[0126] The processor 703 may include one or more processing units, for example, the processor 703 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0127] The processor 703 provides computing and control capabilities. For example, the processor 703 is used to execute computer programs stored in the memory 702 .
[0128] The I / O interface 704 is used to provide a channel for user input or output. For example, the I / O interface 704 can be used to connect various input and output devices, such as a mouse, keyboard, touch device, display screen, etc., so that the user can enter information or visualize information.
[0129] The bus 705 is at least used to provide a channel for mutual communication among the communication module 701 , the memory 702 , the processor 703 , and the I / O interface 704 in the electronic device 10 .
[0130] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 10. In other embodiments of the present application, the electronic device 10 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0131] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned data extraction method embodiment or each process of the above-mentioned data extraction method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium is, such as a read-only memory (Read-Only Memory, referred to as ROM), a random access memory (Random Access Memory, referred to as RAM), a disk or an optical disk, etc.
[0132] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the server reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the server executes the data extraction method described above in the embodiment of the present application.
[0133] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0134] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0135] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A method for predicting anodizing dyeing time, characterized in that: The method comprises: Acquire prior process data and construct a prior parameter feature matrix; wherein the prior parameter feature matrix includes parameter feature values corresponding to a set of related parameter types in the process data; the set of related parameter types includes a plurality of processing parameter types whose relevance to the anodizing dyeing process meets preset conditions; Based on the prior parameter feature matrix and the dyeing time prediction model, a dyeing time residual value is obtained; Based on the preset linear regression equation group and the prior parameter characteristic matrix, the compensation dyeing time residual is obtained; Based on the dyeing time residual value, the compensated dyeing time residual and the previous dyeing time of the previous anodizing dyeing process, the predicted dyeing time of the workpiece in this anodizing dyeing process is obtained.
2. The method for predicting anodizing dyeing time according to claim 1, characterized in that: The method further comprises: Acquire historical process data, and construct a historical parameter feature matrix and a historical dyeing time difference matrix; wherein the historical parameter feature matrix includes parameter feature values corresponding to each dyeing process; and the historical dyeing time difference matrix includes the dyeing time difference between two adjacent dyeing processes; According to the correlation between the historical parameter feature matrix and the historical dyeing time difference matrix, determining a plurality of types of processing parameters in the historical parameter feature matrix whose correlation with the historical dyeing time difference matrix meets the preset conditions, and constructing the related parameter type set; Perform linear regression iteration according to the parameter characteristic values corresponding to the historical parameter characteristic matrix and the historical dyeing time difference matrix of each parameter type in the relevant parameter type set, and obtain the linear regression equation group and the dyeing time residual matrix corresponding to each dyeing process; The historical parameter feature matrix and the dyeing time residual matrix are used as training sets to train candidate prediction models to obtain the dyeing time prediction model.
3. The method for predicting anodizing dyeing time according to claim 2, characterized in that: The steps of acquiring historical process data and constructing a historical parameter feature matrix and a historical dyeing time difference matrix include: Performing feature processing on chemical detection data in the historical process data to obtain a historical detection parameter feature matrix; Perform feature processing on the high-frequency data and / or low-frequency data in the historical process data to obtain a historical high-frequency parameter feature matrix and / or a historical low-frequency parameter feature matrix; wherein the high-frequency data is process data collected more than a set threshold value in a single anodizing dyeing process; and the low-frequency data is process data collected less than the set threshold value in a single anodizing dyeing process; The historical parameter feature matrix is constructed according to the historical detection parameter feature matrix, the historical high-frequency parameter feature matrix, and / or the historical low-frequency parameter feature matrix.
4. The method for predicting anodizing dyeing time according to claim 2, characterized in that: The step of determining, based on the correlation between the historical parameter feature matrix and the historical dyeing time difference matrix, a plurality of types of processing parameters whose correlation with the historical dyeing time difference matrix in the historical parameter feature matrix meets the preset conditions, and constructing the set of related parameter types comprises: Step 11, using the historical parameter feature matrix as an iterative parameter feature matrix; Step 12, obtaining the correlation between each type of parameter characteristic value in the iterative parameter characteristic matrix and the historical dyeing time difference matrix, and taking the processing parameter type with the highest correlation as the current iterative parameter type; Step 13, removing the parameter characteristic values corresponding to the parameter types of this iteration in the iteration parameter characteristic matrix, and updating the iteration parameter characteristic matrix; Step 14, repeating steps 12 to 13 until the iteration ends, and constructing the related parameter type set according to the parameter types of this iteration obtained in previous iterations.
5. The method for predicting anodizing dyeing time according to claim 4, characterized in that: The step of obtaining the correlation between each type of parameter characteristic value in the iterative parameter characteristic matrix and the historical dyeing time difference matrix includes: Calculate the j-th parameter eigenvalue in the iterative parameter characteristic matrix according to the first calculation formula The correlation with the historical dyeing time difference matrix; wherein the first calculation formula includes: Among them, x ij is the j-th parameter characteristic value of the i-th dyeing process in the iterative parameter characteristic matrix; is the mean of the characteristic values of the j-th parameter; y i is the dyeing time difference between the i-th dyeing process and the i-1-th dyeing process in the historical dyeing time difference matrix; is the mean of the dyeing time difference; m is the total number of dyeing processes; and n is the ordinal number of the parameter characteristic value.
6. The method for predicting anodizing dyeing time according to claim 4, characterized in that: The step 12 further comprises: Constructing a linear regression equation according to the parameter characteristic value corresponding to the parameter type of this iteration and the historical dyeing time difference matrix; The step 14 further comprises: The linear regression equation group is constructed according to the current linear regression equation obtained in previous iterations.
7. The method for predicting anodizing dyeing time according to claim 6, characterized in that: The step of obtaining the compensation dyeing time residual based on the preset linear regression equation group and the prior parameter characteristic matrix includes: The compensation dyeing time residual Δt is calculated according to a second calculation formula; wherein the second calculation formula includes: Among them, ψ k It represents the result of substituting the first K parameter eigenvalues of the prior parameter characteristic matrix into the linear regression equation system; a k and b k represents the regression coefficient; K represents the number of parameter eigenvalues.
8. The method for predicting anodizing dyeing time according to claim 7, characterized in that: The step of obtaining the predicted dyeing time of the workpiece in the current anodizing dyeing process based on the dyeing time residual value, the compensated dyeing time residual and the previous dyeing time of the previous anodizing dyeing process comprises: The predicted dyeing time T of the workpiece is calculated according to a third calculation formula; wherein the third calculation formula includes: Where T0 represents the last staining time, represents the residual value of dyeing time, and Δt represents the compensated dyeing time residual.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory, wherein the processor is used to execute a computer program stored in the memory to implement the method for predicting anodizing dyeing time as claimed in any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and when the at least one instruction is executed by a processor, the method for predicting anodizing dyeing time according to any one of claims 1 to 8 is implemented.