Automatic scale adjusting method, device and equipment and storage medium

By conducting multi-material tests on the quantitative packaging scale, establishing a mapping model, and iteratively optimizing the parameters, the problem of insufficient accuracy in setting the parameters of the quantitative packaging scale was solved, and a fast and efficient automatic parameter adjustment process was achieved.

CN121901705APending Publication Date: 2026-04-21ZHUZHOU GEMAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHUZHOU GEMAN TECH CO LTD
Filing Date
2025-12-31
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

The existing parameter setting methods for quantitative packaging scales cannot accurately describe the nonlinear relationship between material characteristics and control parameters, resulting in slow convergence speed of parameter adjustment and low debugging efficiency.

Method used

By conducting multi-material tests on quantitative packaging scales, collecting multi-characteristic data and weighing errors, establishing a mapping model, generating conservative parameters, and iteratively adjusting and optimizing the parameters, automatic parameter tuning is achieved.

Benefits of technology

The automatic parameter adjustment of the quantitative packaging scale has been realized, which can quickly achieve the optimal weighing accuracy without manual intervention and significantly shorten the debugging time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121901705A_ABST
    Figure CN121901705A_ABST
Patent Text Reader

Abstract

The invention provides an automatic scale adjusting method, device and equipment and a storage medium, and the method comprises the steps: carrying out the multi-material testing of a quantitative packaging scale, collecting the multi-feature data and corresponding control parameters and weighing errors, and obtaining a mapping model through fitting; acquiring current characteristic quantity data of the quantitative packing scale to be debugged, and inputting the mapping model to generate conservative parameters; controlling the quantitative packing scale to be debugged to operate according to conservative parameters, extracting an actual characteristic quantity, and comparing the actual characteristic quantity with the pre-fitted characteristic quantity of the mapping model to obtain a characteristic deviation; and performing iterative adjustment on the conservative parameters according to the characteristic deviation to obtain optimized parameters, and applying the optimized parameters to the quantitative packing scale to be debugged. According to the method, automatic parameter adjustment of the quantitative packing scale is realized through establishment of the mapping model and automatic iterative optimization, the optimal weighing precision can be quickly achieved without manual intervention, and the debugging time is remarkably shortened.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to an automatic weighing method, apparatus, equipment, and storage medium. Background Technology

[0002] Quantitative packaging scales are widely used in the automatic weighing and packaging of materials in industries such as food, chemicals, and building materials. The weighing accuracy and efficiency of quantitative packaging scales mainly depend on the accurate setting of control parameters such as lead time and feed gate opening. Because different materials have significant differences in density and flowability, and because environmental factors such as silo pressure and temperature can affect the weighing process, the control parameters need to be adjusted according to the actual situation.

[0003] In existing technologies, the parameter setting methods for quantitative packaging scales typically employ fixed parameter configurations or simple linear interpolation methods. These methods cannot accurately describe the complex nonlinear relationship between material characteristics and control parameters, resulting in insufficient parameter setting accuracy. When material characteristics or environmental conditions change, fixed parameters cannot adaptively adjust, requiring parameter resetting. The debugging process often involves dozens or even hundreds of weighings to converge to suitable parameter values, leading to low debugging efficiency. Summary of the Invention

[0004] The main objective of this invention is to solve the technical problems of existing quantitative packaging scale parameter setting methods being unable to accurately describe the nonlinear relationship between characteristic quantities and control parameters, and having slow parameter adjustment convergence speed. This invention provides an automatic weighing adjustment method, the automatic weighing adjustment method comprising: Multi-material tests were performed on the quantitative packaging scale to collect multi-characteristic data, corresponding control parameters, and weighing errors. The multi-characteristic data and weighing errors were fitted to obtain a mapping model between the characteristic quantities and control parameters. Obtain the current characteristic data of the quantitative packaging scale to be debugged, input the current characteristic data into the mapping model, and generate conservative parameters; The quantitative packaging scale to be debugged is controlled to operate according to the conservative parameters, the actual feature quantity is extracted, and the actual feature quantity is compared with the feature quantity prefitted by the mapping model to obtain the feature deviation; Based on the characteristic deviation, the conservative parameters are iteratively adjusted to obtain optimized parameters, and the optimized parameters are applied to the quantitative packaging scale to be debugged.

[0005] The present invention also provides an automatic weighing device, the automatic weighing device comprising: The modeling module is used to perform multi-material tests on the quantitative packaging scale, collect multi-feature data and corresponding control parameters and weighing errors, fit the multi-feature data and weighing errors, and obtain a mapping model between the feature quantities and control parameters. The parameter generation module is used to obtain the current characteristic data of the quantitative packaging scale to be debugged, input the current characteristic data into the mapping model, and generate conservative parameters. The deviation calculation module is used to control the quantitative packaging scale to be debugged to operate according to the conservative parameters, extract the actual feature quantity, compare the actual feature quantity with the feature quantity prefitted by the mapping model, and obtain the feature deviation. The parameter optimization module is used to iteratively adjust the conservative parameters based on the characteristic deviation to obtain optimized parameters, and then apply the optimized parameters to the quantitative packaging scale to be debugged.

[0006] The present invention also provides an automatic weighing device, comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; the at least one processor invokes the instructions in the memory to cause the automatic weighing device to perform the steps of the above-described automatic weighing method.

[0007] The present invention also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the steps of the above-described automatic weighing method.

[0008] The aforementioned automatic weighing adjustment method, device, equipment, and storage medium, through multi-material testing of the quantitative packaging scale, collects multi-feature data and corresponding control parameters and weighing errors, and obtains a mapping model through fitting; acquires the current feature data of the quantitative packaging scale to be adjusted, inputs it into the mapping model to generate conservative parameters; controls the quantitative packaging scale to be adjusted to operate according to the conservative parameters, extracts the actual feature quantities, compares them with the feature quantities prefitted by the mapping model to obtain the feature deviation; iteratively adjusts the conservative parameters based on the feature deviation to obtain optimized parameters, which are then applied to the quantitative packaging scale to be adjusted. This invention, through the establishment of a mapping model and automatic iterative optimization, realizes automatic parameter adjustment of the quantitative packaging scale, quickly achieving optimal weighing accuracy without manual intervention, and significantly shortening the adjustment time.

[0009] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0010] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0011] Figure 1This is a schematic diagram of the first embodiment of the automatic weighing method in this invention; Figure 2 This is a schematic diagram of a second embodiment of the automatic weighing method in this invention; Figure 3 This is a schematic diagram of one embodiment of the automatic weighing device in this invention; Figure 4 This is a schematic diagram of one embodiment of the automatic weighing device in this invention. Detailed Implementation

[0012] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0013] The terms "comprising" and "having," and any variations thereof, used in the embodiments of this invention are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.

[0014] To facilitate understanding of this embodiment, a detailed description of an automatic weighing method disclosed in this invention will be provided first. For example... Figure 1 As shown, this method includes the following steps: 101. Perform multi-material tests on the quantitative packaging scale, collect multi-characteristic data and corresponding control parameters and weighing errors, fit the multi-characteristic data and weighing errors to obtain a mapping model between the characteristic quantities and control parameters; In this embodiment, the step of performing multi-material testing on the quantitative packaging scale, collecting multi-feature data and corresponding control parameters and weighing errors, and fitting the multi-feature data and weighing errors to obtain a mapping model between the feature quantities and control parameters includes: performing multi-material testing on the quantitative packaging scale, collecting feature data including material density, target weight, and silo pressure, as well as corresponding control parameters such as lead time and feed gate opening, and weighing errors; fitting the feature data and weighing errors, using a probabilistic regression method to establish a covariance function and optimize hyperparameters to obtain a mapping model containing a prediction mean function and a prediction variance function.

[0015] Specifically, when conducting multi-material testing, multiple materials with significant differences in density, flowability, and other properties are selected for testing, such as at least three types of materials including granular materials, powdered materials, and lumpy materials. For each material, weighing tests are conducted at different target weights, covering the full range of the quantitative packaging scale, for example, multiple target weight points evenly distributed between 1 kg and 50 kg. At each target weight, multiple weighing operations are performed by adjusting control parameters such as lead time and feed gate opening, and the difference between the actual weighed value and the target weight is recorded as the weighing error. During data acquisition, the material density is obtained through pre-measurement, the target weight is the set target value, and the silo pressure is collected in real time by a pressure sensor, while the corresponding lead time and feed gate opening values ​​are also recorded. Through the above tests, a sample dataset containing multiple sets of characteristic data, control parameters, and weighing errors is obtained.

[0016] After obtaining the sample dataset, Gaussian process regression was used to fit the data. Gaussian process regression is a regression method based on probability theory, the core of which is to describe the correlation between different input data points by defining a covariance function. Using characteristic data such as material density, target weight, and silo pressure as the input vector, and weighing error as the output scalar, a probabilistic mapping relationship between input and output was established. This method not only provides the predicted value but also simultaneously indicates the uncertainty of the prediction.

[0017] The choice of covariance function directly affects the model performance. Considering the potential for smooth changes and periodic patterns between features and weighing errors, this embodiment uses a weighted combination of a smoothing kernel function and a periodic kernel function as the covariance function. The smoothing kernel function captures the smooth, continuous relationship between features, employing a radial basis function and determining the correlation by calculating the distance between two input points. The periodic kernel function captures any possible periodic patterns. The final covariance function is obtained by adding the two kernel functions.

[0018] The covariance function contains several hyperparameters that need to be determined, including signal variance, length scale parameter, and periodicity parameter. First, these hyperparameters are initialized; for example, the signal variance is initialized to the variance of the sample weighing error, and the length scale is initialized to one-tenth of the range of the input features. Hyperparameter optimization employs the method of maximizing the log-marginal likelihood function. The log-marginal likelihood function reflects how well the model fits the observed data given the hyperparameters; this function comprehensively considers the model's fitting error and model complexity.

[0019] Iterative optimization is performed using the gradient ascent method. In each iteration, the covariance matrix is ​​calculated based on the current hyperparameter values, and then the value of the log-marginal likelihood function and its gradient with respect to each hyperparameter are calculated. The gradient indicates the direction of the fastest growth of the function value, and the hyperparameters are updated along the gradient direction. Specifically, each hyperparameter is added to its corresponding gradient multiplied by the learning rate to obtain the updated hyperparameters. The iterative process continues until the change in the log-marginal likelihood function is less than a preset convergence threshold or the maximum number of iterations is reached, yielding the optimized hyperparameters.

[0020] After obtaining the optimized hyperparameters, they are substituted into the covariance function, and the covariance matrix is ​​calculated using the sample data. The covariance matrix is ​​a square matrix with the number of rows and columns equal to the number of samples. Each element in the matrix represents the covariance value between two corresponding samples. After calculating the covariance matrix, its inverse matrix is ​​calculated, which will be used in subsequent predictions. To avoid numerical instability, a small positive value is added to the diagonal elements of the matrix as a numerical stabilizing term.

[0021] Based on the above calculations, the prediction mean function and prediction variance function of the mapping model are obtained. For a new input feature, the prediction mean function gives the expected value of the measurement error, while the prediction variance function quantifies the uncertainty of the prediction. The larger the prediction variance value, the lower the confidence of the model in predicting that input point. For example, when the input feature is within the range covered by the training samples, the prediction variance is small, and the model prediction is more reliable; when the input feature deviates from the range of the training samples, the prediction variance is large, indicating higher prediction uncertainty.

[0022] Furthermore, the step of fitting the feature data and weighing error, establishing a covariance function and optimizing hyperparameters using a probabilistic regression method to obtain a mapping model containing a prediction mean function and a prediction variance function includes: using the feature data as an input vector and the weighing error as an output scalar; selecting a weighted combination of a smoothing kernel function and a periodic kernel function as the covariance function; and initializing the hyperparameters in the covariance function; constructing a log-marginal likelihood function based on the input vector and the output scalar; calculating the partial derivative of the log-marginal likelihood function with respect to the hyperparameters; iteratively updating the hyperparameters using the gradient ascent method to obtain optimized hyperparameters; and substituting the optimized hyperparameters into the covariance function, calculating the covariance matrix and its inverse matrix in conjunction with the input vector and the output scalar to obtain a mapping model containing a prediction mean function and a prediction variance function.

[0023] Specifically, when establishing the covariance function, the collected sample dataset is first organized. The three features—material density, target weight, and silo pressure—from each test are combined into an input vector, with the corresponding weighing error serving as the output scalar. For example, if in a test the material density is 800 kg / m³, the target weight is 10 kg, and the silo pressure is 5000 Pascals, with a corresponding weighing error of 20 g, then this set of data constitutes an input-output pair. After organizing all sample data in this way, a complete training dataset is formed.

[0024] When selecting the covariance function, considering the weighing characteristics of the quantitative packaging scale, a combination of a smoothing kernel function and a periodic kernel function is adopted. The smoothing kernel function uses a radial basis function, which measures the similarity between two input vectors by calculating the Euclidean distance between them; the closer the input points are, the stronger the correlation of their corresponding output values. Specifically, for any two input vectors, the sum of the squares of the differences between their corresponding components is first calculated, then the square root is taken to obtain the Euclidean distance. The square of the distance is then divided by the square of a negative twice the length scale parameter, and finally, the exponential function value is taken and multiplied by the signal variance to obtain the covariance value between the two input points. The periodic kernel function is used to capture any periodic patterns that may exist during the weighing process. Its calculation method is to first calculate the Euclidean distance between the input vectors, then divide by the period parameter and multiply by pi, take the sine function value, square it, multiply by -2, divide by the square of the length scale parameter, and finally take the exponential function value and multiply by the signal variance. The final covariance function is obtained by adding the calculation results of these two kernel functions.

[0025] The hyperparameters included in the covariance function need to be initialized. For the signal variance of the smoothing kernel function, it can be initialized based on the variance of all sample weighing errors. For example, if the variance of the sample weighing error is the square of 100 grams, then the signal variance is initialized to 100. The length scale parameter of the smoothing kernel function controls the smoothness of the function and can be initialized based on the numerical range of the input features. For example, if the target weight ranges from 1 kg to 50 kg, then the length scale is initialized to approximately 5 kg. Similarly, the signal variance of the periodic kernel function can be initialized to half of the sample variance, and the period parameter can be set empirically, for example, to 10 kg. The length scale parameter of the periodic kernel function can be initialized to approximately 1 kg. These initial values ​​are only used as a starting point for optimization and will be adjusted subsequently through the optimization algorithm.

[0026] After initializing the hyperparameters, a log-marginal likelihood function is constructed. This function, based on Bayesian theory, is used to evaluate the goodness of fit of the model to the observed data given the hyperparameters. During construction, the covariance matrix is ​​first calculated based on the current hyperparameter values ​​and the input vector; the size of this matrix is ​​equal to the number of samples multiplied by the number of samples. Then, the vector of output scalars is operated on with the inverse of the covariance matrix to obtain the data fit term. Next, the logarithm of the determinant of the covariance matrix is ​​calculated to obtain the complexity penalty term. Finally, a constant term related to the number of samples is added. A larger value for the log-marginal likelihood function indicates a better model under the current hyperparameters.

[0027] To find the hyperparameter combination that maximizes the log-marginal likelihood function, gradient ascent is used for optimization. This method is an iterative optimization algorithm that updates parameters along the direction of fastest function growth in each iteration. First, the partial derivatives of the log-marginal likelihood function with respect to each hyperparameter are calculated, i.e., the gradients. Since the expression of the log-marginal likelihood function involves matrix operations and logarithmic operations, its gradient calculation requires the application of matrix differentiation and the chain rule. For the gradient of the signal variance, the derivative of the covariance matrix with respect to the signal variance is calculated, and then combined with the derivative of the log-marginal likelihood function with respect to the covariance matrix. The gradient calculations for the length scale parameter and the periodic parameter are similar. After obtaining the gradients of all hyperparameters, the current value of each hyperparameter is added to its gradient multiplied by the learning rate to obtain the updated hyperparameters. The learning rate is a small positive number, typically set between 0.01 and 0.1, used to control the step size of each update.

[0028] The iterative update process continues. In each iteration, the covariance matrix and log-marginal likelihood function values ​​are recalculated using the updated hyperparameters, and a new gradient is calculated for the next round of updates. To determine if optimization is complete, the change in the log-marginal likelihood function value is calculated after each iteration. If the absolute value of this change is less than a preset convergence threshold, such as 0.0001, the function value is considered to have converged, and the iteration stops. Alternatively, iteration also stops if the number of iterations reaches a preset maximum value, such as 500. The hyperparameters obtained at this point are the optimized hyperparameters. It should be noted that during the optimization process, to avoid the hyperparameters taking unreasonable values, constraints are usually set on the hyperparameters, such as requiring all variance and length scale parameters to be greater than zero.

[0029] After obtaining the optimized hyperparameters, these parameters are substituted into the covariance function, at which point the form of the covariance function is completely determined. Then, using this covariance function and the input vectors of all training samples, the complete covariance matrix is ​​calculated. The element in the i-th row and j-th column of this matrix represents the covariance value between the i-th and j-th sample inputs. Since the covariance function is symmetric, the covariance matrix is ​​also a symmetric matrix. After calculating the covariance matrix, its inverse matrix is ​​further calculated. The inverse matrix can be calculated using numerical methods such as Cholsky decomposition or LU decomposition. In practical calculations, to enhance numerical stability, a small positive number, such as 0.00001, is added to the diagonal of the covariance matrix, which is equivalent to assuming the existence of a small amount of observation noise.

[0030] 102. Obtain the current characteristic data of the quantitative packaging scale to be debugged, input the current characteristic data into the mapping model, and generate conservative parameters; In this embodiment, the step of acquiring the current characteristic data of the quantitative packaging scale to be debugged and inputting the current characteristic data into the mapping model to generate conservative parameters includes: acquiring the material density, target weighing weight, and silo pressure parameters of the quantitative packaging scale to be debugged; forming a current feature vector from the material density, target weighing weight, and silo pressure parameters; substituting the current feature vector into the prediction mean function of the mapping model to calculate the predicted mean of the control parameters; substituting the current feature vector into the prediction variance function of the mapping model to calculate the predicted variance of the control parameters; determining a conservative coefficient based on the comparison result between the variance value and a preset variance threshold; setting a first conservative coefficient when the variance value is greater than the preset variance threshold, and setting a second conservative coefficient less than the first conservative coefficient when the variance value is less than or equal to the preset variance threshold; calculating the product of the square root of the variance value and the conservative coefficient to obtain a safety margin; adding the predicted mean to the safety margin to obtain conservative parameters including advance amount and feed gate opening.

[0031] Specifically, when the quantitative packaging scale to be debugged arrives at the site and is ready for use, it is first necessary to obtain the current operating environment of the equipment and the characteristic data of the material to be weighed. Material density can be obtained through on-site sampling and measurement. Specifically, a certain volume of material sample is taken, its mass is weighed, and the density value is calculated. For example, if the sample volume is 1 cubic decimeter and the weighing mass is 0.8 kilograms, then the material density is 800 kilograms per cubic meter. The target weighing weight is set by the user according to production needs. For example, if 10 kilograms of quantitative packaging is required, the target weighing weight is set to 10 kilograms. The silo pressure parameter is read in real time by a pressure sensor installed on the material storage silo. The sensor converts the pressure signal inside the silo into an electrical signal, which is then processed by a signal conditioning circuit and output as a digital value. For example, the current silo pressure is 4500 Pascals. The obtained material density, target weighing weight, and silo pressure parameters are arranged in a fixed order to form the current feature vector. The dimension of this vector is consistent with the dimension of the input vector used when establishing the mapping model.

[0032] After obtaining the current feature vector, it is input into the mapping model established in step 101 for prediction calculation. First, the current feature vector is substituted into the prediction mean function for calculation. The calculation of the prediction mean function requires the inverse of the covariance matrix, the output vectors of the training samples, and the covariance function stored during modeling. Specifically, the covariance function is first used to calculate the covariance value between the current feature vector and each training sample input vector, and these covariance values ​​are arranged in order to form a covariance vector. The length of this covariance vector is equal to the number of training samples. Then, the covariance vector is multiplied by the inverse of the covariance matrix to obtain an intermediate vector. This intermediate vector is then multiplied by the output vectors of the training samples to obtain the final prediction mean. This prediction mean represents the expected value of the weighing error predicted by the model under the current feature quantity conditions.

[0033] Simultaneously, it is necessary to calculate the prediction variance to quantify the uncertainty of the prediction. The calculation of the prediction variance function first requires obtaining the covariance value of the current eigenvector itself, that is, using the current eigenvector as two input parameters for the covariance function. Then, the matrix multiplication result of the covariance vector and the inverse of the covariance matrix is ​​calculated, and this result is then multiplied by the transpose of the covariance vector to obtain a correction term. Finally, this correction term is subtracted from the covariance value of the current eigenvector itself to obtain the prediction variance. The magnitude of the prediction variance directly reflects the model's confidence in the prediction of the current input; a larger variance value indicates greater uncertainty in the model's prediction of that point.

[0034] After obtaining the predicted mean and predicted variance, a conservatism coefficient needs to be determined based on the magnitude of the predicted variance. The conservatism coefficient is set using an adaptive adjustment strategy, which dynamically adjusts the safety margin of the parameters according to the uncertainty of the model's predictions. First, a preset variance threshold is set as a criterion. This threshold can be determined based on historical experience or by analyzing the variance distribution of the training samples; for example, it can be set as the median or average of the predicted variance of the training samples. The currently calculated predicted variance value is compared with this preset variance threshold. If the predicted variance value is greater than the preset variance threshold, it indicates a significant difference between the current input feature quantity and the distribution of the training samples, resulting in high model prediction uncertainty. In this case, a larger conservatism coefficient is needed, denoted as the first conservatism coefficient, for example, 3. If the predicted variance value is less than or equal to the preset variance threshold, it indicates that the current input feature quantity is within the coverage of the training samples, and the model prediction is relatively reliable. In this case, a smaller conservatism coefficient is set, denoted as the second conservatism coefficient, for example, 1.5. This adaptive adjustment mechanism allows for a larger safety margin when prediction uncertainty is high, while avoiding excessive conservatism when prediction reliability is high.

[0035] After determining the conservatism coefficient, the safety margin is calculated. The safety margin is calculated by multiplying the square root of the predicted variance by the conservatism coefficient. The square root is used because the dimension of the predicted variance is the square of the weighing error; taking the square root converts it to the same dimension as the weighing error, making it easier to add to the predicted mean. For example, if the predicted variance is the square of 100 grams, its square root is 10 grams; if the conservatism coefficient is 2, then the safety margin is 20 grams. This safety margin represents the additional uncertainty range that needs to be considered beyond the predicted mean.

[0036] Finally, the predicted mean is added to the safety margin to obtain the conservative parameter values. Since the mapping model predicts the weighing error, while the actual parameters to be set are control parameters, a conversion based on the relationship between the control parameters and the weighing error is necessary. Specifically, if the predicted mean is positive, it indicates that the weighing will be too large under the current characteristic value, requiring a reduction in the lead time or a decrease in the feed gate opening; if the predicted mean is negative, it indicates that the weighing will be too small, requiring an increase in the lead time or an increase in the feed gate opening. After adding the safety margin to the predicted mean, the specific values ​​of the lead time and feed gate opening are calculated according to the preset conversion relationship; these values ​​constitute the conservative parameters.

[0037] 103. Control the quantitative packaging scale to be debugged to operate according to the conservative parameters, extract the actual feature quantity, and compare the actual feature quantity with the feature quantity prefitted by the mapping model to obtain the feature deviation; In this embodiment, controlling the quantitative packaging scale to be debugged to operate according to the conservative parameters, extracting actual feature quantities, and comparing the actual feature quantities with the feature quantities prefitted by the mapping model to obtain feature deviation includes: sending the advance amount and feeding gate opening in the conservative parameters to the quantitative packaging scale to be debugged, controlling the quantitative packaging scale to be debugged to perform weighing operations, and collecting actual weighing error, actual material flow rate, and actual feeding response time during the weighing process to form actual feature quantities; inputting the current feature vector into the mapping model to calculate predicted weighing error, predicted material flow rate, and predicted feeding response time to form predicted feature quantities; calculating the deviation values ​​of corresponding items in the actual feature quantities and the predicted feature quantities respectively, and calculating the distance metric between the actual feature quantities and the predicted feature quantities to obtain feature deviation including sub-item deviation values ​​and overall metric values.

[0038] Specifically, after generating the conservative parameters, these parameters need to be applied to the controller of the quantitative packaging scale to be debugged for actual weighing verification. Parameter transmission is achieved through a communication interface. After receiving the lead time and feeding gate opening parameters, the controller stores them in the corresponding parameter registers. For example, if the conservative parameters include a lead time of 150 milliseconds and a feeding gate opening of 60 degrees, the controller writes these two values ​​into the lead time register and the feeding gate opening register, respectively. After the parameters are transmitted, a complete weighing operation process is initiated, including steps such as opening the feeding gate, material falling, prematurely closing the feeding gate, the material continuing to fall into the weighing hopper, and the weighing sensor collecting weight data.

[0039] During the weighing process, multiple characteristic data points need to be collected in real time to comprehensively reflect the equipment's operating status. The actual weighing error is obtained through a load cell. The load cell outputs a weight signal after the material has stabilized. This signal value is compared with the target weight to obtain the actual weighing error. For example, if the target weight is 10 kg and the actual weighing value is 10.025 kg, the actual weighing error is 25 g. The actual material flow rate is collected using a flow sensor or by analyzing the rate of change of the weight signal. Specifically, during the feeding process, a weight value is collected at fixed time intervals. The difference between two adjacent weight measurements is calculated and divided by the time interval to obtain the instantaneous material flow rate. The average material flow rate is then obtained by averaging multiple instantaneous flow rate values. For example, if the weight increases by 200 g within 100 milliseconds, the material flow rate during that period is 2 kg per second. The actual feeding response time refers to the time delay from when the controller issues a command to close the feeding gate to when the feeding gate actually closes. This time can be obtained by installing a position sensor on the feeding gate or by analyzing the characteristics of weight signal changes. For example, when the weighing value reaches 9.85 kg, the controller issues a shut-off command. By recording the time the command is issued and the actual closing time of the feeding gate, the feeding response time is calculated to be 45 milliseconds. The actual weighing error, actual material flow rate, and actual feeding response time collected above are arranged in a fixed order to form an actual characteristic vector.

[0040] Simultaneously, the mapping model needs to be used to calculate the predicted feature quantities under the current characteristic conditions. The current feature vector used in step 102, i.e., the vector containing material density, target weight, and silo pressure, is input back into the mapping model. Since the mapping model is trained with weighing error as the output during its establishment, the predicted weighing error can be obtained directly through the predicted mean function. For predicting material flow rate and predicted feeding response time, this can be achieved by extending the mapping model. Specifically, during the modeling phase, material flow rate and feeding response time are recorded as additional outputs, and prediction functions are established for these two outputs respectively, or estimations are made based on the empirical relationship between weighing error and these two parameters. For example, a relationship model between weighing error and material flow rate can be established based on factory test data, and the predicted material flow rate can be inferred by predicting the weighing error. The predicted weighing error, predicted material flow rate, and predicted feeding response time are combined to form a predicted feature quantity vector, the dimension of which is consistent with the actual feature quantity vector.

[0041] After obtaining the actual and predicted feature quantities, a comparison is performed to calculate the feature deviation. First, the component deviation value is calculated, which is the difference between the corresponding items in the actual and predicted feature quantities. For example, if the actual weighing error is 25 grams and the predicted weighing error is 20 grams, then the component deviation value for the weighing error is 5 grams. Similarly, the component deviation values ​​for material flow rate and feeding response time are calculated. These component deviation values ​​reflect the prediction errors of the model in different dimensions. In addition to the component deviation values, an overall metric is also needed to comprehensively assess the overall degree of deviation. The overall metric is calculated using the Euclidean distance method, which involves squaring the differences between the corresponding components of the actual and predicted feature vectors, summing them, and then taking the square root. For example, if the weighing error deviation is 5 grams, the material flow rate deviation is 0.1 kg / s, and the feeding response time deviation is 3 milliseconds, to ensure comparability across dimensions, each deviation value is first normalized by dividing it by its respective feature scale, and then the square root of the sum of the squares of the normalized deviations is calculated to obtain the overall metric. The larger the overall metric, the greater the deviation between the actual operating state and the model prediction. The component deviations and the overall metric are combined to form the characteristic deviation, which will be used in the subsequent parameter optimization and adjustment process.

[0042] 104. Based on the characteristic deviation, the conservative parameters are iteratively adjusted to obtain optimized parameters, and the optimized parameters are applied to the quantitative packaging scale to be debugged.

[0043] In this embodiment, in each iteration, the adjustment direction of the current parameter is first determined based on the magnitude and direction of the characteristic deviation. If the actual weighing error is positive, it indicates that the actual weighing result is greater than the target weight, meaning that too much material has been added. In this case, the lead time needs to be reduced or the feeding gate opening needs to be lowered. If the actual weighing error is negative, it indicates that the actual weighing result is less than the target weight, meaning that insufficient material has been added. In this case, the lead time needs to be increased or the feeding gate opening needs to be raised. The magnitude of the parameter adjustment is related to the magnitude of the characteristic deviation; the larger the deviation, the larger the adjustment magnitude.

[0044] After determining the direction and magnitude of the adjustment, the current conservative parameters are updated. For example, if the current lead time is 150 milliseconds and the characteristic deviation shows a weighing error of +25 grams, the lead time can be increased by 10 milliseconds to 160 milliseconds. Simultaneously, the feeding gate opening is adjusted accordingly based on the deviations in material flow rate and feeding response time. The updated parameters are then sent back to the quantitative packaging scale for a new round of weighing operations, collecting new actual characteristic quantities and comparing them with the predicted characteristic quantities to obtain the new characteristic deviation.

[0045] The iterative process continues, with each iteration adjusting the parameters and biases based on the previous iteration. As the number of iterations increases, the feature bias gradually decreases, and the parameters progressively approach their optimal values. To evaluate whether the iteration is complete, convergence criteria are set. Common convergence criteria include the overall metric of feature bias being less than a preset threshold, such as being less than a set allowable error range, or the parameter change being less than a preset minimum change in multiple consecutive iterations. Furthermore, to avoid over-iteration, a maximum iteration limit is set, such as 20 iterations. When the convergence criteria are met or the maximum number of iterations is reached, the iteration process stops, and the current parameters are used as the optimization parameters.

[0046] After obtaining the optimized parameters, they were formally applied to the quantitative packaging scale to be debugged. Specifically, the optimized lead time and feed gate opening were written into the controller's parameter storage area and set as the default parameter configuration. Subsequently, the quantitative packaging scale will use this set of optimized parameters for weighing operations during normal production. It should be noted that because material characteristics or environmental conditions may change, the optimized parameters are not static and can be fine-tuned based on actual weighing results during subsequent operation. Through the above iterative adjustment process, the automatic conversion from conservative parameters to optimized parameters was achieved, completing the automatic debugging of the quantitative packaging scale.

[0047] In this embodiment, multi-material testing is performed on the quantitative packaging scale to collect multi-feature data, corresponding control parameters, and weighing errors. A mapping model is obtained through fitting. The current feature data of the quantitative packaging scale to be debugged is acquired and input into the mapping model to generate conservative parameters. The quantitative packaging scale to be debugged is controlled to operate according to the conservative parameters, and the actual feature quantities are extracted and compared with the feature quantities prefitted by the mapping model to obtain the feature deviation. The conservative parameters are iteratively adjusted according to the feature deviation to obtain optimized parameters, which are then applied to the quantitative packaging scale to be debugged. This invention achieves automatic parameter adjustment of the quantitative packaging scale by establishing a mapping model and automatic iterative optimization, quickly achieving optimal weighing accuracy without manual intervention and significantly shortening the debugging time.

[0048] Please see Figure 2 Another embodiment of the automatic weighing method in this application includes: 201. Perform multi-material testing on the quantitative packaging scale, collect multi-characteristic data and corresponding control parameters and weighing errors, fit the multi-characteristic data and weighing errors to obtain a mapping model between the characteristic quantities and control parameters; 202. Obtain the current characteristic data of the quantitative packaging scale to be debugged, input the current characteristic data into the mapping model, and generate conservative parameters; 203. Control the quantitative packaging scale to be debugged to operate according to the conservative parameters, extract the actual feature quantity, and compare the actual feature quantity with the feature quantity prefitted by the mapping model to obtain the feature deviation; In this embodiment, steps 201-203 are similar to steps 101-103 in the first embodiment, and will not be described again here.

[0049] 204. Construct a performance evaluation function based on the aforementioned characteristic deviation, wherein the performance evaluation function includes a weighing accuracy evaluation term, a weighing speed evaluation term, and a parameter stability evaluation term; In this embodiment, the step of constructing a performance evaluation function based on the characteristic deviation, wherein the performance evaluation function includes a weighing accuracy evaluation term, a weighing speed evaluation term, and a parameter stability evaluation term, includes: calculating a weighing accuracy evaluation term based on the deviation between the actual weighing error and the predicted weighing error in the characteristic deviation; calculating a weighing speed evaluation term based on the actual feeding response time in the characteristic deviation; calculating a parameter stability evaluation term based on the adjustment range of the conservative parameter; and performing a weighted summation of the weighing accuracy evaluation term, the weighing speed evaluation term, and the parameter stability evaluation term to obtain the performance evaluation function.

[0050] Specifically, the purpose of constructing the performance evaluation function is to comprehensively evaluate the overall performance of the quantitative packaging scale under the current parameter configuration. By quantifying different performance indicators and assigning corresponding weights, it provides clear optimization targets for subsequent parameter optimization. This function needs to consider three aspects simultaneously: weighing accuracy, working efficiency, and operational stability, avoiding the pursuit of a single indicator while neglecting other important factors.

[0051] The weighing accuracy evaluation term is calculated based on the deviation between the actual weighing error and the predicted weighing error. The deviation between the actual and predicted weighing errors is extracted from the feature deviations obtained in step 103. This deviation reflects the degree to which the actual operating state deviates from the model's expectations. To amplify the impact of the error on the evaluation function, a squared form is used for calculation. Specifically, the deviation between the actual and predicted weighing errors is squared to obtain the original value of the weighing accuracy evaluation term. For example, if the actual weighing error is 25 grams and the predicted weighing error is 20 grams, the deviation is 5 grams, which squares to obtain the square of 25 grams. The advantage of using the squared form is that larger deviations receive a larger penalty weight, prompting the optimization process to focus more on reducing larger errors. Furthermore, the squared operation can eliminate the directional influence of positive and negative deviations, unifying the measurement of the deviation magnitude. To ensure the evaluation term has a reasonable numerical range, normalization is also required. The squared value is divided by a standardization coefficient, which can be set as the square of the target weighing weight, making the evaluation term a dimensionless relative value.

[0052] The weighing speed evaluation item is measured by the actual feeding response time. A longer feeding response time indicates a slower feeding process and a longer overall weighing cycle. The actual feeding response time is extracted from the characteristic deviation; for example, the actual feeding response time is 45 milliseconds. To reflect the impact of speed on performance, the actual feeding response time is compared with a set target response time. The target response time is a pre-set expected value based on production needs and equipment characteristics, for example, set to 40 milliseconds. The difference between the actual feeding response time and the target response time is calculated. If the actual value is 45 milliseconds and the target value is 40 milliseconds, the difference is 5 milliseconds. This difference is squared to obtain the square of 25 milliseconds. Similarly, to make this item comparable, normalization is required. The squared value is divided by the square of the target response time to obtain the normalized weighing speed evaluation item. It should be noted that if the actual feeding response time is less than the target response time, it indicates that the speed performance is better than expected. In this case, the difference is negative, and the squared value is still positive, but a negative weighting coefficient can be given in subsequent weighting to make it contribute positively to the overall evaluation function.

[0053] The parameter stability evaluation term is calculated based on the adjustment range of conservative parameters. The parameter values ​​in the current iteration are compared with those in the previous iteration, and the adjustment amounts for lead time and feed gate opening are calculated. For example, if the lead time in the previous iteration was 150 milliseconds, and it is adjusted to 160 milliseconds in the current iteration, then the lead time adjustment is 10 milliseconds. Similarly, the adjustment amount for the feed gate opening is calculated; for example, from 60 degrees to 62 degrees, the adjustment amount is 2 degrees. To comprehensively evaluate the adjustment range of the two parameters, a sum of squares is used. First, the lead time adjustment is normalized by dividing it by the typical range of lead time variation. For example, if the typical range is set to 50 milliseconds, then the normalized lead time adjustment is 0.2. Similarly, the feed gate opening adjustment is normalized; for example, if the typical range is 20 degrees, then the normalized opening adjustment is 0.1. The two normalized values ​​are squared and summed to obtain the parameter stability evaluation term. The larger the value of this term, the greater the parameter adjustment range and the worse the stability.

[0054] Finally, the three evaluation items are weighted and summed to obtain the performance evaluation function. Weighted summation allows for adjusting the importance of different performance indicators according to actual application requirements. Each evaluation item is assigned a weight coefficient, with values ​​ranging from 0 to 1.

[0055] 205. Using the conservative parameter as the current parameter, calculate the gradient of the performance evaluation function with respect to the current parameter, and calculate the parameter adjustment amount based on the gradient and the preset learning rate; In this embodiment, after constructing the performance evaluation function, an optimization algorithm is needed to find the parameter configuration that minimizes the function value. First, the conservative parameter generated in step 102 is used as the starting point of the optimization process, i.e., the current parameter. This current parameter includes two components: lead time and feed gate opening. For example, the lead time is 150 milliseconds, and the feed gate opening is 60 degrees.

[0056] Calculating the gradient of the performance evaluation function with respect to the current parameters is a core step in the optimization process. The gradient is a vector, where each component represents the partial derivative of the performance evaluation function with respect to the corresponding parameter, indicating the rate of change of the function value in that parameter direction. Since the performance evaluation function contains a weighted sum of three evaluation terms, and each term is related to the parameter, it is necessary to calculate the derivative of each term with respect to the parameter separately. Specifically, for the lead time parameter, the partial derivative of the performance evaluation function with respect to the lead time needs to be calculated. Because both the weighing accuracy evaluation term and the parameter stability evaluation term are related to the lead time, the chain rule of differentiation needs to be applied. For example, the weighing accuracy evaluation term includes the square of the deviation value, which is related to the actual weighing error, and the actual weighing error is affected by the lead time; therefore, it is necessary to differentiate layer by layer and multiply them. In actual calculations, a numerical differentiation method can be used, i.e., a small perturbation is made to the lead time, such as adding 1 millisecond, the performance evaluation function value is recalculated, and the difference between the new value and the original value is divided by the perturbation amount to obtain the approximate derivative at that point. The same method is used to calculate the partial derivative of the performance evaluation function with respect to the opening of the feeding gate, and the two partial derivatives are combined to form a gradient vector.

[0057] After obtaining the gradient vector, the parameter adjustment is calculated based on the gradient and a preset learning rate. The learning rate is a pre-set positive number that controls the step size of each parameter update, typically set between 0.01 and 0.5. The choice of learning rate requires a trade-off between convergence speed and stability; a larger learning rate leads to faster convergence but may cause oscillations, while a smaller learning rate is stable but leads to slower convergence. The parameter adjustment is calculated using the update rule of gradient descent, which involves multiplying the gradient vector by a negative learning rate. The negative sign is used because the gradient points in the direction of function increase, while the optimization objective is to decrease the function value; therefore, adjustment is needed along the negative gradient direction. For example, if the gradient in the lead direction is 2 grams per millisecond and the learning rate is 0.1, then the lead adjustment is -0.2 milliseconds. This is similar to calculating the adjustment for the opening of the feeding gate. The calculated parameter adjustments are combined into an adjustment vector for the next parameter update.

[0058] 206. Update the current parameters according to the parameter adjustment amount, apply the updated parameters to the quantitative packaging scale to be debugged for weighing verification, and calculate the updated performance evaluation function value; In this embodiment, after calculating the parameter adjustment amount, the current parameters are updated. The parameter update uses addition, adding the corresponding adjustment amount to each component of the current parameter. For example, if the current lead time is 150 milliseconds and the adjustment amount is -0.2 milliseconds, the updated lead time is 149.8 milliseconds. Similarly, the feeding gate opening is updated; if the current opening is 60 degrees and the adjustment amount is +0.15 degrees, the updated opening is 60.15 degrees. The updated parameters need to undergo a reasonableness check to ensure that the parameter values ​​are within the allowable range. For example, the lead time should be between 50 milliseconds and 500 milliseconds, and the feeding gate opening should be between 10 degrees and 90 degrees. If the updated parameters exceed the range, they are truncated to the boundary values.

[0059] The updated parameters are applied to the quantitative packaging scale to be debugged for weighing verification. The specific operation is similar to step 103: the updated lead time and feeding gate opening are sent to the controller of the quantitative packaging scale via the communication interface. After receiving the parameters, the controller initiates a complete weighing operation. During the weighing process, data such as the actual weighing error, actual material flow rate, and actual feeding response time are collected to form new actual characteristic quantities. The current characteristic vector is input into the mapping model to obtain the predicted characteristic quantity, and the deviation between the actual characteristic quantity and the predicted characteristic quantity is calculated to obtain the new characteristic deviation.

[0060] Based on the new characteristic deviation, the performance evaluation function value is recalculated. Following the method in step 204, the weighing accuracy evaluation item, weighing speed evaluation item, and parameter stability evaluation item are calculated separately. It is important to note that the calculation of the parameter stability evaluation item requires comparing the currently updated parameters with the parameters before this iteration to calculate the adjustment range. The three evaluation items are then weighted and summed according to preset weighting coefficients to obtain the updated performance evaluation function value. This function value reflects the comprehensive performance of the quantitative packaging scale under the new parameter configuration. By comparing the performance evaluation function values ​​before and after the update, it can be determined whether the parameter adjustment has improved the equipment performance. If the new function value is less than the original value, it indicates that the adjustment direction is correct and the parameters are approaching the optimal value.

[0061] 207. Repeat the gradient calculation, parameter update and weighing verification process. Stop the iteration when the performance evaluation function value meets the convergence condition, and use the final parameters as the optimization parameters.

[0062] In this embodiment, parameter optimization is an iterative process that requires repeating steps 205 and 206 until a preset convergence condition is met. In each iteration, the previously updated parameters are used as the new current parameters, the gradient of the performance evaluation function is recalculated, the new parameter adjustment amount is calculated based on the gradient, the parameters are updated, and a weighing verification is performed to obtain a new performance evaluation function value. This process is similar to continuously descending along the surface of the performance evaluation function to find the minimum point of the function.

[0063] To determine whether the iteration should stop, several convergence conditions are set. The first condition is that the change in the performance evaluation function value is less than a preset threshold. Specifically, the absolute value of the difference between the function value of the current iteration and the function value of the previous iteration is calculated. If this difference is less than the preset convergence threshold, for example, 0.001, the function value is considered to have stabilized, and further iterations will have limited improvement, thus satisfying the convergence condition. The second condition is that the magnitude of the parameter adjustment is less than a preset minimum adjustment threshold. If the calculated parameter adjustment is too small, for example, the lead time adjustment is less than 0.1 milliseconds and the feed gate opening adjustment is less than 0.05 degrees, it indicates that the parameters are close to their optimal values, and further adjustments are not meaningful. The third condition is that the actual weighing error has reached an acceptable accuracy range. For example, if the absolute value of the weighing error in three consecutive iterations is less than two-thousandths of the target weight, the accuracy requirement is considered met.

[0064] Furthermore, to prevent infinite iterations due to abnormal situations, a maximum iteration limit is set. For example, the maximum number of iterations is set to 15. If the number of iterations reaches this limit and other convergence conditions are not met, the iteration is forcibly stopped. In practical applications, a combination of multiple conditions is usually used to judge the iteration process; as long as any one of the convergence conditions is met, the iteration process can be stopped.

[0065] Once the convergence condition is met and iteration stops, the current parameters are used as the final optimized parameters. These optimized parameters, adjusted through multiple iterations, comprehensively consider weighing accuracy, weighing speed, and parameter stability, representing the optimal parameter configuration under the current material and environmental conditions. These optimized parameters are then formally written into the parameter storage area of ​​the quantitative packaging scale controller as standard parameters for subsequent production operations. Through this iterative optimization process, the automatic conversion from conservative to optimized parameters is achieved, completing the intelligent debugging of the quantitative packaging scale.

[0066] In this embodiment, multi-material testing is performed on the quantitative packaging scale to collect multi-feature data, corresponding control parameters, and weighing errors. A mapping model is obtained through fitting. The current feature data of the quantitative packaging scale to be debugged is acquired and input into the mapping model to generate conservative parameters. The quantitative packaging scale to be debugged is controlled to operate according to the conservative parameters, and the actual feature quantities are extracted and compared with the feature quantities prefitted by the mapping model to obtain the feature deviation. The conservative parameters are iteratively adjusted according to the feature deviation to obtain optimized parameters, which are then applied to the quantitative packaging scale to be debugged. This invention achieves automatic parameter adjustment of the quantitative packaging scale by establishing a mapping model and automatic iterative optimization, quickly achieving optimal weighing accuracy without manual intervention and significantly shortening the debugging time.

[0067] The automatic weighing method in the embodiments of the present invention has been described above. The automatic weighing device in the embodiments of the present invention will be described below. Please refer to [link to relevant documentation] for details on this automatic weighing device. Figure 3 One embodiment of the automatic weighing device in this invention includes: The modeling module 301 is used to perform multi-material testing on the quantitative packaging scale, collect multi-feature data and corresponding control parameters and weighing errors, fit the multi-feature data and weighing errors, and obtain a mapping model between the feature quantities and control parameters. The parameter generation module 302 is used to obtain the current characteristic data of the quantitative packaging scale to be debugged, input the current characteristic data into the mapping model, and generate conservative parameters. The deviation calculation module 303 is used to control the quantitative packaging scale to be debugged to operate according to the conservative parameters, extract the actual feature quantity, compare the actual feature quantity with the feature quantity prefitted by the mapping model, and obtain the feature deviation. The parameter optimization module 304 is used to iteratively adjust the conservative parameters according to the characteristic deviation to obtain optimized parameters, and apply the optimized parameters to the quantitative packaging scale to be debugged.

[0068] In this embodiment of the invention, the automatic weighing device operates the aforementioned automatic weighing method. The device performs multi-material testing on the quantitative packaging scale, collects multi-feature data and corresponding control parameters and weighing errors, and obtains a mapping model through fitting. It then acquires the current feature data of the quantitative packaging scale to be debugged, inputs it into the mapping model to generate conservative parameters, controls the scale to be debugged to operate according to the conservative parameters, extracts the actual feature quantities, compares them with the feature quantities pre-fitted by the mapping model to obtain feature deviations, and iteratively adjusts the conservative parameters based on the feature deviations to obtain optimized parameters, which are then applied to the quantitative packaging scale to be debugged. This invention, through the establishment of a mapping model and automatic iterative optimization, achieves automatic parameter adjustment of the quantitative packaging scale, quickly reaching optimal weighing accuracy without manual intervention, and significantly shortening the debugging time.

[0069] above Figure 3 The automatic weighing device in the embodiments of the present invention will be described in detail from the perspective of unitized functional entities. The automatic weighing device in the embodiments of the present invention will be described in detail from the perspective of hardware processing.

[0070] Figure 4This is a schematic diagram of an automatic weighing device 300 provided in an embodiment of the present invention. The automatic weighing device 300 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 410 (e.g., one or more processors) and a memory 420, and one or more storage media 430 (e.g., one or more mass storage devices) storing application programs 333 or data 432. The memory 420 and storage media 430 can be temporary or persistent storage. The program stored in the storage media 430 may include one or more units (not shown in the diagram), each unit may include a series of instruction operations on the automatic weighing device 400. Furthermore, the processor 410 may be configured to communicate with the storage media 430 and execute the series of instruction operations in the storage media 430 on the automatic weighing device 400 to implement the steps of the above-described automatic weighing method.

[0071] The automatic weighing device 400 may also include one or more power supplies 440, one or more wired or wireless network interfaces 450, one or more input / output interfaces 460, and / or one or more operating systems 431, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 4 The illustrated automatic weighing device structure does not constitute a limitation on the automatic weighing device provided by the present invention. It may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.

[0072] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the automatic weighing method.

[0073] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0074] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0075] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An automatic weighing method, characterized in that, The automatic weighing method includes: Multi-material tests were performed on the quantitative packaging scale to collect multi-characteristic data, corresponding control parameters, and weighing errors. The multi-characteristic data and weighing errors were fitted to obtain a mapping model between the characteristic quantities and control parameters. Obtain the current characteristic data of the quantitative packaging scale to be debugged, input the current characteristic data into the mapping model, and generate conservative parameters; The quantitative packaging scale to be debugged is controlled to operate according to the conservative parameters, the actual feature quantity is extracted, and the actual feature quantity is compared with the feature quantity prefitted by the mapping model to obtain the feature deviation; Based on the characteristic deviation, the conservative parameters are iteratively adjusted to obtain optimized parameters, and the optimized parameters are applied to the quantitative packaging scale to be debugged.

2. The automatic weighing method according to claim 1, characterized in that, The process of performing multi-material testing on the quantitative packaging scale, collecting multi-characteristic data and corresponding control parameters and weighing errors, and fitting the multi-characteristic data and weighing errors to obtain a mapping model between the characteristic quantities and control parameters includes: Multi-material tests were conducted on the quantitative packaging scale to collect characteristic data including material density, target weight, silo pressure, as well as corresponding control parameters such as lead time, feeding gate opening, and weighing error. The feature data and weighing error are fitted together, and a covariance function is established and the hyperparameters are optimized using a probabilistic regression method to obtain a mapping model that includes a prediction mean function and a prediction variance function.

3. The automatic weighing method according to claim 2, characterized in that, The step of fitting the feature data and weighing error, establishing a covariance function using a probabilistic regression method, and optimizing the hyperparameters to obtain a mapping model containing a prediction mean function and a prediction variance function includes: The feature data is used as the input vector and the weighing error is used as the output scalar. A weighted combination of the smoothing kernel function and the periodic kernel function is selected as the covariance function, and the hyperparameters in the covariance function are initialized. A log-marginal likelihood function is constructed based on the input vector and the output scalar. The partial derivative of the log-marginal likelihood function with respect to the hyperparameters is calculated. The hyperparameters are iteratively updated using the gradient ascent method to obtain the optimized hyperparameters. Substituting the optimized hyperparameters into the covariance function, and combining the input vector and output scalar, the covariance matrix and inverse matrix are calculated to obtain a mapping model containing the prediction mean function and the prediction variance function.

4. The automatic weighing method according to claim 1, characterized in that, The process of acquiring the current characteristic data of the quantitative packaging scale to be debugged, and inputting the current characteristic data into the mapping model to generate conservative parameters includes: Obtain the material density, target weighing weight, and silo pressure parameters of the quantitative packaging scale to be debugged, and combine the material density, target weighing weight, and silo pressure parameters into a current feature vector; The predicted mean of the control parameters is calculated by substituting the current feature vector into the prediction mean function of the mapping model, and the predicted variance of the control parameters is calculated by substituting the current feature vector into the prediction variance function of the mapping model. A conservative coefficient is determined based on the comparison result between the variance value and the preset variance threshold. When the variance value is greater than the preset variance threshold, a first conservative coefficient is set. When the variance value is less than or equal to the preset variance threshold, a second conservative coefficient less than the first conservative coefficient is set. The safety margin is obtained by multiplying the square root of the variance value by the conservative coefficient. The predicted mean is added to the safety margin to obtain a conservative parameter that includes the lead time and the opening of the feeding gate.

5. The automatic weighing method according to claim 1, characterized in that, The process involves controlling the quantitative packaging scale to be debugged to operate according to the conservative parameters, extracting actual feature quantities, and comparing these actual feature quantities with the feature quantities prefitted by the mapping model to obtain feature deviations, including: The advance amount and feeding gate opening in the conservative parameters are sent to the quantitative packaging scale to be debugged, and the quantitative packaging scale to be debugged is controlled to perform weighing operation. During the weighing process, the actual weighing error, actual material flow rate and actual feeding response time are collected to form the actual characteristic quantity. The current feature vector is input into the mapping model to calculate the predicted weighing error, predicted material flow rate and predicted feeding response time, which together form the predicted feature quantities. The deviation values ​​of the corresponding items in the actual feature quantity and the predicted feature quantity are calculated respectively, and the distance metric between the actual feature quantity and the predicted feature quantity is calculated to obtain the feature deviation including the item deviation value and the overall metric value.

6. The automatic weighing method according to claim 1, characterized in that, The step of iteratively adjusting the conservative parameters based on the characteristic deviation to obtain optimized parameters, and applying the optimized parameters to the quantitative packaging scale to be debugged, includes: A performance evaluation function is constructed based on the characteristic deviation, and the performance evaluation function includes a weighing accuracy evaluation item, a weighing speed evaluation item, and a parameter stability evaluation item; Using the conservative parameter as the current parameter, calculate the gradient of the performance evaluation function with respect to the current parameter, and calculate the parameter adjustment amount based on the gradient and the preset learning rate; The current parameters are updated according to the parameter adjustment amount, and the updated parameters are applied to the quantitative packaging scale to be debugged for weighing verification. The updated performance evaluation function value is calculated. Repeat the gradient calculation, parameter update, and weighing verification process. Stop iterating when the performance evaluation function value meets the convergence condition, and use the final parameters as the optimization parameters.

7. The automatic weighing method according to claim 6, characterized in that, The performance evaluation function constructed based on the characteristic deviation includes a weighing accuracy evaluation term, a weighing speed evaluation term, and a parameter stability evaluation term, comprising: The weighing accuracy evaluation item is calculated based on the deviation between the actual weighing error and the predicted weighing error in the characteristic deviation. The weighing speed evaluation item is calculated based on the actual feeding response time in the aforementioned characteristic deviation. The parameter stability evaluation item is calculated based on the adjustment range of the conservative parameter; The performance evaluation function is obtained by weighted summation of the weighing accuracy evaluation item, the weighing speed evaluation item, and the parameter stability evaluation item.

8. An automatic weighing device, characterized in that, The automatic weighing device includes: The modeling module is used to perform multi-material tests on the quantitative packaging scale, collect multi-feature data and corresponding control parameters and weighing errors, fit the multi-feature data and weighing errors, and obtain a mapping model between the feature quantities and control parameters. The parameter generation module is used to obtain the current characteristic data of the quantitative packaging scale to be debugged, input the current characteristic data into the mapping model, and generate conservative parameters. The deviation calculation module is used to control the quantitative packaging scale to be debugged to operate according to the conservative parameters, extract the actual feature quantity, compare the actual feature quantity with the feature quantity prefitted by the mapping model, and obtain the feature deviation. The parameter optimization module is used to iteratively adjust the conservative parameters based on the characteristic deviation to obtain optimized parameters, and then apply the optimized parameters to the quantitative packaging scale to be debugged.

9. An automatic weighing device, characterized in that, The automatic weighing device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the automatic weighing device to perform the steps of the automatic weighing method as described in any one of claims 1-7.

10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instruction is executed by the processor, it implements the steps of the automatic weighing method as described in any one of claims 1-7.