Aluminum alloy casting quality real-time prediction method and system based on internet of things
By combining IoT technology with dual prediction models and difference trend analysis, the quality prediction results of aluminum alloy castings are corrected in real time, solving the problem of insufficient accuracy of single prediction models and achieving efficient quality prediction and control.
Patent Information
- Application Number
- CN202510231478.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-28
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2045-02-28
AI Technical Summary
In the current technology for predicting the quality of aluminum alloy castings, the accuracy of a single prediction model is limited, resulting in low production efficiency and wasted resources.
The production data of aluminum alloy castings is collected in real time using Internet of Things (IoT) technology. Data is processed and corrected through a dual prediction model (first prediction model and second prediction model). The prediction results are corrected by combining the difference trend analysis, and the trend line and floating range are calculated to improve the prediction accuracy.
It significantly improves the accuracy of quality prediction for aluminum alloy castings, ensuring that the prediction results reflect the actual situation and adapt to future changes, and provides strong support for production quality control.
Smart Images

Figure CN120181646B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet of Things, in particular to an aluminum alloy casting quality real-time prediction method and system based on Internet of Things. BACKGROUND
[0002] In the production process of aluminum alloy castings, quality control is crucial. Traditional quality detection methods usually rely on post-inspection, that is, detection after the completion of casting production. This method is not only inefficient, but also causes a large amount of waste and production cost once problems are found. With the development of Internet of Things technology, real-time monitoring of various parameters in the production process becomes possible, which provides a technical basis for real-time prediction of aluminum alloy casting quality.
[0003] A similar prior art is Chinese patent application No. CN116823054A, which discloses an aluminum alloy casting manufacturing quality real-time prediction method based on data mining, comprising: based on the results of mold flow analysis, installing temperature, pressure, contact and multifunctional gas sensors on the casting mold; during aluminum alloy casting manufacturing production, real-time collecting the temperature, pressure, contact time of aluminum liquid and the pressure, composition, humidity and temperature of cavity gas at multiple positions of the mold through the above sensors, thereby constructing a manufacturing process parameter set; inputting the manufacturing process parameter set into a pre-trained manufacturing quality prediction model to predict whether the corresponding aluminum alloy casting quality is qualified; wherein the pre-trained manufacturing quality prediction model is obtained by mining the relationship between aluminum alloy casting manufacturing process historical parameters and aluminum alloy casting quality data.
[0004] A similar prior art is Chinese patent application No. CN116468160A, which discloses an aluminum alloy die casting quality prediction method based on production big data, belonging to the field of automobile die casting quality prediction. It includes: 1) the equipment acquisition unit obtains die casting process production parameter data, the manual detection unit obtains quality index data, and integrates the parameter data and quality index data into an original data set; 2) the data is preprocessed in combination with business, including repeated data, missing values and outliers, and quality prediction key feature selection is performed; (3) different machine learning algorithms are combined together using the stacking integration method to improve the generalization ability and accuracy of the fusion model, and finally the die casting quality is predicted according to the real-time collected production data to obtain specific results.
[0005] However, although the above two inventions both use advanced prediction models to predict the quality of aluminum alloy castings, in actual application, the accuracy of a single prediction model often has certain limitations. SUMMARY
[0006] To solve the above technical problems, the application provides an aluminum alloy casting quality real-time prediction method and system based on the Internet of Things, which is used to improve the accuracy of aluminum alloy casting quality prediction.
[0007] In a first aspect, the application provides an aluminum alloy casting quality real-time prediction method based on the Internet of Things, which comprises:
[0008] Step S1: Through the Internet of Things technology, the first data collected by each type of sensor in the aluminum alloy casting production process is transmitted to the data processing unit in real time;
[0009] Step S2: The first data is preprocessed, and specific attributes reflecting the quality of aluminum alloy castings are extracted from the first data, and the second data in the aluminum alloy casting production process is generated based on the specific attributes;
[0010] Step S3: Based on the historical first data and the historical second data, the first prediction model and the second prediction model are trained, the first data and the second data are input into the first prediction model and the second prediction model respectively, and the first prediction result and the second prediction result are obtained respectively;
[0011] Step S4: Based on the historical second data, the first difference trend and the second difference trend are calculated and based on the first difference trend and the second difference trend, it is judged whether the prediction result needs to be corrected, and when it needs to be corrected, the correction amount of the prediction result is calculated and based on the prediction result, the prediction result is corrected, the prediction result includes the first prediction result and the second prediction result;
[0012] Step S5: Based on the first data, the historical first data, the first prediction result and the second prediction result, the trend line of the first data changing with time is calculated and based on the trend line, the quality of the aluminum alloy casting is predicted.
[0013] In combination with the first aspect, in a first implementation manner of the first aspect of the application, in step S4, the first difference trend is calculated by:
[0014] The data of the first time period is obtained from the historical second data as third data, the third prediction result corresponding to the third data is obtained based on the first prediction model, the fourth prediction result corresponding to the third data is obtained based on the second prediction model, the first prediction average value of the third prediction result and the fourth prediction result is calculated, the first difference between the first prediction average value and the quality of the aluminum alloy casting corresponding to the third data is calculated, and the difference trend of the first difference changing with time is calculated based on the first difference.
[0015] In combination with the first aspect, in a second implementation manner of the first aspect of the application, in step S4, the second difference trend is calculated by:
[0016] acquiring, from the historical second data, data of a second time period as fourth data, a time point at which the second time period ends being the same as a time point at which the first time period ends, a length of the second time period being equal to 1 / M of a length of the first time period, M representing a positive integer greater than or equal to 2 and less than or equal to H / 2, H representing a data amount of the historical second data;
[0017] based on the first prediction model and the second prediction model, acquiring a fifth prediction result and a sixth prediction result corresponding to the fourth data respectively, calculating a second prediction average of the fifth prediction result and the sixth prediction result, calculating a second difference between the second prediction average and an aluminum alloy casting quality corresponding to the fourth data, and based on the second difference, calculating a difference trend of the second difference changing over time.
[0018] With reference to the first aspect, in a third implementation manner of the first aspect of the present application, in the step S4, determining whether the prediction result needs to be corrected based on the first difference trend and the second difference trend comprises:
[0019] acquiring a first correction direction of the prediction result in the first difference trend and a second correction direction of the prediction result in the second difference trend, and if the first correction direction and the second correction direction are in the same direction, determining that the prediction result needs to be corrected, otherwise, determining that the prediction result does not need to be corrected.
[0020] With reference to the first aspect, in a fourth implementation manner of the first aspect of the present application, in the step S4, calculating a correction amount of the prediction result and correcting the prediction result based on the correction amount comprises:
[0021] when the prediction result needs to be corrected, calculating a weighted average of the first difference trend as the correction amount of the prediction result, and correcting the prediction result based on the correction amount.
[0022] With reference to the first aspect, in a fifth implementation manner of the first aspect of the present application, in the step S5, calculating the trend line of the first data changing over time comprises:
[0023] taking time in the historical first data as a first variable and taking any one data item in the historical first data as a second variable, calculating an average of the first variable and an average of the second variable respectively;
[0024] calculating a first distance between the first variable corresponding to each data value in the historical first data and the average of the first variable, and a second distance between the second variable and the average of the second variable;
[0025] The inclination of a trend line of the second variable changing with the first variable and the intersection of the trend line of the first data changing with the first variable with the y-axis are calculated, and based on the intersection of the trend line of the first data changing with the first variable with the y-axis and the inclination of the trend line of the second variable changing with the first variable, a trend line of the first data changing with the first variable is calculated based on Formula 1: y = a + x b, where y represents a prediction result, x represents a corresponding time point, a represents the intersection of the trend line of the first data changing with the first variable with the y-axis, and b represents the inclination of the trend line of the second variable changing with the first variable.
[0026] With reference to the first aspect, in a sixth implementation manner of the first aspect, in the step S5, the upper and lower floating interval of the prediction result is calculated by:
[0027] The upper and lower floating degree of the prediction result is determined based on the data quantity of the historical first data, the data quantity of the historical first data is counted, and the mean value and the standard deviation of the historical first data are calculated;
[0028] The critical value corresponding to the upper and lower floating interval is determined based on the upper and lower floating degree of the prediction result and the data quantity of the historical first data;
[0029] The upper and lower limits of the floating interval are calculated based on Formula 2: The standard error of the mean value of the historical first data is calculated, where c represents the standard error of the mean value of the historical first data, s represents the standard deviation of the historical first data, and n represents the data quantity of the historical first data;
[0030] The upper and lower limits of the floating interval are calculated based on Formula 3: based on the mean value of the historical first data, the standard error and the critical value corresponding to the upper and lower floating interval, where represents the mean value of the historical first data, Z represents the critical value corresponding to the upper and lower floating interval, and β represents the upper and lower floating degree.
[0031] With reference to the first aspect, in a seventh implementation manner of the first aspect, the inclination of the trend line of the second variable changing with the first variable is calculated by:
[0032] The inclination of the trend line of the second variable changing with the first variable is calculated based on Formula 4: where b represents the inclination of the trend line of the second variable changing with the first variable, d1 represents the first distance, d2 represents the second distance, n represents the number of data values corresponding to all the first variables or second variables in the historical first data, and i represents the data value of the i th first variable or second variable in the historical first data.
[0033] With the first aspect, in an eighth implementation form of the first aspect of the present application, the intersection of the trend line of the first data changing with the first variable and the y-axis comprises:
[0034] The intersection of the trend line of the first data changing with the first variable and the y-axis is calculated based on formula 5: a=v2-b*v1, wherein v1 represents the average value of the first variable, and v2 represents the average value of the second variable.
[0035] In a second aspect, the present application provides an aluminum alloy casting quality real-time prediction system based on Internet of Things, which comprises:
[0036] A data acquisition unit is configured to transmit first data collected by each type of sensor in the aluminum alloy casting production process to a data processing unit in real time through Internet of Things technology.
[0037] An attribute extraction unit is configured to pre-process the first data, extract specific attributes reflecting the quality of aluminum alloy castings from the first data, and generate second data in the aluminum alloy casting production process based on the specific attributes.
[0038] A first prediction unit is configured to train a first prediction model and a second prediction model based on historical first data and historical second data, input the first data and the second data obtained in real time into the first prediction model and the second prediction model respectively, and obtain a first prediction result and a second prediction result respectively.
[0039] A correction unit is configured to calculate and judge whether the prediction result needs to be corrected based on the first difference trend and the second difference trend based on the historical second data, and correct the prediction result based on the correction amount of the prediction result when correction is needed, wherein the prediction result comprises the first prediction result and the second prediction result.
[0040] A second prediction unit is configured to calculate and predict the quality of the aluminum alloy casting based on the trend line of the first data changing with time based on the first data, the historical first data, the first prediction result and the second prediction result.
[0041] Compared with the prior art, the present application has at least the following advantages:
[0042] In the technical scheme provided in the application, the first data collected by each type of sensor in the production process of the aluminum alloy casting is transmitted to a data processing unit in real time through Internet of Things technology, thereby providing a basis for real-time prediction of the casting quality; the first data is preprocessed, and specific attributes reflecting the quality of the aluminum alloy casting are extracted from the first data, second data in the production process of the aluminum alloy casting is generated based on the specific attributes, the quality of the input data of the prediction model is improved, and the generation of the specific attributes reduces the risk of overfitting; based on the historical first data and the historical second data, a first prediction model and a second prediction model are trained, the first data and the second data obtained in real time are input into the first prediction model and the second prediction model respectively, and a first prediction result and a second prediction result are obtained respectively. By using double models for prediction, different time granularities can be covered, the prediction accuracy of each time granularity can be improved, and the quality of the casting at different time steps can be predicted, thereby improving the prediction accuracy of the quality of the casting at each time step.
[0043] Based on the historical second data, the first difference trend and the second difference trend are calculated and based on the first difference trend and the second difference trend, it is judged whether the prediction result needs to be corrected. When correction is needed, the prediction result is corrected based on the correction amount of the prediction result, and the prediction result includes the first prediction result and the second prediction result. By combining the two difference trends to correct the prediction value, the accuracy of the prediction can be improved, and the prediction result can better reflect the actual situation and adapt to future changes. Based on the first data, the historical first data, the first prediction result and the second prediction result, a trend line of the first data changing with time is calculated and based on the trend line, the quality of the aluminum alloy casting is predicted. This helps enterprises to understand potential problems in the production process in advance and take corresponding measures to adjust and optimize. Through the cooperation between the above steps, the accuracy of the prediction of the quality of the aluminum alloy casting can be significantly improved, and strong support is provided for the production quality control of the aluminum alloy casting. BRIEF DESCRIPTION OF DRAWINGS
[0044] In order to more clearly illustrate the technical scheme of the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0045] Figure 1 The step flow chart of the real-time prediction method of the aluminum alloy casting quality based on Internet of Things in Embodiment 1 of the application;
[0046] Figure 2 The schematic diagram of the sensor deployment on the aluminum alloy casting production line in Embodiment 1 of the application;
[0047] Figure 3A trend chart of the difference between the predicted average value and the actual quality in Embodiment 1 of the present application;
[0048] Figure 4 A schematic diagram of the aluminum alloy casting quality real-time prediction system based on the Internet of Things in Embodiment 2 of the present application. DETAILED DESCRIPTION
[0049] The embodiments of the present application provide an aluminum alloy casting quality real-time prediction method and system based on the Internet of Things. The terms "first", "second", "third", "fourth" and the like (if any) in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" or "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to only those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0050] Embodiment 1:
[0051] For ease of understanding, the specific process of the embodiments of the present application is described below. Please refer to Figure 1 One embodiment of the aluminum alloy casting quality real-time prediction method based on the Internet of Things in the embodiments of the present application includes:
[0052] A plurality of types of sensors are installed at key positions of the aluminum alloy casting production line, such as Figure 2 As shown in the figure, high-precision thermocouples (temperature sensors) and spectrometers (component analysis sensors) are installed at the furnace area of the aluminum alloy casting production line to monitor the temperature (±1℃ precision) and composition (such as Si, Mg content) of the molten aluminum alloy in real time. Distributed temperature sensors (such as one node every 10 cm) and pressure sensors are arranged in the mold area to collect the mold surface temperature gradient and pouring pressure dynamic changes, and the sampling frequency can be set according to the requirements, such as a sampling frequency of 100 Hz. An infrared thermal imager (optical sensor) is used to monitor the casting surface temperature field in the cooling area, and the cooling water flow and temperature are recorded by a flow meter, which can be recorded every 5 seconds or 10 seconds, and the number and type of installed sensors are not specifically limited. The aluminum alloy casting quality real-time prediction method is realized by performing the following steps.
[0053] Step S1: Through the Internet of Things technology, the first data collected by each type of sensor in the aluminum alloy casting production process is transmitted to the data processing unit in real time.
[0054] Specifically, during data transmission, all sensors transmit time-stamped data to the edge computing node in real time through the industrial Internet of Things gateway using the MQTT protocol, and ensure that the data delay is less than or equal to 50 ms. High-frequency data flow provides a basis for real-time prediction of casting quality, such as timely detection of abnormal fluctuations in furnace temperature (such as ± 20℃ deviation), to prevent alloy overburning or undermelting, etc. Among them, the first data includes time points and the furnace temperature, mold temperature, cooling water temperature, pouring pressure, cooling water pressure, aluminum alloy composition, impurity content and aluminum alloy casting quality corresponding to the time points, and the first data is time series data.
[0055] Step S2: pre-process the first data, and extract specific attributes reflecting the quality of the aluminum alloy casting from the first data, and generate second data in the production process of the aluminum alloy casting based on the specific attributes.
[0056] Specifically, the pre-processing of the first data includes median filtering of temperature data using a sliding window to eliminate transient noise (such as spikes caused by poor thermocouple contact), and Z-score standardization of pressure data to eliminate dimension differences. After denoising the first data, the quality of the model input data can be improved, and the risk of overfitting can be reduced. The specific attributes include average temperature / average pressure, temperature / pressure change rate and temperature / pressure fluctuation range in a predetermined time period. The generation of specific attributes, for the furnace temperature, is to calculate the moving average (reflecting the steady-state trend) and the standard deviation (characterizing the fluctuation range) within 10 minutes, for the pouring pressure, is to extract the pressure change rate (ΔP / Δt) to identify abnormal pouring speed, and for the composition data, is to reduce the dimension through principal component analysis (PCA) to extract the weight ratio of key alloy components (such as Si content) and impurities (such as Fe content).
[0057] Step S3: based on historical first data and historical second data, train a first prediction model and a second prediction model, input the first data and the second data obtained in real time into the first prediction model and the second prediction model respectively, and obtain a first prediction result and a second prediction result respectively.
[0058] Specifically, the first prediction model can employ an LSTM network, input real-time furnace temperature, pouring pressure and other parameters, and predict the surface defect probability (such as porosity, shrinkage) of the current batch of aluminum alloy castings. The output time step can be Δt = 5 minutes. The second prediction model can be based on an XGBoost regression model, input historical composition data (such as the Si / Mg ratio in the past 24 hours) and cooling rate, and predict the mechanical properties (such as tensile strength) of the castings in the next 8 hours. During model training, a dataset containing 100,000 sets of historical production data can be used, and the dataset can be divided into 80% training set and 20% validation set. Cross-validation is used to optimize hyperparameters (such as the number of hidden layer nodes of LSTM and the learning rate of XGBoost). Using the double model for prediction can cover different time granularities, improve the prediction accuracy of each time granularity, and also predict the quality of the castings at different time steps, thereby improving the prediction accuracy of the quality of the castings at each time step. The aluminum alloy casting quality at the first time point output by the first prediction model is the first prediction result, and the aluminum alloy casting quality at the second time point output by the second prediction model is the second prediction result.
[0059] Step S4: Based on the historical second data, calculate and judge whether the prediction result needs to be corrected based on the first difference trend and the second difference trend. If correction is needed, calculate and correct the prediction result based on the correction amount of the prediction result. The prediction result includes the first prediction result and the second prediction result.
[0060] Specifically, after obtaining the first prediction result (i.e., the aluminum alloy casting quality based on the output of the first prediction model) and the second prediction result (the result output by the second prediction model combined with the prediction of a specific attribute), a prediction value correction step is introduced to improve the accuracy of the prediction. First, the first difference trend of the prediction model is calculated using historical data to reflect the overall change of the prediction difference of the model in the past period of time. Then, the second difference trend is calculated based on the current real-time data and historical data to reflect the prediction difference change of the model in the recent period of time. By combining the first difference trend and the second difference trend, it is determined whether the above prediction value needs to be corrected. If the trend directions of the two are consistent (for example, both show that the prediction value is low or high), the prediction value may need to be corrected. If correction is needed, the correction amount is calculated, which can be determined based on the first difference trend, the second difference trend and the preset correction parameter, which will be described in detail below. After calculating the correction amount, the first prediction result and the second prediction result are corrected to obtain the corrected prediction value. Combining the two difference trends to correct the prediction value is to consider the performance of the model at different time scales, improve the accuracy and reliability of the prediction, and ensure that the prediction result can better reflect the actual situation and adapt to future changes.
[0061] Step S5: based on the first data, the historical first data, the first prediction result and the second prediction result, calculating and predicting the quality of the aluminum alloy casting based on the trend line of the first data changing over time.
[0062] Specifically, based on the corrected prediction value of the time series, a regression line is calculated to reflect the trend of the prediction value changing over time and other variables. Using the regression line and the corrected prediction value, the future trend of the quality of the aluminum alloy casting is predicted, which helps the enterprise to understand potential problems in the production process in advance and take corresponding measures to adjust and optimize. According to the trend line of the first data (which may be historical data of various parameters or indicators related to the production of aluminum alloy castings) changing over time, the prediction result is evaluated. The trend line can reflect the overall trend of the data changing over time and other variables, but it cannot completely determine the specific value in the future because there will always be some random fluctuations or unconsidered factors. In order to quantify this uncertainty, an upper and lower floating interval can be calculated, which can be determined based on the slope and intercept of the trend line and the volatility of the data (such as standard deviation). A confidence level (such as 95%) is usually selected, and then the interval in which the prediction value may fall under this confidence level is calculated, which is the upper and lower floating interval of the prediction result. The upper and lower floating interval gives a reasonable range of the prediction value. Next, the quality of the aluminum alloy casting is predicted using the trend line of the first data changing over time and the preset threshold. The quality of the aluminum alloy casting includes multiple aspects, such as appearance quality, dimensional accuracy, mechanical properties, casting shrinkage and alloy composition, etc. During the prediction process, if the prediction value of a certain aspect exceeds the preset threshold, it is considered that the quality of that aspect may have a problem, and corresponding preventive measures or adjustment of production parameters are taken to ensure the quality. This scheme provides strong support for the production of aluminum alloy castings by calculating the upper and lower floating interval of the prediction result and predicting the quality of the aluminum alloy casting based on the trend line and the preset threshold.
[0063] In the embodiments of the present application, through the cooperation between the above steps, the accuracy of the prediction of the quality of the aluminum alloy casting can be significantly improved, providing strong support for the production quality control of the aluminum alloy casting.
[0064] Further, in step S4, calculating the first difference trend includes:
[0065] Obtaining the data of the first time period from the historical second data as third data, obtaining the third prediction result corresponding to the third data based on the first prediction model, obtaining the fourth prediction result corresponding to the third data based on the second prediction model, calculating the first prediction average of the third prediction result and the fourth prediction result, calculating the first difference between the first prediction average and the quality of the aluminum alloy casting corresponding to the third data, and calculating the difference trend of the first difference changing over time based on the first difference.
[0066] Specifically, by combining the results of the first prediction model and the second prediction model, the first prediction average value related to the aluminum alloy casting quality is calculated, and the difference between the actual quality is calculated, as shown in Figure 3 Based on the change trend of the difference value over time, more accurate error analysis and trend prediction are provided for the quality prediction of the aluminum alloy casting, and the errors generated by the prediction model in different time periods are obtained.
[0067] Further, in step S4, the calculation of the second difference trend includes:
[0068] The data of the second time period is obtained from the historical second data as the fourth data, the time point at which the second time period ends is the same as the time point at which the first time period ends, the length of the second time period is equal to 1 / M of the length of the first time period, M represents a positive integer greater than or equal to 2 and less than or equal to H / 2, H represents the data amount of the historical second data, and the value range is 1000 to 100 million;
[0069] Based on the first prediction model and the second prediction model, the fifth prediction result and the sixth prediction result corresponding to the fourth data are obtained respectively, the second prediction average value of the fifth prediction result and the sixth prediction result is calculated, the second difference between the second prediction average value and the aluminum alloy casting quality corresponding to the fourth data is calculated, and the difference trend of the second difference over time is calculated based on the second difference.
[0070] Specifically, first, data of a specific second time period is selected from the historical second data as the fourth data, and the selection of the second time period is conditional: the time point at which it ends is the same as the time point at which the first time period ends, and its length is equal to 1 / M of the length of the first time period, where M is a positive integer greater than or equal to 2 and less than or equal to H / 2, and H represents the total amount of data of the historical second data. Ensuring that the second time period is aligned with the first time period in time, while the length of the second time period is controllable and relatively short, helps to observe and analyze the changing trend of the data over time in more detail. Next, based on the first prediction model and the second prediction model that have been trained, the fifth prediction result and the sixth prediction result corresponding to the fourth data are obtained respectively, and the two prediction models can capture the characteristics and laws of the data from different angles and levels, thereby improving the accuracy and reliability of the prediction. Then, the second prediction average of the fifth prediction result and the sixth prediction result is calculated, and the average value can be regarded as a comprehensive embodiment of the prediction results of the two models for the fourth data. Next, the second difference between the second prediction average and the actual aluminum alloy casting quality corresponding to the fourth data is calculated, and the difference reflects the difference or error between the prediction result and the actual quality. Finally, based on the second difference, the trend of the difference over time is calculated. Through trend analysis, the changing law of the prediction error over time can be revealed, thereby providing a basis for correcting the prediction result. By comparing the prediction results in different time periods with the actual quality, a more accurate basis for correcting the error can be provided.
[0071] Further, in step S4, it is judged whether the prediction result needs to be corrected based on the first difference trend and the second difference trend, including:
[0072] The first correction direction of the prediction result in the first difference trend and the second correction direction of the prediction result in the second difference trend are obtained. If the directions of the first correction direction and the second correction direction are the same, it is determined that the prediction result needs to be corrected, otherwise the prediction result does not need to be corrected.
[0073] Specifically, first, the prediction results corresponding to two time points and their respective correction directions in the first difference trend and the second difference trend are determined. The first time point can be understood as a time point closer to the current time when the current prediction is made, and the prediction result corresponding to the first time point is obtained by the first prediction model. The second time point can be understood as a time point farther away from the current time when the current prediction is made, and the prediction result corresponding to the second time point is obtained by the second prediction model. Then, the performance of the prediction result in the first difference trend is observed. The first difference trend reflects the change trend of the difference between the prediction result and the actual quality in a longer time period (i.e., the first time period). If the prediction result shows a direction that needs to be adjusted (such as continuously being too high or too low) in the first difference trend, the direction is recorded as the first correction direction. Then, the performance of the prediction result in the second difference trend is also observed. The second difference trend is calculated based on data in a shorter time period (i.e., the second time period), which provides a more detailed view of the change of the prediction error over time. If the prediction result also shows the same adjustment requirement as the first correction direction in the second difference trend, it further strengthens the signal that the prediction result may need to be corrected. Finally, the first correction direction and the second correction direction are compared. If the two directions are the same, it means that the prediction result shows a consistent error trend in both the longer time period and the shorter time period. Therefore, it is determined that the prediction result needs to be corrected. On the contrary, if the two correction directions are different, or one of the directions does not have a clear adjustment requirement, it is considered that the current prediction result does not need to be corrected immediately. By combining the difference trend analysis in different time periods, the correction amount of the prediction result that needs to be corrected can be calculated more accurately.
[0074] Further, in step S4, the correction amount of the prediction result is calculated, and the prediction result is corrected based on the correction amount, including:
[0075] When the prediction result needs to be corrected, the weighted average value of the first difference trend is calculated as the correction amount of the prediction result, and the prediction result is corrected based on the correction amount.
[0076] Specifically, when the prediction result is determined to require correction, a weighted average of the first difference trend is first calculated, which involves weighting the differences between the prediction results and the actual quality over a first time period, such as the past few hours or days. The purpose of weighting is to give higher weight to data closer to the current time point, as these data better reflect the current production state and trend. After the weighted average is calculated, this value is determined as the correction amount for the prediction result. Next, the prediction result is corrected based on this correction amount. The correction process can involve simple mathematical operations, such as adding the correction amount to the original prediction result, or adjustments according to specific correction algorithms. The corrected prediction result is closer to the actual quality, thereby improving the accuracy and reliability of the prediction. Taking aluminum alloy die casting production as an example, suppose the prediction result at a certain time point is that the casting quality is qualified, but according to the analysis of the first difference trend, it is found that the prediction results have been generally high (i.e., the predicted quality is better than the actual quality) in the past period of time. At this time, by calculating the weighted average of the first difference trend, a negative correction amount is obtained, indicating that the prediction result needs to be adjusted downward. After applying the correction amount to the original prediction result, the corrected prediction result may be closer to the actual quality condition, thereby avoiding potential quality problems caused by overly optimistic prediction. By providing a mechanism for dynamically adjusting the prediction result, real-time monitoring and analysis of the difference trend between the prediction result and the actual quality, the present application can timely discover prediction errors and take corresponding correction measures. Not only does it improve the accuracy and reliability of the prediction, but it also provides a more refined quality control means for the production process of aluminum alloy castings.
[0077] Further, in step S5, the trend line of the first data changing over time comprises:
[0078] Taking the time in the historical first data as a first variable and any one data item in the historical first data as a second variable, the average value of the first variable and the average value of the second variable are calculated respectively;
[0079] The first distance between each data value in the historical first data and the average value of the first variable, and the second distance between the second variable and the average value of the second variable are calculated;
[0080] The slope of the trend line of the second variable changing with the first variable and the intersection of the trend line of the first data changing with the first variable and the y-axis are calculated, and based on the intersection of the trend line of the first data changing with the first variable and the y-axis and the slope of the trend line of the second variable changing with the first variable, the trend line of the first data changing with the first variable is calculated based on formula 1: y = a + x b, wherein y represents the prediction result, x represents the corresponding time point, a represents the intersection of the trend line of the first data changing with the first variable and the y-axis, and b represents the slope of the trend line of the second variable changing with the first variable.
[0081] Specifically, the calculating the slope of the trend line of the second variable changing with the first variable comprises:
[0082] Based on formula 4: The slope of the trend line of the second variable changing with the first variable is calculated, wherein b represents the slope of the trend line of the second variable changing with the first variable, d1 represents the first distance, d2 represents the second distance, n represents the number of data values corresponding to all the first variables or the second variables in the historical first data, and i represents the data value of the i-th first variable or the second variable in the historical first data.
[0083] The intersection of the trend line of the first data changing with the first variable and the y-axis comprises:
[0084] Based on formula 5: a = v2-b*v1, the intersection of the trend line of the first data changing with the first variable and the y-axis is calculated, wherein v1 represents the average value of the first variable, and v2 represents the average value of the second variable.
[0085] Further, in step S5, the calculating the upper and lower floating interval of the prediction result comprises:
[0086] Based on the data amount of the historical first data, the upper and lower floating degree of the prediction result is determined, the data amount of the historical first data is counted, and the average value and the standard deviation of the historical first data are calculated;
[0087] Based on the upper and lower floating degree of the prediction result and the data amount of the historical first data, the critical value corresponding to the upper and lower floating interval is determined;
[0088] Based on formula 2: The standard error of the average value of the historical first data is calculated, wherein c represents the standard error of the average value of the historical first data, s represents the standard deviation of the historical first data, and n represents the data amount of the historical first data;
[0089] Based on the average value, the standard error and the critical value corresponding to the upper and lower floating interval of the historical first data, based on formula 3: The upper and lower limits of the floating interval are calculated, wherein represents the average value of the historical first data, Z represents the critical value corresponding to the upper and lower floating interval, and β represents the upper and lower floating degree.
[0090] Embodiment 2:
[0091] The above describes the method for predicting the quality of the aluminum alloy casting in real time based on the Internet of Things in the embodiments of the present application, and the following describes the system for predicting the quality of the aluminum alloy casting in real time based on the Internet of Things in the embodiments of the present application, please refer to Figure 4 One embodiment of the system for predicting the quality of the aluminum alloy casting in real time based on the Internet of Things in the embodiments of the present application comprises:
[0092] a data collection unit configured to transmit first data collected by each type of sensor in the production process of the aluminum alloy castings to the data processing unit in real time through Internet of Things technology;
[0093] an attribute extraction unit configured to preprocess the first data and extract specific attributes reflecting the quality of the aluminum alloy castings from the first data, and generate second data in the production process of the aluminum alloy castings based on the specific attributes;
[0094] a first prediction unit configured to train a first prediction model and a second prediction model based on historical first data and historical second data, input the first data and the second data obtained in real time into the first prediction model and the second prediction model respectively, and obtain a first prediction result and a second prediction result respectively;
[0095] a correction unit configured to calculate, based on the historical second data, whether the prediction result needs to be corrected based on the first difference trend and the second difference trend, and when correction is needed, calculate and correct the prediction result based on the correction amount of the prediction result, the prediction result including the first prediction result and the second prediction result;
[0096] a second prediction unit configured to calculate, based on the first data, the historical first data, the first prediction result and the second prediction result, and predict the quality of the aluminum alloy castings based on a trend line of the first data changing over time.
[0097] Through the synergistic cooperation of the above-mentioned various components, the accuracy of the prediction of the quality of the aluminum alloy castings is significantly improved, and strong support is provided for the production quality control of the aluminum alloy castings.
[0098] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, system and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
[0099] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application or the entire or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0100] The above description and the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for real-time quality prediction of aluminum alloy castings based on the Internet of Things, characterized in that, The method includes: Step S1: Using IoT technology, the first data collected by each type of sensor during the aluminum alloy casting production process is transmitted to the data processing unit in real time. Step S2: Preprocess the first data and extract specific attributes that reflect the quality of the aluminum alloy casting from the first data, and generate second data in the aluminum alloy casting production process based on the specific attributes; Step S3: Based on historical first data and historical second data, train a first prediction model and a second prediction model, and input the real-time acquired first data and second data into the first prediction model and the second prediction model respectively to obtain the first prediction result and the second prediction result respectively; The first prediction model outputs the aluminum alloy casting mass at the first time point as the first prediction result, and the second prediction model outputs the aluminum alloy casting mass at the second time point as the second prediction result. The first time point is the time point closer to the current time when the current prediction is made, and the corresponding prediction result is obtained through the first prediction model. The second time point is the time point farther away from the current time when the current prediction is made, and the corresponding prediction result is obtained through the second prediction model. Step S4: Based on the historical second data, calculate and determine whether the prediction result needs to be corrected based on the first difference trend and the second difference trend. If correction is required, calculate and correct the prediction result based on the correction amount of the prediction result. The prediction result includes the first prediction result and the second prediction result. The calculation of the first difference trend includes: obtaining data for a first time period from the historical second data as third data; obtaining a third prediction result corresponding to the third data based on the first prediction model; obtaining a fourth prediction result corresponding to the third data based on the second prediction model; calculating a first prediction average between the third prediction result and the fourth prediction result; calculating a first difference between the first prediction average and the quality of the aluminum alloy casting corresponding to the third data; and calculating the difference trend of the first difference over time based on the first difference. The calculation of the second difference trend includes: obtaining data from the second time period from the historical second data as the fourth data, wherein the end time of the second time period is the same as the end time of the first time period, the length of the second time period is equal to 1 / M of the length of the first time period, where M represents a positive integer greater than or equal to 2 and less than or equal to H / 2, and H represents the amount of data in the historical second data; based on the first prediction model and the second prediction model, obtaining the fifth prediction result and the sixth prediction result corresponding to the fourth data respectively, calculating the second prediction average of the fifth prediction result and the sixth prediction result, calculating the second difference between the second prediction average and the quality of the aluminum alloy casting corresponding to the fourth data, and calculating the difference trend of the second difference over time based on the second difference; Determining whether the prediction result needs correction based on the first difference trend and the second difference trend includes: obtaining the first correction direction of the prediction result in the first difference trend and the second correction direction in the second difference trend respectively; if the first correction direction and the second correction direction are the same, then the prediction result needs correction; otherwise, the prediction result does not need correction. Step S5: Based on the first data, the historical first data, the first prediction result, and the second prediction result, calculate and predict the quality of the aluminum alloy casting based on the trend line of the first data changing over time.
2. The method according to claim 1, characterized in that, In step S4, calculating the correction amount of the prediction result and correcting the prediction result based on the correction amount includes: When the prediction result needs to be corrected, the weighted average of the first difference trend is calculated and used as the correction amount for the prediction result, and the prediction result is corrected based on the correction amount.
3. The method according to claim 1, characterized in that, In step S5, calculating the trend line of the first data changing over time includes: Using the time in the first historical data as the first variable and any data item in the first historical data as the second variable, calculate the average value of the first variable and the average value of the second variable respectively. Calculate the first distance between the first variable and the average value of the first variable corresponding to each data value in the historical first data, and the second distance between the second variable and the average value of the second variable; Calculate the slope of the trend line of the second variable changing with the first variable and the intersection of the trend line of the first data changing with the first variable with the y-axis. Based on the intersection of the trend line of the first data changing with the first variable with the y-axis and the slope of the trend line of the second variable changing with the first variable, and based on Formula 1: Calculate the trend line of the first data as a function of the first variable, where y represents the prediction result and x represents the corresponding time point. The intersection of the trend line showing the change of the first data with the first variable and the y-axis. This indicates the slope of the trend line as the second variable changes with the first variable.
4. The method according to claim 1, characterized in that, In step S5, the calculation of the upper and lower fluctuation range of the prediction result includes: Based on the amount of historical first data, determine the degree of fluctuation of the prediction result, count the amount of historical first data, and calculate the average and standard deviation of the historical first data; Based on the degree of fluctuation of the prediction results and the amount of historical first data, the critical value corresponding to the fluctuation range is determined. Based on Formula 2: Calculate the standard error of the average value of the historical first data, where c represents the standard error of the average value of the historical first data, s represents the standard deviation of the historical first data, and n represents the data volume of the historical first data; Based on the average value of the historical first data, the standard error, and the critical values corresponding to the upper and lower fluctuation ranges, based on Formula 3: Calculate the upper and lower limits of the floating range, where, Z represents the average value of the first historical data, and Z represents the critical value corresponding to the upper and lower fluctuation range. Indicates the degree of fluctuation.
5. The method according to claim 3, characterized in that, Calculating the slope of the trend line as the second variable changes with the first variable includes: Based on Formula 4: Calculate the slope of the trend line of the second variable as it changes with the first variable, where b represents the slope of the trend line of the second variable as it changes with the first variable, d1 represents the first distance, d2 represents the second distance, n represents the number of data values corresponding to all the first or second variables in the historical first data, and i represents the data value of the i-th first or second variable in the historical first data.
6. The method according to claim 3, characterized in that, The calculation of the intersection of the trend line of the first data changing with the first variable and the y-axis includes: Based on Formula 5: Calculate the intersection of the trend line of the first data changing with the first variable and the y-axis, where v1 represents the average value of the first variable and v2 represents the average value of the second variable.
7. A real-time quality prediction system for aluminum alloy castings based on the Internet of Things, used to implement the method as described in any one of claims 1-6, characterized in that, The system includes the following modules: The data acquisition unit is used to transmit the first data collected by each type of sensor during the aluminum alloy casting production process to the data processing unit in real time through Internet of Things (IoT) technology. An attribute extraction unit is used to preprocess the first data and extract specific attributes that can reflect the quality of aluminum alloy castings from the first data, and generate second data of the aluminum alloy casting production process based on the specific attributes. The first prediction unit is used to train a first prediction model and a second prediction model based on historical first data and historical second data, and to input the real-time acquired first data and second data into the first prediction model and the second prediction model respectively, and to obtain the first prediction result and the second prediction result respectively. The correction unit is used to calculate and determine whether the prediction result needs to be corrected based on the historical second data, the first difference trend and the second difference trend, and when correction is required, to calculate and correct the prediction result based on the correction amount of the prediction result. The prediction result includes the first prediction result and the second prediction result. The second prediction unit is used to calculate and predict the quality of the aluminum alloy casting based on the first data, the historical first data, the first prediction result and the second prediction result, using the trend line of the first data changing over time.
Citation Information
Patent Citations
Aluminum alloy die casting quality prediction method based on production big data
CN116468160A
Aluminum alloy casting manufacturing quality real-time prediction method based on data mining
CN116823054A
Power load prediction method for realizing error correction mechanism based on LSTM-XGBoost
CN116739118A
Continuous casting slab longitudinal crack prediction method based on gradient lifting tree
CN118211143A