Disclosure of Invention
The invention aims to overcome the defects in the prior art and provides a production consumption balance measuring and calculating method based on case matching.
The purpose of the invention is realized by the following technical scheme:
a production and consumption balance measuring and calculating method based on case matching comprises the following steps:
acquiring a load expected value of a production plan and current working condition data of a production device to be adjusted;
acquiring the optimal historical working condition data of the corresponding production device to be adjusted in the database according to the load expected value and the current working condition data, and performing load data replacement on the optimal historical working condition data of the production device to be adjusted according to the load expected value to generate first optimal historical working condition data; inputting the first optimal historical working condition data into a yield consumption data model after dimension reduction to obtain working condition adjustment data;
thirdly, adjusting the working condition of the production device to be adjusted according to the working condition adjustment data, and acquiring a system output consumption change value according to the working condition adjustment data and the current working condition data of the production device to be adjusted;
selecting a production device to be compensated, acquiring current working condition data of the production device to be compensated, and acquiring a yield expected value according to the system yield variation value and the current working condition data of the production device to be compensated;
step five, acquiring the optimal historical working condition data of the corresponding to-be-compensated production device in the database according to the expected value of the production consumption and the current working condition data, and performing production consumption data replacement on the optimal historical working condition data of the to-be-compensated production device according to the expected value of the production consumption to generate second optimal historical working condition data;
and step six, inputting the second optimal historical working condition data after dimensionality reduction into a load data model to obtain working condition adjustment data, and adjusting the working condition of the production device to be compensated according to the working condition adjustment data.
The database is built through a large amount of historical data, historical cases can be searched through case matching, data of the selected historical cases are used as basis data for measurement and calculation, and the fact that measurement and calculation results are in line with reality to the maximum extent is guaranteed. The production device to be compensated is selected after the load adjustment, and the working condition data of the production device to be compensated in the current state is measured and calculated, so that the working condition data of the selected production device to be compensated is ensured to be consistent with the actual condition, and better scheduling is performed. And if the single device can not meet the compensation amount of the production consumption, the compensation is carried out by selecting another production device until the production consumption balance of the system is reached. When the working condition of the production device to be compensated is adjusted, the historical case with the highest matching degree is obtained through case matching and calculated, and the fact that adjustment in each time is consistent with the actual situation is guaranteed.
Further, the specific establishment process of the yield and consumption data model is as follows: the method comprises the steps that historical working condition data of a plurality of groups of production devices to be adjusted are collected in a historical data set, a dimension reduction data set is constructed by carrying out characteristic attribute extraction and dimension reduction on the historical working condition data, and a production consumption data model is established according to the historical production consumption data and the dimension reduction data set in the historical working condition data.
Further, the specific establishment process of the load data model is as follows: the method comprises the steps of collecting historical working condition data of a plurality of groups of production devices to be compensated from a historical working condition data set, carrying out characteristic attribute extraction and dimension reduction processing on the historical working condition data to construct a dimension reduction data set, and establishing a load data model according to historical load data and the dimension reduction data set in the historical working condition data.
The data model is established by means of historical data, and therefore the fact that the adjusted working condition data can be obtained through the data model better is guaranteed.
Further, the specific establishment process of the historical data set is as follows: acquiring working condition data of all production devices in a production system in a production and consumption balance state before load adjustment in real time, wherein the working condition data comprises production and consumption data, load data and other data related to production and consumption, and establishing a database according to the working condition data; historical working condition data of all production devices in the production system are collected from a database, the historical working condition data are subjected to data cleaning, and a historical data set is constructed according to the historical working condition data after the data cleaning.
The historical data set established after data cleaning ensures that all data in the set are relevant data, and reduces the influence of the irrelevant data on subsequent calculation.
Further, the specific process of feature attribute extraction and dimension reduction processing is as follows: performing correlation analysis on the collected historical working condition data to obtain characteristic attributes of the working condition data of the production device, extracting the characteristic attributes of the collected historical working condition data, wherein the characteristic attributes are attributes with a correlation coefficient with the yield in the correlation analysis larger than 0.3, obtaining the characteristic attribute data of the historical working condition data, and constructing a characteristic attribute data set according to the obtained characteristic attribute data of the historical working condition data; performing principal component analysis on the characteristic attribute data set, calculating variance contribution rates of all component axes in the principal component analysis to the characteristic attribute data set, sequencing the calculated variance contribution rates from large to small, and performing summation calculation one by one according to a descending order until the sum of the variance contribution rates is greater than 95%; and taking the component axis corresponding to the summed variance contribution rate as a principal component axis, acquiring principal component data of the characteristic attribute data set according to the principal component axis, and constructing a dimension reduction data set through the principal component data.
And extracting the characteristic attributes through correlation analysis, extracting variables with high correlation, ensuring that the characteristic attributes in the characteristic attribute data set are all related to the yield, and eliminating the interference of useless data. Dimension reduction processing is carried out through principal component analysis, so that the dimension and complexity of the model are effectively reduced, dimension disaster is avoided, and the accuracy of data-driven modeling is improved.
Further, the corresponding optimal historical working condition data in the database is obtained through a case matching method, and the case matching method specifically comprises the following steps: extracting a data subset in the range of 95-105% of the expected value of an adjustment variable in a dimension reduction data set of the production device, calculating the Euclidean distance between each group of working condition data in the data subset and the dimension reduced variable replacement working condition data according to an Euclidean distance formula, sorting the Euclidean distances obtained by calculation from small to large, selecting a group of working condition data with the minimum Euclidean distance as historical working condition data with the highest matching degree, and using the historical working condition data with the highest matching degree as optimal historical working condition data; in the second step, the expected value of the adjusting variable in case matching is a load expected value; and fifthly, the expected value of the adjusting variable in case matching is the expected value of the yield consumption.
The specific situation of the working condition data under the condition of the expected load value is obtained through case matching, and the data obtained through case matching are all data processed by historical data and are in accordance with the actual situation, so that the data obtained through measurement and calculation can be guaranteed to be in accordance with the actual situation to the maximum extent only by performing data modeling measurement and calculation according to the data obtained through case matching.
Further, a specific calculation formula of the euclidean distance is as follows:
wherein: d a The Euclidean distance of the working condition data after dimension reduction and the a-th group of working condition data in the data subset is obtained; m is the number of working condition data groups in the data subset; j is the number of variables in each group of working condition data in the data subset; l. the b The variance contribution rate corresponding to the b-th principal component; x is the number of ab The b variable in the a group of working condition data in the data subset is obtained; x is a radical of a fluorine atom b The variable is the b-th variable of the working condition data after dimension reduction.
The variance contribution rate is introduced into the calculation of the Euclidean distance, the proportion of the principal component with larger contribution rate in the distance calculation is higher, and the principal component with large contribution rate can be preferentially considered when case matching is carried out.
Further, when the expected value of the production consumption is obtained, a production consumption compensation amount judgment sub-step is also executed: acquiring a yield threshold of a production device to be compensated and current working condition data of the production device, wherein the current working condition data of the production device comprises first yield data, first load data and other first data related to yield, acquiring the yield compensation threshold of the production device according to the yield threshold and the first yield, judging whether a yield change value is in the yield compensation threshold of the production device, if so, setting a yield expected value as the sum of the first yield and the yield change value, and if not, setting the yield expected value as the yield threshold; and calculating the yield variation value of the production device to be compensated according to the yield expectation value.
And setting a yield expected value according to actual conditions, and performing yield compensation on the premise that the yield expected value does not exceed a yield threshold of the production device, so as to ensure that the measuring and calculating working conditions are within a reasonable range of the operation of the production device.
Further, in the sixth step, after the working condition of the production device to be compensated is adjusted according to the working condition adjustment data, calculating an updated variation value of the yield, wherein the updated variation value of the yield is the difference between the current variation value of the yield of the system and the variation value of the yield of the production device to be compensated, and if the updated variation value of the yield is zero, the system achieves the balance of the yield and the consumption; and if the yield consumption updating change value is not zero, returning to the step four, and taking the yield consumption updating change value as the system yield consumption change value for subsequent calculation.
Because a single production device can not always meet the requirement of the compensation of the yield and consumption, the yield and consumption change value of the system needs to be updated after the adjustment, and whether the compensation is needed or not is judged according to the updated yield and consumption change value so as to better achieve the balance of the yield and consumption.
Furthermore, the data cleaning objects are historical data with missing attributes in the historical working condition data, historical data outside a change threshold interval and data with abnormity and noise.
Some blank data and abnormal data are screened and cleaned, the blank data and the abnormal data are useless data, after the useless data are eliminated, the subsequent calculation amount is reduced, and calculation errors cannot be caused.
The beneficial effects of the invention are:
after the load value of the production device to be adjusted is specified, the load value of the production device is not only adjusted. Because other variables of the production device can be influenced after the load is adjusted, in order to enable the working condition of the adjusted production device to be in line with the actual condition, the change of the production consumption of the production device after the load is changed needs to be measured and calculated, the change of other variables after the load is changed needs to be predicted, and the adjustment is carried out according to the predicted working condition so as to meet the adjustment purpose and meet the actual condition. The same is true when the yield is adjusted, and the changes of other variables need to be predicted through the changes of the yield, and the adjustment is performed according to the predicted working conditions so as to meet the actual conditions. When data measurement and calculation are carried out, the traditional measurement and calculation modeling method is improved, the dimension and the complexity of a model are reduced through correlation analysis and principal component analysis technologies, dimension disasters are avoided, the accuracy of data-driven modeling is improved, the most similar historical cases are searched through case matching to be used as basic data for measurement and calculation, the measurement and calculation result is guaranteed to be in line with the historical working condition to the maximum extent, and accurate compensation of the yield change value by other equipment can be guaranteed. And carrying out case matching on each production device for compensation so as to ensure that each adjustment can meet the requirement and simultaneously meet the actual requirement.
Detailed Description
The invention is further described below with reference to the figures and examples.
Example (b):
a method for calculating balance of production and consumption based on case matching, as shown in fig. 1, includes the following steps:
step one, acquiring a load expected value of a production plan and current working condition data of a production device to be adjusted.
Step two, obtaining the optimal historical working condition data of the corresponding production device to be adjusted in the database according to the load expected value and the current working condition data, replacing the load data in the optimal historical working condition data with the load expected value after obtaining the optimal historical working condition data of the production device to be adjusted to obtain first optimal historical working condition data, inputting the first optimal historical working condition data into a production consumption data model after reducing the dimension of the first optimal historical working condition data to obtain working condition adjustment data, and specifically:
extracting a data subset in the range of 95-105% of a load expected value in a dimension reduction data set of the production device, calculating Euclidean distances between each group of working condition data in the data subset and the variable replacement working condition data after dimension reduction according to an Euclidean distance formula, sorting the Euclidean distances obtained by calculation from small to large, selecting a group of working condition data with the minimum Euclidean distance as historical working condition data with the highest matching degree, and using the historical working condition data with the highest matching degree as first optimal historical working condition data.
Before the optimal historical working condition data of the production device to be adjusted is input into the production consumption data model, the optimal historical working condition data of the production device to be adjusted needs to be replaced by the load expected value. Load data in the optimal historical working condition data of the production device to be adjusted are replaced by load expected values, the first optimal historical working condition data obtained after replacement can be input into a production consumption data model to be calculated through feature extraction and dimension reduction, the production consumption data model is used for calculating the production consumption data in the working condition adjustment data, and other data in the working condition adjustment data are consistent with data in the optimal historical working condition data obtained before.
The establishment of the yield consumption data model specifically comprises the following steps: the method comprises the steps that historical working condition data of a plurality of groups of production devices to be adjusted are collected in a historical data set, a dimension reduction data set is constructed by carrying out characteristic attribute extraction and dimension reduction on the historical working condition data, and a production consumption data model is established according to the historical production consumption data and the dimension reduction data set in the historical working condition data.
And step three, carrying out working condition adjustment on the production device to be adjusted according to the working condition adjustment data, and acquiring a system output consumption change value according to the working condition adjustment data and the current working condition data of the production device to be adjusted.
Selecting a production device to be compensated, acquiring current working condition data of the production device to be compensated, and acquiring a yield expected value according to the system yield variation value and the current working condition data of the production device to be compensated;
step five, acquiring the optimal historical working condition data of the corresponding to-be-compensated production device in the database according to the expected value of the production consumption and the current working condition data, and after acquiring the optimal historical working condition data of the to-be-compensated production device, replacing the expected value of the production consumption with the production consumption data in the optimal historical working condition data to acquire second optimal historical working condition data, wherein the second optimal historical working condition data is specifically as follows:
extracting a data subset in the range of 95-105% of the expected value of the yield consumption in the dimension reduction data set of the production device, calculating the Euclidean distance between each group of working condition data in the data subset and the variable replacement working condition data after dimension reduction according to an Euclidean distance formula, sorting the Euclidean distances obtained by calculation from small to large, selecting a group of working condition data with the minimum Euclidean distance as the historical working condition data with the highest matching degree, and using the historical working condition data with the highest matching degree as the optimal historical working condition data.
Before the optimal historical working condition data of the production device to be compensated is input into the load data model, the optimal historical working condition data of the production device to be compensated needs to be replaced by expected values of the production consumption. Load data in the optimal historical working condition data of the production device to be compensated are replaced by expected values of the production consumption, second optimal historical working condition data are obtained, feature extraction and dimension reduction processing are further needed to be carried out on the second optimal historical working condition data, the second optimal historical working condition data can be input into a load data model to carry out working condition adjustment data calculation, the load data model is actually load data in the working condition adjustment data, and other data in the working condition adjustment data are consistent with data in the optimal historical working condition data obtained before. And step six, inputting the second working condition data after dimensionality reduction into a load data model to obtain working condition adjustment data, and carrying out working condition adjustment on the production device to be compensated according to the working condition adjustment data.
The specific establishment process of the load data model comprises the following steps: the method comprises the steps of collecting historical working condition data of a plurality of groups of production devices to be compensated from a historical working condition data set, carrying out characteristic attribute extraction and dimension reduction processing on the historical working condition data to construct a dimension reduction data set, and establishing a load data model according to historical load data and the dimension reduction data set in the historical working condition data.
The specific establishing process of the historical data set comprises the following steps: acquiring working condition data of all production devices in a production system in a production and consumption balance state before load adjustment in real time, wherein the working condition data comprises production and consumption data, load data and other data related to production and consumption, and establishing a database according to the working condition data; historical working condition data of all production devices in the production system are collected from a database, the historical working condition data are subjected to data cleaning, and a historical data set is constructed according to the historical working condition data after the data cleaning.
The specific process of the characteristic attribute extraction and the dimension reduction processing is as follows: performing correlation analysis on the collected historical working condition data to obtain characteristic attributes of the working condition data of the production device, extracting the characteristic attributes of the collected historical working condition data, wherein the characteristic attributes are attributes with a correlation coefficient with the yield in the correlation analysis larger than 0.3, obtaining the characteristic attribute data of the historical working condition data, and constructing a characteristic attribute data set according to the obtained characteristic attribute data of the historical working condition data; performing principal component analysis on the characteristic attribute data set, calculating variance contribution rates of all component axes in the principal component analysis to the characteristic attribute data set, sequencing the calculated variance contribution rates from large to small, and performing summation calculation one by one according to a descending order until the sum of the variance contribution rates is greater than 95%; and taking the component axis corresponding to the summed variance contribution rate as a principal component axis, acquiring principal component data of the characteristic attribute data set according to the principal component axis, and constructing a dimension reduction data set through the principal component data.
The specific calculation formula of the euclidean distance is as follows:
wherein: d a The Euclidean distance of the working condition data after dimension reduction and the a-th group of working condition data in the data subset is obtained; m is the number of working condition data groups in the data subset; j is the number of variables in each group of working condition data in the data subset; l b The variance contribution rate corresponding to the b-th principal component; x is the number of ab The b variable in the a group of working condition data in the data subset is obtained; x is the number of b And the variable is the b-th variable of the working condition data after dimension reduction.
And when the expected value of the production consumption is obtained, the substep of judging the production consumption compensation amount is also executed: acquiring a yield threshold of a production device to be compensated and current working condition data of the production device, wherein the current working condition data of the production device comprises first yield data, first load data and other first data related to yield, acquiring the yield compensation threshold of the production device according to the yield threshold and the first yield, judging whether a yield change value is in the yield compensation threshold of the production device, if so, setting a yield expected value as the sum of the first yield and the yield change value, and if not, setting the yield expected value as the yield threshold; and calculating the yield variation value of the production device to be compensated according to the yield expectation value.
In the sixth step, after the working condition of the production device to be compensated is adjusted according to the working condition adjustment data, the update change value of the yield and consumption is calculated, wherein the update change value of the yield and consumption is the difference between the current change value of the yield and consumption of the system and the change value of the yield and consumption of the production device to be compensated, and if the update change value of the yield and consumption is zero, the system achieves the balance of the yield and consumption; and if the yield consumption updating change value is not zero, returning to the step four, and taking the yield consumption updating change value as the system yield consumption change value for subsequent calculation.
The data cleaning objects are historical data with missing attributes in historical working condition data, historical data outside a change threshold interval and data with abnormity and noise.
The screening and dimension reduction processing process of the data in the system is as follows:
first, the historical operating condition data collected from the database is defined as F (X)
i1 ,X
i2 ,X
i3 ,X
i4 ,......,X
in )=Y
i ,i∈[1,N]After screening and cleaning, the number of data sets is changed into m, and then secondary screening is carried out on the data variables through correlation analysis. Data changed to F (X) after correlation analysis
i1 ,X
i2 ,X
i3 ,X
i4 ,......,X
ik )=Y
i ,i∈[1,m]. Finally, dimension reduction processing is carried out, and the data after dimension reduction processing is changed into f (x)
i1 ,x
i2 ,x
i3 ,x
i4 ,......,x
ij )=Y
i ,i∈[1,m]And integrating the data subjected to the dimensionality reduction processing into a dimensionality reduction data set. The dimension reduction processing method is specifically principal component analysis, and the conditions for determining principal components in the principal component analysis are as follows:
wherein: x is the attribute related to production and consumption, N is the number of historical working condition data sets, N is the number of related variables, Y is the production and consumption of the device, X is the number of historical working condition data sets in Is the nth variable, Y, of the ith group of historical operating condition data i The yield/processing load of the device corresponding to the ith group of working condition data; x ik Performing correlation analysis on the ith variable in the ith group of historical working condition data, wherein k is the number of variables with correlation coefficients larger than 0.3, and m is the number of data groups after cleaning; x is the principal component after dimensionality reduction, x ij J is the jth variable of the ith group of working condition data in the dimension reduction data set, and j is the number of the variables of each group of working condition data in the dimension reduction data set; l i The variance contribution rate corresponding to the ith principal component.
And obtaining a dimension reduction data set according to the process, constructing a dimension reduction model according to the process, performing dimension reduction processing on the compensation device and the load adjusting device according to the dimension reduction model, and calculating the Euclidean distance subsequently.
The above-described embodiments are only preferred embodiments of the present invention, and are not intended to limit the present invention in any way, and other variations and modifications may be made without departing from the spirit of the invention as set forth in the claims.