A method, apparatus, and media for cleaning glass high temperature viscosity data

By removing and fitting outliers in high-temperature viscosity data of glass, regular characteristic viscosity and temperature data are generated, solving the problems of slow processing speed and low efficiency in existing technologies, and achieving fast and efficient data cleaning.

CN116244295BActive Publication Date: 2026-01-16CAIHONG GRP SHAOYANG SPECIAL GLASS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310252329.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-15
Publication Date
2026-01-16
Estimated Expiration
2043-03-15

AI Technical Summary

Technical Problem

Existing technologies suffer from slow and inefficient high-temperature viscosity data cleaning and processing, and the presence of abnormal and irregular temperature data makes viscosity analysis at the same temperature difficult, making it impossible to directly obtain the characteristic viscosity of glass.

Method used

By inputting characteristic viscosity data, outlier temperature and viscosity data are removed, and fitting and regularization processes are performed to generate characteristic viscosity and its corresponding temperature data. Dictionary deduplication and array operations are used to remove outlier data, and quadratic polynomial or linear fitting is performed to generate regularized specific temperature data.

Benefits of technology

It enables rapid cleaning of high-temperature viscosity data from glass, completing the process in just a few seconds, thus improving data processing efficiency and generating regular characteristic viscosity and temperature data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116244295B_ABST
    Figure CN116244295B_ABST
Patent Text Reader

Abstract

The application discloses a method, equipment and medium for cleaning glass high-temperature viscosity data, which can obtain the temperature corresponding to the characteristic viscosity of glass, remove abnormal values in the data, and regularize the data without abnormal values, specifically, in the first step, the characteristic viscosity data is input and stored in the memory; in the second step, the original high-temperature viscosity data is loaded, and the abnormal values (temperature and viscosity abnormal values) are removed; in the third step, the data without abnormal values is fitted (linear or quadratic curve fitting), the characteristic viscosity is substituted into the fitted equation, and the temperature corresponding to the characteristic viscosity is solved; in the fourth step, the data without abnormal values is regularized; and in the fifth step, the final result, i.e. the regularized high-temperature viscosity data without abnormal values, the characteristic viscosity and the corresponding temperature data, is displayed, and the whole process can be completed in only a few seconds, thereby overcoming the problems of slow speed and low efficiency in manually processing the original high-temperature viscosity data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of glass high-temperature viscosity data analysis, in particular to a method, device and medium for cleaning glass high-temperature viscosity data. BACKGROUND

[0002] In the field of glass, there are three shortcomings in the glass high-temperature viscosity data obtained through high-temperature viscometer testing: first, there are abnormal data; second, the temperature data are irregular, which leads to difficulties in analyzing the viscosity of different materials at the same temperature; and third, the characteristic viscosity of the glass cannot be directly obtained.

[0003] Therefore, it is necessary to clean the high-temperature viscosity raw data, but manual processing is time-consuming and labor-intensive, generally taking about 2 hours, which is slow and inefficient. SUMMARY

[0004] The present application aims to provide a method, device and medium for cleaning glass high-temperature viscosity data to overcome the problem of slow processing speed and low efficiency in cleaning high-temperature viscosity raw data in the prior art.

[0005] To achieve the above-mentioned purpose, the present application provides the following technical solutions:

[0006] A method for cleaning glass high-temperature viscosity data, comprising the following steps:

[0007] S1: inputting characteristic viscosity data;

[0008] S2: loading glass high-temperature viscosity data, and removing abnormal temperature data and its corresponding viscosity data. Remove abnormal viscosity data and its corresponding temperature data to obtain data without abnormal data;

[0009] S3: fitting the data without abnormal data to obtain an equation, substituting the characteristic viscosity data into the equation, and calculating the temperature data corresponding to the characteristic viscosity data;

[0010] S4: generating regularized specific temperature data according to the data without abnormal data, and calculating the viscosity data corresponding to the specific temperature data according to the data without abnormal data;

[0011] S5: displaying the characteristic viscosity data and its corresponding temperature data, and the specific temperature data and its corresponding viscosity data.

[0012] Preferably, in S1, if error characteristic viscosity data appears during the inputting of the characteristic viscosity data, if the error characteristic viscosity data is a single data, the single data is selected and deleted, and if the error characteristic viscosity data is multiple data, the data is emptied and re-inputted.

[0013] Preferably, in S2, the removal principle of the abnormal temperature data is as follows:

[0014] The temperature and viscosity data in the original data are written in the dictionary in the form of key-value pairs, the temperature abnormal data is removed by using the dictionary deduplication function, then the dictionary is converted into an array, and the array elements are sorted according to the temperature.

[0015] Preferably, the method for removing abnormal viscosity data in S2 is:

[0016] Loop A is constructed for removing viscosity abnormal data and its corresponding temperature data, loop B is constructed in loop A, loop B is used to find and set the temperature corresponding to the viscosity abnormal data to a specific value, after the completion of loop B is marked, the temperature and its corresponding viscosity data are written in the dictionary in the form of key-value pairs, the abnormal data is deleted by using the dictionary deduplication function, the temperature and viscosity arrays are emptied, and the key values in the dictionary are judged again whether the specific value is marked, if not, it means that the viscosity abnormal data has been removed, and loop A is exited; if it exists, the viscosity abnormal data in the dictionary is deleted, and the data in the dictionary is written into the array, and loop A is continued to be executed;

[0017] If there is no viscosity abnormal data in the array, the viscosity in the array is monotonically increasing, the viscosity in the adjacent elements is compared from the lower bound of the array in loop B, if the adjacent viscosity is monotonically increasing, the comparison is continued until loop B is ended; if the adjacent viscosity is not monotonically increasing, the viscosity abnormal data is found and marked from the index position abn, and the specific method is as follows:

[0018] First, loop C is constructed to find the index times corresponding to the minimum viscosity when the viscosity decreases from abn, that is, the viscosity at index times is less than or equal to the viscosity at times-1 and less than the viscosity at times+1; the index in loop C cannot exceed the upper bound of the array, otherwise loop C is exited, and times is equal to the upper bound of the array, after the end of loop C, if times is less than the upper bound of the array, loop D is constructed to find a viscosity from index times in the forward direction, so that the viscosity is greater than the viscosity at index abn, and the index of the viscosity is marked as num, the index in loop D cannot exceed the upper bound of the array, otherwise loop D is exited, and num is equal to the upper bound of the array, after the end of loop D, if num is less than the upper bound of the array, loop E is constructed to find a viscosity from index abn in the reverse direction, so that the viscosity is less than the viscosity at index times, and the index of the viscosity is marked as left, the index in loop E cannot be less than the lower bound of the array, otherwise loop E is exited, and left is equal to the lower bound of the array.

[0019] After the end of the cycle E, the times and the data upper bound size are judged. If the times is equal to the array upper bound, the temperature after the index abn is assigned to 0. Otherwise, the size of abn-left and num-times is judged. If abn-left >= num-times, the temperature between the index abn+1 and the index num-1 in the array is assigned to 0. Otherwise, the temperature between the index left+1 and the index times-1 in the data is assigned to 0. After the judgment, the execution of the statements in the cycle B is continued from the index num+1 until the end of the cycle.

[0020] After the end of the cycle, the temperature and the viscosity in the array are written into the dictionary in the form of key-value pair, and the abnormal viscosity data is deleted.

[0021] Preferably, the way of fitting the normal data in S3 is quadratic polynomial fitting.

[0022] Preferably, the way of fitting the normal data in S3 is linear fitting, and the method of obtaining the temperature corresponding to the characteristic viscosity data is specifically as follows:

[0023] First, an array Z is constructed, and the temperature in the normal data is operated by-2 power in sequence. The viscosity corresponding to the temperature is divided by 100 and then logarithmically operated. The results of the operations are assigned to the array Z respectively. The base numbers of the logarithmic operations include but are not limited to e and 10.

[0024] The array Z is linearly fitted to obtain a straight line equation and a correlation coefficient R.

[0025] If R is greater than 0.99, the logarithm of each characteristic viscosity data is calculated, and then substituted into the straight line equation. The result is operated by-0.5 power to obtain the temperature data corresponding to the characteristic viscosity.

[0026] If R is not greater than 0.99, a straight line equation L is constructed according to the first and last elements in the array Z. An array M is constructed, and all elements in the array Z are taken as points to solve the distance from the points to the straight line L and put into the array M.

[0027] The index corresponding to the maximum value of the data M is obtained, and then the array Z is divided into two segments by the index as a boundary, and marked as an array front and an array back. The viscosity N corresponding to the index in the array Z is obtained.

[0028] The straight line equations of the array front and the array back are calculated respectively. The logarithm of each characteristic viscosity data is calculated, and then compared with the viscosity N. If it is less than the viscosity N, it is substituted into the straight line equation corresponding to the array front to solve the temperature corresponding to the characteristic viscosity. Otherwise, it is substituted into the equation corresponding to the array back to solve the temperature corresponding to the characteristic viscosity.

[0029] Preferably, the method for generating regularized specific temperature data in S4 is:

[0030] The maximum value max and the minimum value min of the temperature data are obtained, and then the maximum value and the minimum value are rounded, and then the temperature as an integer is generated into an arithmetic sequence, and then the temperature in the arithmetic sequence is written into the dictionary as a key, and the value corresponding to the key is 0.

[0031] Preferably, the method for obtaining the viscosity corresponding to the specific temperature data is to construct a straight line equation according to the adjacent data before and after the specific temperature data, and then substitute the specific temperature to obtain the viscosity corresponding to the specific temperature.

[0032] A computer device comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of a method for cleaning glass high-temperature viscosity data when executing the computer program.

[0033] A computer readable storage medium stores a computer program, and the computer program implements the steps of a method for cleaning glass high-temperature viscosity data when executed by a processor.

[0034] Compared with the prior art, the present application has the following beneficial effects: the present application provides a method for cleaning glass high-temperature viscosity data, inputs characteristic viscosity data, loads glass high-temperature viscosity data, removes abnormal temperature data and viscosity data corresponding to the abnormal temperature data, removes abnormal viscosity data and temperature data corresponding to the abnormal viscosity data, obtains no abnormal data, obtains characteristic viscosity data and temperature data corresponding to the characteristic viscosity data according to the characteristic viscosity data and the no abnormal data, and generates a specific temperature sequence, obtains viscosity data corresponding to the specific temperature according to the no abnormal data, outputs the temperature sequence and the viscosity data corresponding to the specific temperature, and the whole process can be completed in only a few seconds, overcoming the problem of slow processing speed and low efficiency in the prior art when cleaning high-temperature viscosity raw data. BRIEF DESCRIPTION OF DRAWINGS

[0035] Figure 1 is a flow chart of the method for cleaning glass high-temperature viscosity data of the present application;

[0036] Figure 2 is the VBA software interface in the embodiment of the present application;

[0037] Figure 3 is the VBA software window in the embodiment of the present application;

[0038] Figure 4 is the VBA software result display in the embodiment of the present application;

[0039] Figure 5is the normal viscosity-temperature data curve diagram of the present application;

[0040] Figure 6 is the abnormal viscosity-temperature data curve diagram of the present application;

[0041] Figure 7 is the local enlarged view of the abnormal viscosity data area of the present application;

[0042] Figure 8 is the python software operation interface of the present application;

[0043] Figure 9 is the python software result display interface of the present application. DETAILED DESCRIPTION

[0044] The present application will be further described in detail below in combination with specific examples, which are the explanation but not the limitation of the present application.

[0045] As shown in Figure 1 , the present application provides a method for cleaning glass high-temperature viscosity data,

[0046] S1: input characteristic viscosity data;

[0047] S2: load glass high-temperature viscosity data, remove abnormal temperature data and its corresponding viscosity data. Remove abnormal viscosity data and its corresponding temperature data to obtain no abnormal data;

[0048] S3: fit the no abnormal data to obtain an equation, substitute the characteristic viscosity data to calculate the temperature data corresponding to the characteristic viscosity data;

[0049] S4: generate regularized specific temperature data according to the no abnormal data, and calculate the viscosity data corresponding to the specific temperature data according to the no abnormal data;

[0050] S5: display the characteristic viscosity data and its corresponding temperature data, and the specific temperature data and its corresponding viscosity data.

[0051] The specific operation is as follows:

[0052] Open the software and enter the data cleaning interface

[0053] Add characteristic viscosity data. Input the characteristic viscosity in the characteristic viscosity input box, and click the "add" button to write the data into the list box. Repeat the above steps to input all the characteristic viscosity data.

[0054] 1) If the data is wrong, single data error, select the wrong data in the list box and click the "delete" button to delete it; multiple data errors, click the "clear" button to clear all data in the list box;

[0055] 2) If the data needs to be sorted, click the "Sort" button to arrange the data in ascending order.

[0056] Click the "Calculate" button to load the original data, and then obtain the result.

[0057] The specific calculation results are as follows:

[0058] a. Load the original data and remove the abnormal temperature data (including its corresponding viscosity data).

[0059] b. Remove the abnormal viscosity data (including its corresponding temperature data) to obtain the non-abnormal data.

[0060] c. Obtain the temperature corresponding to the characteristic viscosity.

[0061] d. Generate a specific temperature sequence.

[0062] e. Obtain the viscosity corresponding to the specific temperature.

[0063] f. Obtain the result.

[0064] To ensure that the characteristic viscosity entered in the text box of the data cleaning interface does not have abnormal values, the text box data entry format is limited, and the characteristic viscosity input data format only supports numbers.

[0065] To ensure that the characteristic viscosity data is not empty, non-empty verification will be performed on the input data when the "Calculate" button is clicked.

[0066] The principle of loading the original data and removing the abnormal temperature data is as follows:

[0067] Write the temperature and viscosity data in the original data as key-value pairs in a dictionary, use the dictionary deduplication function to remove the temperature abnormal data. Then convert the dictionary to an array, and then sort the array elements according to the temperature.

[0068] The specific process of removing the abnormal viscosity data is as follows:

[0069] 1) Construct a loop A to remove the abnormal viscosity data and its corresponding temperature data, and construct a loop B in loop A, which is used to find and set the temperature corresponding to the abnormal viscosity data to a specific value. After loop B is marked, write the temperature and its corresponding viscosity data in the form of key-value pairs in a dictionary, delete the abnormal data through the dictionary deduplication function, and clear the temperature and viscosity array. Again, judge whether the key value in the dictionary exists. If it does not exist, it means that the abnormal viscosity data has been removed (the viscosity is monotonically increasing), and the loop A is exited; if it exists, delete the abnormal viscosity data (marked with a specific value) in the dictionary, write the data in the dictionary to an array, and continue to execute loop A.

[0070]

[0071] ​2) If there is no viscosity abnormal data in the array, the viscosity in the array is monotonically increasing. In the loop B, compare the viscosity in the adjacent elements from the lower bound of the array. If the adjacent viscosity is monotonically increasing, continue to compare until the loop B ends. If the adjacent viscosity is not monotonically increasing, start searching from the index position abn and mark the viscosity abnormal data, as follows:

[0072] First, construct the loop C, and start searching from abn to find the index times at which the viscosity decreases to the minimum value, that is, the viscosity at the index times is less than or equal to the viscosity at times-1 and less than the viscosity at times+1.

[0073] The index in the loop C cannot exceed the upper bound of the array, otherwise the loop C is exited, and times is equal to the upper bound of the array.

[0074] After the loop C ends, if times is less than the upper bound of the array, construct the loop D, and start searching from the index times to find a viscosity, such that the viscosity is greater than the viscosity at the index abn, and mark the index of the viscosity as num.

[0075] The index in the loop D cannot exceed the upper bound of the array, otherwise the loop D is exited, and num is equal to the upper bound of the array.

[0076] After the loop D ends, if num is less than the upper bound of the array, construct the loop E, and start searching from the index abn to find a viscosity, such that the viscosity is less than the viscosity at the index times, and mark the index of the viscosity as left.

[0077] The index in the loop D cannot be less than the lower bound of the array, otherwise the loop 3 is exited, and left is equal to the lower bound of the array.

[0078] 3) After the loop D ends, compare the size of times and the upper bound of the data. If times is equal to the upper bound of the array, assign the temperature after the index abn to 0. Otherwise, compare the size of abn-left and num-times.

[0079] If abn-left >= num-times, assign the temperature in the array from the index abn+1 to the index num-1 to 0; otherwise, assign the temperature in the data from the index left+1 to the index times-1 to 0.

[0080] After the judgment ends, start from the index num+1 to continue executing the statements in the loop B until the loop ends.

[0081] 4) After the loop B ends, write the temperature and viscosity in the array in the form of key-value pairs into the dictionary, and delete the abnormal viscosity data.

[0082] 5) judge whether the key in the dictionary contains 0, if not, exit the loop A, if yes, delete the data in the dictionary containing 0, empty the array, write the data in the dictionary into the array, and start the loop A again.

[0083] The specific process of obtaining the temperature corresponding to the characteristic viscosity is as follows:

[0084] 1) Construct array Z. Perform -2 power operation on the temperature in the dictionary in turn, divide the viscosity corresponding to the temperature by 100, and then perform logarithmic operation on the result, and assign the result to array Z respectively. The base of the logarithmic operation includes but is not limited to e and 10.

[0085] 2) Fit the straight line equation. Linear fitting is performed on array Z to obtain the straight line equation and the correlation coefficient R.

[0086] 3) If R is greater than 0.99, the logarithm of each characteristic viscosity data is calculated, then substituted into the straight line equation, and then the result is calculated by -0.5 power operation, that is, the temperature data corresponding to the characteristic viscosity is obtained.

[0087] 4) If R is not greater than 0.99, construct a straight line equation L according to the first and last elements (temperature and viscosity) in array Z. Construct array M, take all elements in array Z as points, calculate the distance from the points to the straight line L, and put them into array M.

[0088] 5) Get the index corresponding to the maximum value of data M, then divide array Z into two segments with the index as the boundary, and mark them as array front and array back respectively. Then get the viscosity N (which has been calculated by logarithm operation) corresponding to the index in array Z.

[0089] 6) Calculate the straight line equation of array front and array back respectively, then calculate the logarithm of each characteristic viscosity data, and compare it with the viscosity N. If it is less than the viscosity N, substitute it into the straight line equation corresponding to array front to solve the temperature corresponding to the characteristic viscosity; otherwise, substitute it into the straight line equation corresponding to array back to solve the temperature corresponding to the characteristic viscosity.

[0090] Construct array Z, preferably take the inverse of the temperature in the dictionary.

[0091] After constructing array Z, perform quadratic polynomial fitting, then substitute the calculated viscosity into the equation to solve the corresponding temperature.

[0092] The principle of generating a specific temperature sequence is as follows:

[0093] The maximum value max and the minimum value min of the temperature in the dictionary are obtained, and are then rounded, and then an arithmetic sequence with integer temperature (with a tolerance of no more than 100℃) is generated according to the maximum value and the minimum value. Then the temperature in the arithmetic sequence is written into the dictionary as a key, and the value corresponding to the key is 0. In addition, the value corresponding to the temperature written into the dictionary can be an arbitrary string or number.

[0094] The principle of obtaining the viscosity corresponding to a specific temperature is that the temperatures in the dictionary are very close, so it can be approximately considered that adjacent data approximately pass through a straight line. Therefore, a straight line equation is constructed according to adjacent data before and after the specific temperature, and then the specific temperature is substituted, so that the viscosity corresponding to the specific temperature can be obtained.

[0095] Example 1

[0096] The programming language is VBA, and the programming idea is process-oriented.

[0097] A new Excel workbook is created, a form is inserted in the VBA development tool interface of Excel, and is named ‘Data cleaning interface’; and various controls are added in the interface, such as Figure 3 as shown.

[0098] A module is inserted in the VBA editing interface of Excel, and is named ‘Start’ and global variables are declared in the module first, and the code is as follows:

[0099] Code 1,

[0100]

[0101] The original data file is named wenjian_name; the dynamic arrays arr, data and the dictionary dic are used to store temperature and viscosity data; the variable color_row marks the total number of characteristic viscosity data; the type variable

[0102] line_parameter stores the equation of a straight line (general form) variable. Option Base 1 specifies that the explicit declaration of the array index is 1, and Option Explicit is used to force the variable to be declared first and then referenced.

[0103] A new process start macro is established in the ‘Start’ module, and the code for opening the ‘Data cleaning interface’ and emptying the worksheet is edited in the process.

[0104] As shown in Figure 2 , a new button is created in the Excel worksheet, and is named ‘Visco data cleaning’, and the macro corresponding to the button is specified as start, and the worksheet sheet1 is renamed as viscocity.

[0105] To ensure that the input of the characteristic viscosity of the number, in the form of code editor for the characteristic viscosity input box (text box) input data format requirements, VBA code as follows:

[0106] Code 2: the format of the characteristic viscosity input box data is limited

[0107]

[0108] Write code for the "add" button, the main function is to write the input of the characteristic viscosity data into the list box.

[0109] Write code for the "delete" button, the main function is to delete the list box of the wrong characteristic viscosity data.

[0110] Write code for the "clear" button, the main function is to clear the list box data.

[0111] Write code for the "sort" button, the main function is to sort the list box of the characteristic viscosity data, the sorting rule is ascending.

[0112] Create the main process main in the "start" module, the code is as follows:

[0113] Code 3:

[0114]

[0115] The main process main code calls four processes in turn: dic_array_open_file, clear_extreme_increase_number, characteristic viscosity, add_temperature, calculate, show_result.

[0116] Write code for the "calculate" button to call main.

[0117] dic_array_open_file process opens the viscosity-temperature raw data table, and assigns the temperature and viscosity two column arrays to the array arr (global variable), and then eliminates the temperature outliers. The detailed code is as follows:

[0118] Code 4:

[0119]

[0120]

[0121] In code 4, lines 2-19, the temperature and viscosity data in the original viscosity-temperature table are read into array arr. Lines 21-26, the elements in array arr are written into dictionary dic, and the abnormal temperature data are removed by using the de-duplication function of the dictionary. Lines 27-45, the data after removing the abnormal temperature are reordered, and the result is stored in array arr.

[0122] The clear_extreme_increase_number procedure removes the abnormal viscosity values in array arr, and the final result is stored in global object dictionary dic. The detailed code is as follows:

[0123] Code 5:

[0124]

[0125]

[0126]

[0127] In code 5, several local variables are first declared. The flag is used to determine whether the abnormal viscosity values in the viscosity-temperature data are completely removed after the outer loop. If they are completely removed, the flag is assigned a value of false, and the outer loop is exited. The final result is stored in dictionary dic (temperature as key, and viscosity as corresponding value).

[0128] The 8-61 line sub-loop code in code 5 is used to loop through the viscosity-temperature array and mark the index of the abnormal viscosity value in the array (assign the temperature corresponding to the abnormal viscosity data to 0). The 63-80 line code is used to delete the abnormal viscosity and its corresponding temperature data by using the de-duplication function of the dictionary. The specific process is to assign the array elements to the dictionary, with the first dimension elements of the array as key and the second dimension elements as value. At the same time, it is determined whether the abnormal data are completely removed. If they are completely removed, the flag is assigned a value of false, and the main loop is exited. If they are not completely removed, the main loop continues.

[0129] The 10th line code in code 5 is used to find the index (i+1) where the abnormal data start to appear. After finding it, three loops (13-18 line code, 20-29 line code, and 31-37 line code) are used to determine the index of the abnormal data, and then the 38-58 line code is used to mark the abnormal number, and the 59th line code is used to continue to find and mark the abnormal data.

[0130] The 13-18 line code in code 5 is used to determine the total number of times of the non-monotonic increasing region of viscosity (viscosity decreases or remains unchanged). The specific process is to loop through the viscosity-temperature array, and determine the number of times of the non-monotonic increasing region of viscosity. Figure 7The middle triangle point. The 20-29 code mainly functions: from the minimum viscosity (viscosity at i+times in the array, i.e. the 6th triangle point), start comparing each viscosity in turn with the viscosity value at index i in the array, until the viscosity is greater than the corresponding viscosity at index i in the array, and determine the total number of abnormal viscosities num, see details in Figure 7 The heart-shaped point in the middle. The code 31-37 mainly functions: from index i in the array, find the total number of viscosities less than the minimum viscosity top_num, see details in Figure 7 The diamond point.

[0131] The code 5 in the 38-58 line code marks the characteristics of the number of exceptions, the size of num and top_num, the smaller area corresponds to the temperature in the array assigned to 0.

[0132] The characteristic viscosity process is to first linearly fit the data with abnormal values removed, then substitute the characteristic viscosity after correlation operation into the fitted equation, and solve the corresponding temperature. The detailed code is as follows:

[0133] Code 6:

[0134]

[0135]

[0136]

[0137] The code 6 in the 6-11 line code, first take the reciprocal of the temperature in the dictionary of non-exception data, and take the logarithm of the viscosity, then assign it to the array t() and N() respectively. The 12-15 line code obtains the characteristic viscosity data, which exists in the array nn(). The 22-25 line code linearly fits the array t() and N(), obtains the linear equation parameters k, b and the correlation coefficient r. The 26-66 line code, for the case where the correlation coefficient is less than 0.99, i.e. the linear fitting is poor, the array t() and N() are segmented linearly fitted, the segmented linear equation parameters are obtained, then calculated with the characteristic viscosity to obtain the temperature corresponding to the characteristic viscosity. The 67-70 line code, for the case where the correlation coefficient is greater than 0.99, linearly fit the array t() and N(), or take the linear equation parameters, and then calculate the temperature corresponding to the characteristic viscosity.

[0138] The add_temperature process mainly writes specific temperature data in the data from which outliers have been removed. The specific temperature data is an arithmetic sequence, and is an integer divisible by 5, with a tolerance of 5. In addition, the maximum value of the specific temperature data is not more than the maximum temperature of the data from which outliers have been removed, and the minimum value is not less than the minimum temperature of the data from which outliers have been removed. Moreover, the specific temperature data cannot be repeated with the temperature of the data from which outliers have been removed. The specific code is as follows:

[0139] Code 7:

[0140]

[0141]

[0142] In code 7, lines 2-8 declare related variables. Lines 9-20 of the code are used to write specific temperature data to the dictionary, wherein lines 9-15 of the code are used to determine the maximum value, minimum value and tolerance of the specific temperature data. Lines 16-20 of the code use the dictionary deduplication function to ensure that there is no repeated temperature data in the data after writing the temperature data. Lines 21-40 of the code are used to write the dictionary data to the array arr, with the keys (temperature) and values (viscosity) in the dictionary corresponding to the first dimension and second dimension data of the array, respectively, and then sort the array arr according to the descending power of the temperature (first dimension data).

[0143] The purpose of the calculate process is to calculate the viscosity corresponding to the specific temperature. The principle of viscosity calculation is that the adjacent three groups of data are very close, so it can be considered that the adjacent three groups of data approximately pass through a straight line. The specific code is as follows:

[0144] Code 8:

[0145]

[0146] The purpose of the show_result process is to write the final result to the worksheet viscosity, which can be seen in Figure 4 , and the specific code is as follows:

[0147] Code 9

[0148]

[0149] In code 9, lines 3-8 of the code mark the non-integer temperature in the arr array result as 0; lines 9-13 of the code mark the temperature in the array arr that is not an integer and cannot be divided by 5 as 0; lines 14-17 of the code use the dictionary deduplication function to remove the data (including the corresponding viscosity) with the temperature marked as 0. Lines 18-43 of the code display the final result and set the worksheet format.

[0150] Example 2;

[0151] The programming language is python. The modules or libraries involved in programming are: tkinter, csv, openpyxl, numpy and scipy. Among them, tkinter is used to build GUI, csv is used to read viscosity raw data, openpyxl is used to read and write Excel files, and numpy and scipy complete data linear fitting. The specific code is as follows:

[0152] Code 10:

[0153]

[0154] The programming idea is object-oriented. First, create the Viscocity class, and then instantiate the Viscocity object. The Viscocity class can realize the functions of building GUI interface and processing viscosity raw data. The specific code is as follows:

[0155] Code 11:

[0156]

[0157] In code 11, the first 19 lines of code are to create the Viscocity class, and the second 19 lines of code are the related functions in the Viscocity class, which are used to realize the functions of GUI interface, data processing and data export, etc. The 23-24 lines of code are the instantiation of the Viscocity class.

[0158] In the Viscocity class, the functions def__init__(self, root), def create_main_window(self), and def create_lbfm(self) are used to build the GUI interface and related controls. The GUI interface is shown in Figure 8 .

[0159] Code 12:

[0160]

[0161] The function callbackw(self, *args) involved in the 21st line of code in code 12 limits the data input format of the characteristic viscosity input control self.content to only numbers. The specific code is as follows:

[0162] Code 13:

[0163]

[0164] The function add_visco(self) in code 12 is used to write the characteristic viscosity into the list box, and it is bound to the "add" button in the GUI interface. The function list_del_all(self) is used to clear the list box, and it is bound to the "clear" button in the GUI interface. The function list_del(self) is used to delete the selected data (error value) in the list box, and it is bound to the "delete" button in the GUI interface.

[0165] The function input_TN(self) is used to sort the characteristic viscosity in the list box according to the ascending power, and convert the characteristic viscosity data from integer to float. The final result is returned to the list self.TN.

[0166] The function data_list(self,a) is used to convert the elements of the two-dimensional array (first dimension temperature, second dimension viscosity) to float type data, and then use the dictionary to remove duplicate temperature values. Finally, it is sorted. The specific code is as follows:

[0167] Code 14:

[0168]

[0169] The function read_raw_data(self,path) is used to read the temperature and viscosity data from the original viscosity-temperature data table and store it in the list as the return value. The specific code is as follows:

[0170] Code 15

[0171]

[0172] The function fit_x_y(self,dic_normal) is used to remove the clean data (dictionary) for quadratic polynomial fitting, and the library involved is numpy (abbreviation np). The data in the list self.TN is substituted into the equation, and the corresponding temperature is calculated. Finally, the characteristic viscosity and its corresponding temperature are stored in the list self.TN_result, with temperature as the first dimension data and viscosity as the second dimension data. The specific code is as follows:

[0173] Code 16

[0174]

[0175] The function open_data(self) is mainly used to respond to the "calculate" button in the GUI interface. Specifically, after clicking "calculate", it first checks whether there is characteristic viscosity data in the list box. If not, it prompts an error and forces the input of data. If there is, it reads the data from the original viscosity-temperature data table, and then calls the relevant functions to display the final result. The specific code is as follows:

[0176] Code 17

[0177]

[0178] In code 17, the function of line 5 is to call the self.input_TN() function to read the characteristic viscosity data in the list box. The functions of lines 6-10 are to obtain the path of the original viscosity-temperature table. The function of line 11 is to read the temperature and viscosity data using the path of the original viscosity-temperature table. Specifically, the function self.read_raw_data(self.file_path) is used to read the temperature and viscosity data, and then the read data is passed to the function self.data_list(), and the final float-type data is passed to self.raw_list. Line 12 calls the function self.clear_error_data(self.raw_list) to remove abnormal data, and the return value is the typical data dic_data. Line 13 calls the function self.fit_x_y(dic_data) to perform quadratic polynomial fitting and calculate the temperature corresponding to the characteristic viscosity. Line 14 calls the function self.add_temp(dic_data) to add a specific temperature (tentatively corresponding to a viscosity of 1, which will be described later) to the dictionary dic_data after the abnormal data has been removed, and then the temperature and viscosity in the dictionary are assigned to the list variables self.add_wendu and self.add_niandu, respectively. The function of line 15 is to calculate the viscosity corresponding to the specific temperature using the function self.calculate(self.add_wendu, self.add_niandu). Line 16 shows the final result. The functions in code 17 have been described before, and those not described will be described in detail below.

[0179] The function clear_error_data(self, raw_data) in line 12 of code 17 is to remove abnormal data and assign the result to dic_data. The specific code is as follows:

[0180] Code 18

[0181]

[0182]

[0183]

[0184] Several local variables are declared in code 18, the flag variable is used to determine whether the viscosity abnormal value in the viscosity-temperature data is removed completely after passing through the outer loop, if it is removed completely, the flag is set to false, and the outer loop is jumped out. The final result is stored in the dictionary dic (temperature as key, viscosity as corresponding value).

[0185] The 8-53 line code in code 18 is used to loop through the viscosity-temperature array and mark the index of the abnormal viscosity value in the array (set the temperature corresponding to the abnormal viscosity data to 0). The 54-62 line code is used to delete the abnormal viscosity and its corresponding temperature data by using the dictionary deduplication function. The specific process is to assign the array elements to the dictionary, the first dimension element of the array is the key, and the second dimension element is the value. At the same time, it is judged whether the abnormal data is completely removed, if it is removed completely, the flag is set to false, and the main loop is jumped out; if it is not removed completely, the main loop is continued. The 63 line code is the return value of the function clear_error_data(self, raw_data) (the result is a dictionary)

[0186] The 7th line code in code 18 is used to find the index (i+1) where the abnormal data starts to appear. After finding the abnormal data, three loops (12-18 line code, 19-28 line code and 32-35 line code) are used to determine the index of the abnormal data, and then 37-53 line code is used to mark the abnormal data. Among them, the 47th line code is used to skip the marked abnormal data and continue to find and mark the abnormal data.

[0187] The 12-18 line code in code 18 is used to determine the total number of non-monotonic increasing regions of viscosity (viscosity decreases or remains unchanged). The main function of the 19-28 code is to compare each viscosity with the viscosity value at index i in the array from the minimum viscosity (viscosity at i+de_nums in the array) to the viscosity greater than the viscosity at index i in the array, and determine the total number of abnormal viscosities num. The main function of the code 32-35 is to find the total number of viscosities less than the minimum viscosity from the index i position of the array.

[0188] The feature of the 37-53 line code in code 18 is that the smaller region corresponds to the temperature value 0 in the array by comparing the size of de_nums and top_num.

[0189] The 14th line code add_temp(dic_data) in code 17 is used to add specific temperature data, and the specific code is as follows:

[0190] Code 19:

[0191]

[0192]

[0193] In code 19, lines 2-11 determine the maximum and minimum values of the specific temperature data, where the specific temperature data is an arithmetic sequence with a tolerance of 5 and all temperatures are divisible by 5. Lines 12-14 write the specific temperature data in the form of a key to the dictionary dic_data (passed to temperature), and the corresponding values are all 1, where the specific temperature written cannot be an existing data in the dictionary. Line 15 sorts the dictionary to ensure that the temperatures in the dictionary are sorted in descending order. Lines 16-18 assign the temperatures in the dictionary data to the list self.add_wendu and the viscosities in the dictionary data to the list self.add_niandu.

[0194] In code 17, line 15 mainly calculates the viscosity corresponding to the specific temperature, respectively takes the list self.add_wendu and self.add_niandu as input to the function calculate(self, a, b), and then assigns the final result to self.result. The code of the function calculate(self, a, b) is as follows:

[0195] Code 20:

[0196]

[0197] In code 17, line 16 function self.data_show() is used to display the result GUI window (see Figure 9 ), and the result is displayed in the result window. The "export" button in the result window is used to realize the export of the final result (Excel table). The specific code is as follows:

[0198] Code 21:

[0199]

[0200]

[0201] In code 21, lines 2-3 are used to close (minimize) the main window self.root and display the window data_window, which is shown in Figure 9The 5-7 lines of code are used to describe the window properties (title, size and whether scalable). The 8-10 lines of code are used to show the original viscosity material number information. The 12-24 lines of code are used to layout the Treeview control related information. The 25-30 lines of code are used to write the function open_data calculated result self.result and self.TN_result into the Treeview control. The 31-33 lines of code are used to layout the "export" button on the data_window form, and the response function of the export button is output. The 34 lines of code are used to set the event after closing the data_window form, and the binding event is determined by the function jieshu.

[0202] The function output is used to export the final result self.result and self.TN_result to the Excel table, and after the data is exported successfully, a prompt dialog box is popped up, and the information is "file export success!!!". The specific code is as follows:

[0203] Code 22:

[0204]

[0205] Example 3:

[0206] The terminal device provided by the embodiment. The terminal device of the embodiment includes a processor, a memory, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the steps in each method embodiment described above. Alternatively, the processor executes the computer program to implement the functions of each unit in each device embodiment described above.

[0207] The computer program can be divided into one or more units, which are stored in the memory and executed by the processor to complete the present application.

[0208] The terminal device can be a desktop computer, a notebook, a palm computer, and a cloud server, etc. The terminal device can include, but is not limited to, a processor and a memory.

[0209] The processor can be a central processing unit (CPU), and can also be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc.

[0210] The memory can be used to store the computer program, and the processor realizes various functions of the terminal device by running or executing the computer program stored in the memory and calling data stored in the memory.

[0211] The units integrated in the terminal device, if realized in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above-mentioned embodiment methods can also be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. The computer program can realize the steps of the above-mentioned various method embodiments when executed by a processor. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form, etc. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content included in the computer readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.

[0212] Although the embodiments of the present application are described above in combination with the drawings, the present application is not limited to the above-mentioned specific embodiments and application fields, and the above-mentioned specific embodiments are only illustrative and guiding, but not limiting. Those skilled in the art can make many forms under the guidance of the specification without departing from the scope protected by the claims of the present application, and these all belong to the protection of the present application.

Claims

1. A method for cleaning of glass high temperature viscosity data, characterized by, The method comprises the following steps: S1: input characteristic viscosity data; S2: load glass high-temperature viscosity data, eliminate abnormal temperature data and corresponding viscosity data, eliminate abnormal viscosity data and corresponding temperature data, and obtain no abnormal data; S3: fit the no abnormal data to obtain an equation, substitute the characteristic viscosity data, and calculate the temperature data corresponding to the characteristic viscosity data; S4: generate regularized specific temperature data according to the no abnormal data, and calculate the viscosity data corresponding to the specific temperature data according to the no abnormal data; S5: display the characteristic viscosity data and corresponding temperature data, and the specific temperature data and corresponding viscosity data; The method for eliminating abnormal viscosity data in S2 is as follows: A loop A is constructed to eliminate viscosity abnormal data and corresponding temperature data, and a loop B is constructed in the loop A, the loop B is used to find and set the temperature corresponding to the viscosity abnormal data as a specific value, after the loop B is marked, the temperature and corresponding viscosity data are written in a dictionary in the form of key-value pair, the abnormal data is deleted through the dictionary deduplication function, the temperature and viscosity arrays are emptied, and then it is judged whether the key value in the dictionary exists the specific value, if not, it is indicated that the viscosity abnormal data has been eliminated, and the loop A is exited; if yes, the viscosity abnormal data in the dictionary is deleted, the data in the dictionary is written in an array, and then the loop A is continuously executed; If there is no viscosity abnormal data in the array, the viscosity in the array is monotonically increasing, the viscosity in adjacent elements is compared from the lower bound of the array in the loop B, if the adjacent viscosity is monotonically increasing, the comparison is continuously performed until the loop B is ended; if the adjacent viscosity is not monotonically increasing, the viscosity abnormal data is found and marked from the index position abn, and the specific method is as follows: First, a loop C is constructed to find the index times corresponding to the minimum viscosity when the viscosity is found to be decreasing from the abn, that is, the viscosity at the index times is less than or equal to the viscosity at times-1 and less than the viscosity at times+1; the index in the loop C cannot exceed the upper bound of the array, otherwise the loop C is exited, and times is equal to the upper bound of the array, after the loop C is ended, if times is less than the upper bound of the array, a loop D is constructed to find a viscosity from the index times, so that the viscosity is greater than the viscosity at the index abn, and the index of the viscosity is marked as num, the index in the loop D cannot exceed the upper bound of the array, otherwise the loop D is exited, and num is equal to the upper bound of the array, after the loop D is ended, if num is less than the upper bound of the array, a loop E is constructed to find a viscosity from the index abn, so that the viscosity is less than the viscosity at the index times, and the index of the viscosity is marked as left, the index in the loop E cannot be less than the lower bound of the array, otherwise the loop E is exited, and left is equal to the lower bound of the array; After the end of the cycle E, the times and the data upper bound size are judged. If times is equal to the array upper bound, the temperature after the index abn is assigned to 0. Otherwise, the size of abn-left and num-times is judged. If abn-left >= num-times, the temperature between the index abn+1 and the index num-1 in the array is assigned to 0. Otherwise, the temperature between the index left+1 and the index times-1 in the data is assigned to 0. After the judgment, the statements in the cycle B are executed from the index num+1 until the end of the cycle. After the end of the cycle, the temperature and the viscosity in the array are written into the dictionary in the form of key-value pairs, and the abnormal viscosity data is deleted. The method for generating regular specific temperature data in S4 is: The maximum value max and the minimum value min of the temperature data are obtained, and then the temperature is taken as an integer. Then, the arithmetic sequence with integer temperature is generated according to the maximum value and the minimum value. Then, the temperature in the arithmetic sequence is written into the dictionary as the key, and the corresponding value is 0. The method for obtaining the viscosity corresponding to the specific temperature data is: a straight line equation is constructed according to the adjacent data before and after the specific temperature data, and then the specific temperature is substituted to obtain the viscosity corresponding to the specific temperature.

2. A method for cleaning glass high temperature viscosity data according to claim 1, wherein, In S1, if the error characteristic viscosity data appears during the input of the characteristic viscosity data, if the error characteristic viscosity data is a single data, the single data is selected and deleted. If the error characteristic viscosity data is multiple, the data is emptied and re-input.

3. A method for cleaning glass high temperature viscosity data according to claim 1, wherein, The principle of removing abnormal temperature data in S2 is: The temperature and viscosity data in the original data are written into the dictionary in the form of key-value pairs, and the temperature abnormal data is removed by using the dictionary deduplication function. Then, the dictionary is converted into an array, and the array elements are sorted according to the temperature.

4. The method for cleaning glass high temperature viscosity data of claim 1, wherein, The fitting method for the non-abnormal data in S3 is quadratic polynomial fitting.

5. The method for cleaning glass high temperature viscosity data of claim 1, wherein, The fitting method for the non-abnormal data in S3 is linear fitting. The method for obtaining the temperature corresponding to the characteristic viscosity data is as follows: First, construct an array Z, and perform-2 power operation on the temperature in the non-abnormal data. The viscosity corresponding to the temperature is divided by 100 and logarithmically operated. Then, the results of the operations are assigned to the array Z. The base of the logarithmic operation includes but is not limited to e and 10. Linear fitting is performed on the array Z to obtain a straight line equation and a correlation coefficient R. If R is greater than 0.99, the logarithm of each characteristic viscosity data is calculated, and then substituted into the straight line equation. Then, the result is-0.5 power operated to obtain the temperature data corresponding to the characteristic viscosity. If R is not greater than 0.99, a straight line equation L is constructed according to the first and last elements in the array Z. An array M is constructed, and the distance from all elements in the array Z to the straight line L is calculated and put into the array M. The maximum value of the data M is obtained, and then the array Z is divided into two parts according to the index, and the array front and the array back are marked. Then, the index N corresponding to the viscosity in the array Z is obtained. The straight line equations of the array front and the array back are respectively obtained, the characteristic viscosity data are respectively taken logarithm, and then compared with viscosity N, if it is less than viscosity N, the corresponding straight line equation of the array front is brought in to solve the temperature corresponding to the characteristic viscosity, otherwise, the corresponding equation of the array back is brought in to solve the temperature corresponding to the characteristic viscosity.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method for cleaning glass high-temperature viscosity data according to any one of claims 1 to 5.

7. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 6. The computer program is executed by the processor to implement the steps of the method for cleaning glass high-temperature viscosity data according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Calibration data correction method and electronic equipment thereof

    CN110082319A

  • System-level control using tree-based regression with outlier removal

    US20220058515A1