A weighing-quantity dynamic mapping optimization method based on BP neural network

By constructing a dynamic mapping optimization method for weighing-quantity using a BP neural network, the problems of accuracy and stability in item quantity recognition in dynamic weighing scenarios are solved, and the continuous prediction and dynamic updating of item quantity are realized, thereby improving the system's adaptability and reliability.

CN122153769APending Publication Date: 2026-06-05DEBAO HENGSHENG TECH SERVICE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DEBAO HENGSHENG TECH SERVICE CO LTD
Filing Date
2026-02-02
Publication Date
2026-06-05

Smart Images

  • Figure CN122153769A_ABST
    Figure CN122153769A_ABST
Patent Text Reader

Abstract

The present application relates to the field of weighing detection and intelligent identification, and particularly relates to a weighing-quantity dynamic mapping optimization method based on BP neural network, comprising the following steps: S1: extracting and storing a static reference feature vector corresponding to a stable state; S2: extracting a dynamic feature vector reflecting a weight change process, and simultaneously estimating a system zero-point drift compensation amount; S3: performing forward correction to generate a compensated reference feature vector; S4: performing fusion calculation to output a predicted quantity change value of the articles; and S5: updating a current quantity estimation result of the articles in the container according to the quantity change value of the articles. Through the fusion of the dynamic weight feature and the compensated reference feature, and in combination with the system stability judgment and the zero-point drift correction mechanism, the present application realizes the continuous and accurate prediction of the quantity change of the articles in the dynamic weighing process and the adaptive updating of the reference, thereby significantly improving the quantity identification accuracy in complex scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of weighing detection and intelligent recognition technology, and in particular to a dynamic mapping optimization method for weighing-quantity based on a BP neural network. Background Technology

[0002] With the continuous development of applications such as automated production, warehouse management, and precision assembly, identifying the quantity of items based on weighing has become a common technical approach. In existing technologies, the total weight of items in a container is usually obtained through weighing sensors, and the quantity of items is estimated by combining the nominal weight of each individual item. This method is applicable to certain situations where items are statically placed and environmental conditions are stable. However, in practical applications, the process of adding or removing items is often accompanied by transient fluctuations in the weighing signal, zero-point drift of the system, and environmental interference, resulting in obvious time-series characteristics in the weighing output. At the same time, the baseline characteristics of the weighing system differ under different operating conditions, making it difficult to accurately reflect the true quantity change process by relying solely on a single stable weight value or a simple threshold.

[0003] Existing technologies generally suffer from the following shortcomings: Firstly, most solutions only perform quantity calculations after weighing has stabilized, neglecting the utilization of information during dynamic changes, leading to lag in response to scenarios such as continuous feeding and unloading. Secondly, system zero-point drift typically employs fixed compensation or periodic calibration methods, failing to closely correlate with the current dynamic process and easily introducing cumulative errors. Furthermore, traditional methods fail to establish an effective mapping relationship between dynamic characteristics and the system's baseline state, making it difficult to maintain consistency and stability in quantity estimation when the weighing system's state changes. Therefore, it is necessary to propose a weighing-quantity dynamic mapping optimization method based on BP neural networks to address the problems of insufficient quantity recognition accuracy, lag in baseline updates, and poor long-term operational reliability in existing technologies under dynamic scenarios. Summary of the Invention

[0004] To achieve the above objectives, this invention provides a dynamic mapping optimization method for weighing-quantity based on a BP neural network.

[0005] A dynamic mapping optimization method for weighing-quantity based on a backpropagation neural network includes the following steps:

[0006] S1: When the weighing unit is stable under no-load conditions, zero the weight and place a container containing several homogeneous items on the weighing unit. After the weight reading stabilizes, obtain the initial total weight and input it into the pre-trained BP neural network model to extract and store the static benchmark feature vector corresponding to the stable state. S2: When a change in the quantity of items in the container is detected, the dynamic weight time series output by the weighing unit is captured in real time; the dynamic weight time series is input into the BP neural network model to extract the dynamic feature vector reflecting the weight change process, and at the same time, the zero-point drift compensation amount of the system is estimated. S3: Use the drift compensation amount to perform forward correction on the static reference feature vector to generate the compensated reference feature vector; S4: The dynamic feature vector and the compensated baseline feature vector are fused and calculated in the hidden layer of the model to output the predicted change in the number of items. S5: Update the current quantity estimate of items in the container based on the change in the quantity of items, and after the weighing state stabilizes again, re-input the new stable weight information into the BP neural network model, update and store the new static benchmark feature vector as the reference benchmark for the next round of dynamic mapping processing.

[0007] Optionally, S1 specifically includes: S11: When the weighing unit is in a stable no-load state, detect the short-time variance of the current output signal. When the variance is lower than the set static stability threshold for several consecutive sampling periods, it is determined to be stable under no-load conditions. Then execute the zero-set command to set the current output as the system zero-point reference. S12: Place the target container containing several homogeneous items on the weighing unit that has been zeroed, collect the weight reading in real time and perform fluctuation detection. When the maximum difference between multiple consecutive sampling points is less than the stability threshold, the weight reading is determined to be stable, and the weight value at this moment is extracted as the initial total weight. S13: Input the initial total weight into the pre-trained BP neural network model. After normalization by the input layer, it is passed into the hidden layer. Extract the feature vector corresponding to the stable activation state in the hidden layer. Store this feature vector as the static benchmark feature vector corresponding to the stable weighing state in the model's dedicated cache area for subsequent dynamic mapping benchmark comparison.

[0008] Optionally, S13 specifically includes: S131: After inputting the initial total weight into the BP neural network model, the normalization function set by the input layer is called to perform linear normalization on the current input value according to the upper and lower limits of the weight input used in the model training phase. S132: The normalized standard input value is fed into the hidden layer of the BP neural network. The activation value of each hidden node is calculated according to the preset activation function to form the hidden layer activation vector. When the rate of change of the activation vector is lower than the set feature stability threshold in multiple consecutive sampling periods, the activation state of the hidden layer is determined to be stable. Then, the activation vector corresponding to the stable moment is extracted as the static baseline feature vector of the current state. S133: Store the extracted static baseline feature vectors into the model-specific cache area.

[0009] Optionally, S2 specifically includes: S21: After the weighing unit completes the establishment of the static benchmark, the real-time output signal of the weighing unit is continuously sampled. When the weight change amplitude in adjacent sampling periods continuously exceeds the preset change judgment threshold, it is determined that the quantity of items in the container has changed. From the judgment time, the weighing output value is continuously collected at the preset sampling frequency, and a dynamic weight time series is constructed according to the time sequence. S22: Input the dynamic weight time series into the pre-trained BP neural network model. The input layer performs a uniform scale mapping on the time series data and then passes it into the hidden layer. Based on the magnitude, rate of change and direction of change of weight in the time series, the model calculates the dynamic activation response of the hidden layer nodes and aggregates the dynamic activation response within a preset time window to form a dynamic feature vector representing the weight change process. S23: Select the stable intervals before and after the change in the quantity of items in the dynamic weight time series, calculate the average weight in the corresponding intervals, and take the difference between the average weights in the stable intervals before and after as the zero-point drift of the system under the current dynamic process.

[0010] Optionally, S22 specifically includes: S221: Perform differential calculation on the dynamic weight time series at adjacent sampling times to obtain the weight change amplitude, weight change rate and weight change direction at each sampling time, and form a ternary feature sequence for model input; S222: The magnitude of weight change and the rate of weight change are respectively processed into dimensionless values ​​according to preset scale parameters, and together with the direction of weight change, they form the standardized input vector of the input layer. S223: Input the standardized input vector into the hidden layer of the BP neural network, calculate the weighted input for the j-th node of the hidden layer, and output the node activation value through a preset activation function to form the dynamic activation response vector of the hidden layer; S224: In a window with a length equal to the number of points Within a preset time window, statistical aggregation is performed on the dynamic activation response vector sequence to obtain the dynamic feature vector of the corresponding window.

[0011] Optionally, S23 specifically includes: S231: In the dynamic weight time series, the time when the change in the quantity of items is triggered is used as the dividing point. The time axis is traced back to the front, and the stability test is performed on the weight data of continuous sampling points. When the weight readings of no less than a preset number of consecutive sampling points meet the condition that the absolute difference between adjacent sampling points is less than the stability judgment threshold, the set of continuous sampling points is determined as the stable interval before the change in the quantity of items. S232: After the change in the quantity of items is completed, perform stability detection on the dynamic weight time series along the time axis backward; when the weight readings of no less than a preset number of consecutive sampling points meet the condition that the absolute difference between adjacent sampling points is less than the stability determination threshold, the set of consecutive sampling points is determined as the stable interval after the change in the quantity of items. S233: Calculate the average weight readings within the stability interval before and after the change, respectively, to obtain the corresponding average weight of the stability interval, denoted as... and ; S234: Subtract the average weight of the stable interval after the change from the average weight of the stable interval before the change to obtain the system zero-point drift corresponding to the current dynamic process. The formula is: .

[0012] Optionally, S3 specifically includes: S31: Call the stored static baseline feature vector inside the BP neural network model; S32: System zero-point drift compensation amount obtained based on estimation By calling the proportional parameter used for input normalization, the input correction increment corresponding to the drift is calculated using the following formula: ,in, To correct the increment for the input layer, These are the maximum and minimum input weight boundaries set during the training of the BP neural network; S33: Will correct the increment After being superimposed on the original static input value, it is re-input into the BP neural network model. After being normalized by the input layer, it is passed into the hidden layer to reactivate the network and extract the hidden layer output feature vector under the current corrected input conditions. S34: Define the hidden layer output feature vector extracted under the corrected input as the compensated baseline feature vector and store it in the model cache bound to the current time label, replacing the original static baseline feature.

[0013] Optionally, S4 specifically includes: S41: Perform a concatenation operation on the feature dimension between the dynamic feature vector and the compensated baseline feature vector to form a unified fused input vector. ; S42: Input the fused input vector into the BP neural network model, and perform nonlinear feature transformation through one or more hidden layers in sequence, finally obtaining the fused calculation result in the output layer; S43: The output layer of the BP neural network uses a linear activation function to map the output vector of the last hidden unit into a scalar form of the prediction result, that is, the predicted change in the number of items.

[0014] Optionally, S5 specifically includes: S51: Receive the item quantity change value output from S4, and add or subtract it from the known item quantity estimate value of the previous moment to update the current item quantity estimate result in the container in real time. At the same time, the current estimate value is tagged with the static quantity state recorded last time to continuously track the quantity change trend. S52: Continuously monitor the changes in the output signal of the weighing unit, determine whether the current weighing state has reached stability again, and if so, enter a new round of benchmark feature acquisition stage. S53: Input the weight reading in the current steady state into the BP neural network model. After input normalization, it is fed into the network. Extract the hidden layer output feature vector corresponding to the steady state as the new static baseline feature vector at the current moment. S54: Store the newly extracted static benchmark feature vector into the model's dedicated cache area, and mark the original benchmark features as historical records, replacing them with the current feature vector as the reference benchmark for subsequent dynamic feature fusion calculations.

[0015] Optionally, S52 specifically includes: S521: Continuously acquires the output signal of the repeating unit at a fixed sampling interval, constructing a length of... Weight time series Each of them Indicates the first The instantaneous weight value at each sampling moment; S522: In the weighted time series, calculate the absolute difference between all adjacent sampling points and record the maximum fluctuation. Its calculation expression is: ; S523: Maximum fluctuation range Compared with the preset stability threshold Compare, if satisfied Furthermore, the duration for which the conditions are met continuously is not less than the set stable duration period. If the current weighing state has reached a stable state again, then it is determined that the current weighing state has been stabilized.

[0016] The beneficial effects of this invention are: This invention constructs a weighing-quantity dynamic mapping optimization process based on a BP neural network, which can integrate the time series features of dynamic weight change process with the compensated reference feature information of the current system to achieve continuous prediction and dynamic updating of quantity change values. Combined with zero-point drift adaptive compensation, feature fusion mapping, stability triggering mechanism and other technical means, it can significantly improve the quantity recognition accuracy, real-time response capability and long-term operational reliability of the system in dynamic scenarios.

[0017] This invention introduces a stability detection and benchmark feature iteration mechanism after each round of dynamic recognition, enabling the system to continuously maintain a highly consistent model of the current working state. Compared with traditional methods that rely on static judgment or manual calibration, this solution has stronger intelligence, adaptability and anti-interference capabilities, and is especially suitable for dynamic weighing and recognition scenarios where items are frequently added or removed or where environmental fluctuations are large. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the dynamic mapping optimization method for weighing-quantity according to an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the process of extracting dynamic feature vectors and estimating drift compensation in an embodiment of the present invention. Detailed Implementation

[0020] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. It should also be noted that, to make the embodiments more comprehensive, the following embodiments are the best and preferred embodiments, and those skilled in the art can use other alternative methods to implement some well-known technologies; moreover, the accompanying drawings are only for more specific description of the embodiments and are not intended to specifically limit the present invention.

[0021] It should be noted that the use of terms such as "an embodiment," "an embodiment," "an exemplary embodiment," and "some embodiments" in the specification indicates that the described embodiment may include a specific feature, structure, or characteristic, but not every embodiment necessarily includes that specific feature, structure, or characteristic. Furthermore, when a specific feature, structure, or characteristic is described in connection with an embodiment, implementing such a feature, structure, or characteristic in conjunction with other embodiments (whether explicitly described or not) should be within the knowledge of those skilled in the art.

[0022] Generally, terms can be understood at least partly from their use in context. For example, depending at least partly on the context, the term "one or more" as used herein can be used to describe any feature, structure, or characteristic in a singular sense, or a combination of features, structures, or characteristics in a plural sense. Additionally, the term "based on" can be understood not necessarily to convey an exclusive set of factors, but rather, alternatively, depending at least partly on the context, to allow for the presence of other factors that are not necessarily explicitly described.

[0023] like Figures 1-2 As shown, a dynamic mapping optimization method for weighing-quantity based on a BP neural network includes the following steps: S1: When the weighing unit is stable under no-load conditions, zero the weight and place a container containing several homogeneous items on the weighing unit. After the weight reading stabilizes, obtain the initial total weight and input it into the pre-trained BP neural network model to extract and store the static benchmark feature vector corresponding to the stable state. S1 specifically includes: S11: When the weighing unit is in a stable no-load state, detect the short-time variance of the current output signal. When the variance is lower than the set static stability threshold for several consecutive sampling periods, it is determined to be stable under no-load conditions. Then execute the zero-set command to set the current output as the system zero-point reference. S12: Place the target container containing several homogeneous items on the weighing unit that has been zeroed, collect the weight reading in real time and perform fluctuation detection. When the maximum difference between multiple consecutive sampling points is less than the stability threshold, the weight reading is determined to be stable, and the weight value at this moment is extracted as the initial total weight. S13: The initial total weight is input into the pre-trained BP neural network model. After normalization by the input layer, it is passed to the hidden layer. The feature vector corresponding to the stable activation state in the hidden layer is extracted. This feature vector is stored in the model's dedicated cache as the static benchmark feature vector corresponding to the stable weighing state for subsequent dynamic mapping benchmark comparison. The above steps ensure the stability and reliability of the zeroing operation and the initial total weight acquisition by setting a dual judgment mechanism of short-time variance and maximum fluctuation threshold. This enables the static benchmark feature vector to accurately reflect the benchmark state characteristics under the current weighing system, laying a stable reference foundation for feature difference extraction and quantity prediction in the subsequent dynamic process.

[0024] S13 specifically includes: S131: After inputting the initial total weight into the BP neural network model, the normalization function set in the input layer is called to linearly normalize the current input value according to the upper and lower limits of the weight input used in the model training phase. The normalization formula is: ,in, The initial total weight is the input. and These are the minimum and maximum physical weights in the training set, respectively. These are the normalized standard input values; S132: The normalized standard input value is fed into the hidden layer of the BP neural network. The activation value of each hidden node is calculated according to the preset activation function to form the hidden layer activation vector. When the rate of change of the activation vector is lower than the set feature stability threshold in multiple consecutive sampling periods, the activation state of the hidden layer is determined to be stable. Then, the activation vector corresponding to the stable moment is extracted as the static baseline feature vector of the current state. S133: The extracted static benchmark feature vector is stored in the model's dedicated cache area and marked as the benchmark reference for the current static state, which is used for fusion comparison calculation in the subsequent dynamic change process. The above steps can effectively shield the interference of physical magnitude differences between different samples on the model's recognition ability by normalizing the total input weight and extracting the hidden layer feature vector in the activated stable state, thereby ensuring that the static benchmark features have high consistency and comparability, and providing a stable benchmark reference for subsequent dynamic feature fusion.

[0025] The default activation functions include the Sigmoid activation function and the ReLU activation function; When the BP neural network model uses the Sigmoid function as the activation function, the activation value of any neuron in the hidden layer is calculated by the following formula: ,in, The weighted input received by the neuron. The corresponding activation value; the output value of the Sigmoid function ranges from 0 to 1, and it is suitable for non-linear compression of the input; When the model uses the ReLU function as the activation function, the activation value of any neuron in the hidden layer is calculated by the following formula: ,in, For the weighted input of neurons, The corresponding activation value is represented by the ReLU function, which suppresses negative inputs while maintaining the linear relationship of positive inputs, thus accelerating network convergence and reducing the gradient vanishing problem. By introducing two types of preset activation function mechanisms, Sigmoid and ReLU, and combining their nonlinear mapping characteristics, the adaptability of the BP neural network to different input weight distributions can be effectively enhanced, and the discriminativeness and stability of the hidden layer feature expression can be improved, providing mathematical consistency and computational stability support for subsequent static feature vector extraction.

[0026] S2: When a change in the quantity of items in the container is detected, the dynamic weight time series output by the weighing unit is captured in real time; the dynamic weight time series is input into the BP neural network model to extract the dynamic feature vector reflecting the weight change process, and at the same time, the zero-point drift compensation amount of the system is estimated. S2 specifically includes: S21: After the weighing unit completes the establishment of the static benchmark, the real-time output signal of the weighing unit is continuously sampled. When the weight change amplitude in adjacent sampling periods continuously exceeds the preset change judgment threshold, it is determined that the quantity of items in the container has changed. From the judgment time, the weighing output value is continuously collected at the preset sampling frequency, and a dynamic weight time series is constructed according to the time sequence. S22: Input the dynamic weight time series into the pre-trained BP neural network model. The input layer performs a uniform scale mapping on the time series data and then passes it into the hidden layer. Based on the magnitude, rate of change and direction of change of weight in the time series, the model calculates the dynamic activation response of the hidden layer nodes and aggregates the dynamic activation response within a preset time window to form a dynamic feature vector representing the weight change process. S23: Select stable intervals before and after the change in the quantity of items in the dynamic weight time series, calculate the average weight within the corresponding intervals, and use the difference between the average weights of the stable intervals before and after as the zero-point drift of the system under the current dynamic process; the above steps, by thresholding the weight change events and constructing the dynamic weight time series, enable a complete characterization of the transient changes in the weighing process; at the same time, based on the feature extraction mechanism of the hidden layer of the BP neural network for the dynamic response of the time series, it can accurately reflect the characteristics of the weight change process, and combined with the zero-point drift estimation results of the stable intervals before and after, it provides a reliable basis for subsequent benchmark feature correction, thereby improving the stability and consistency of quantity change identification.

[0027] S22 specifically includes: S221: Perform difference calculation on the dynamic weight time series at adjacent sampling times to obtain the weight change amplitude, weight change rate, and weight change direction at each sampling time, and form a ternary feature sequence for model input. The corresponding calculation formula is as follows: ; ; ;in, For the first Weight readings at each sampling time. For the first The magnitude of weight change at each sampling time. The time interval between adjacent sampling times. For the first The rate of weight change at each sampling time. For the first The direction of weight change at each sampling time. This is a symbolic function, and its output is... ; S222: The magnitude and rate of weight change are dimensionlessly processed according to preset scale parameters, and together with the direction of weight change, they form the standardized input vector of the input layer. The corresponding expression is: ; ; ;in, This is a scale parameter for the magnitude of weight change. This is a scale parameter representing the rate of weight change. It is a dimensionless amplitude quantity. It is a dimensionless rate quantity. For the first The standardized input vector of the input layer at each sampling time; S223: The standardized input vector is input into the hidden layer of the BP neural network. The weighted input is calculated for the j-th node of the hidden layer, and the node activation value is output through a preset activation function to form the dynamic activation response vector of the hidden layer. The corresponding calculation expression is: ; ; ;in, For the hidden layer The weight vector of each node. For the hidden layer The bias term of each node, For input to the number The linearly weighted sum of inputs to each hidden layer node (i.e., the net input before activation). The previously defined preset activation function, such as Sigmoid or ReLU; For the first The hidden layer at the sampling time 1 The activation value of each node. This represents the number of hidden layer nodes. For the first The dynamic activation response vector at each sampling time; S224: In a window with a length equal to the number of points Within a preset time window, statistical aggregation is performed on the dynamic activation response vector sequence to obtain the dynamic feature vector of the corresponding window. The aggregation expression is: ; ; ;in, This is the mean vector of the dynamically activated response vectors within the window. The standard deviation vector of the dynamic activation response vector within the window. For element-wise multiplication, To characterize the dynamic feature vector of the weight change process, the above steps, by making the weight change amplitude, rate of change, and direction of change dimensionless and driving the hidden layer to generate a dynamic activation response, can stably characterize the change pattern of the dynamic weighing process on a uniform scale. At the same time, by aggregating the mean and standard deviation of the dynamic activation response within a preset time window, the change trend and fluctuation intensity can be characterized simultaneously, thereby improving the consistency and comparability of the dynamic feature vector in expressing the weight change process, and providing a stable input basis for subsequent quantity change mapping calculations.

[0028] S23 specifically includes: S231: In the dynamic weight time series, the time when the change in the quantity of items is triggered is used as the dividing point. The time axis is traced back to the front, and the stability test is performed on the weight data of continuous sampling points. When the weight readings of no less than a preset number of consecutive sampling points meet the condition that the absolute difference between adjacent sampling points is less than the stability judgment threshold, the set of continuous sampling points is determined as the stable interval before the change in the quantity of items. S232: After the change in the quantity of items is completed, perform stability testing on the dynamic weight time series along the time axis; when the weight readings of no less than a preset number of consecutive sampling points meet the condition that the absolute difference between adjacent sampling points is less than the stability judgment threshold, the set of consecutive sampling points is determined as the stable interval after the change in the quantity of items. S233: Calculate the average weight readings within the stability interval before and after the change, respectively, to obtain the corresponding average weight of the stability interval, denoted as... and The calculation formulas are as follows: ; ;in, This represents the average weight of the items within the stable period before the quantity changes. This represents the average weight of the items within a stable period after changes in quantity. For the first stable interval before the change Weight readings at each sampling point This represents the number of sampling points in the stable interval before the change. For the first stable interval after the change Weight readings at each sampling point This represents the number of sampling points in the stable interval after the change. S234: Subtract the average weight of the stable interval after the change from the average weight of the stable interval before the change to obtain the system zero-point drift corresponding to the current dynamic process. The formula is: The above steps, by clearly determining the stable interval before and after the change in the quantity of items in the dynamic weight time series, and calculating the zero-point drift of the system based on the difference in the average weight of the stable interval, can effectively separate the systematic error introduced by the sensor zero-point offset or environmental disturbance from the dynamic weighing process, providing a definite and quantifiable compensation basis for subsequent benchmark feature correction, thereby improving the stability and consistency of the quantity change estimation results.

[0029] S3: Use the drift compensation amount to perform forward correction on the static reference feature vector to generate the compensated reference feature vector; S3 specifically includes: S31: Call the stored static baseline feature vector inside the BP neural network model; S32: System zero-point drift compensation amount obtained based on estimation By calling the proportional parameter used for input normalization, the input correction increment corresponding to the drift is calculated using the following formula: ,in, To correct the increment for the input layer, These are the maximum and minimum input weight boundaries set during the training of the BP neural network; S33: Will correct the increment After being superimposed on the original static input value, it is re-input into the BP neural network model. After being normalized by the input layer, it is passed into the hidden layer to reactivate the network and extract the hidden layer output feature vector under the current corrected input conditions. S34: Define the hidden layer output feature vector extracted under the corrected input as the compensated benchmark feature vector and store it in the model cache bound to the current time label to replace the original static benchmark feature for subsequent dynamic feature fusion and matching process; the above steps reverse the input correction value based on the system zero-point drift compensation amount and drive the network to reactivate the hidden layer features, which can realize the dynamic correction of the static benchmark feature under different system states, so that the generated compensated benchmark feature always remains consistent with the actual weighing system state, thereby improving the adaptability and anti-drift capability of dynamic quantity change calculation.

[0030] S4: The dynamic feature vector and the compensated baseline feature vector are fused and calculated in the hidden layer of the model to output the predicted change in the number of items. S4 specifically includes: S41: Perform a concatenation operation on the feature dimension between the dynamic feature vector and the compensated baseline feature vector to form a unified fused input vector. Its expression is: ,in, For dynamic feature vectors, The compensated baseline feature vector; S42: The fused input vector is input into the BP neural network model, and nonlinear feature transformation is performed sequentially through one or more hidden layers. Finally, the fused calculation result is obtained in the output layer; specifically, let the first... The activation function of the layer is The weight matrix is The bias term is Then the forward propagation expression is: ; S43: The output layer of the BP neural network uses a linear activation function to map the output vector of the last hidden unit into a scalar form of the prediction result, i.e., the predicted change in the quantity of items, expressed as: ,in, For the predicted change in the quantity of items, This is the output vector of the last hidden layer. and The above steps involve fusing the dynamic feature vector and the compensated baseline feature vector into the hidden layer of the neural network for joint modeling. This allows for the full capture of the relative change relationship between the two in the feature space. Furthermore, the regression output mechanism is used to obtain the prediction results of the quantity change in continuous value form, thereby improving the system's sensitivity to the increase or decrease of small items and the accuracy of calculation, and effectively enhancing the stability and accuracy of dynamic recognition.

[0031] During dynamic weighing, predicting the change in the current quantity of items must rely on two core information sources: the dynamic feature vector, which is composed of the dynamic sequence features of weight changes during the addition or subtraction of items, reflecting the characteristics of the change process itself; and the compensated baseline feature vector, which is generated from the stable weight features under the current system state, reflecting the baseline state of the current system. The purpose of fusion computing is to enable the neural network to simultaneously perceive the correlation differences between these two features, and use this as the basis for judging the change in the quantity of items.

[0032] Specific examples are as follows: Scene setting: In static reference, there are 5 screws in the container; During the subsequent dynamic process, three new screws were added to the container; The system needs to accurately identify the changes in the quantity of +3.

[0033] Merge input content: Dynamic feature vectors =[0.12,0.08,0.15,0.10], reflects the weight increase trend, rate, fluctuation, etc. during the addition process; Compensated baseline feature vector =[0.23,0.21,0.25,0.22], representing the five screw stability characteristics under the current system; spliced ​​as =[0.12,0.08,0.15,0.10,0.23,0.21,0.25,0.22].

[0034] Neural network processing: Input layer reception Weighted by weights and biases; The hidden layer automatically learns dynamic and baseline difference feature patterns; The output layer predicts an approximate value. =2.98, which means that 3 items were added; The essence of fusion computing is a feature comparison judgment mechanism. By concatenating baseline features and dynamic features into the input, the BP neural network can automatically discover difference patterns in the feature space; learn to map how many items change to correspond to a certain difference; and improve the ability to recognize subtle quantitative changes in complex weighing processes.

[0035] S5: Update the current quantity estimate of items in the container based on the change in the quantity of items, and after the weighing state stabilizes again, re-input the new stable weight information into the BP neural network model, update and store the new static benchmark feature vector as the reference benchmark for the next round of dynamic mapping processing. S5 specifically includes: S51: Receive the item quantity change value output from S4, and add or subtract it from the known item quantity estimate value of the previous moment to update the current item quantity estimate result in the container in real time. At the same time, the current estimate value is tagged with the static quantity state recorded last time to continuously track the quantity change trend. S52: Continuously monitor the changes in the output signal of the weighing unit, determine whether the current weighing state has reached stability again, and if so, enter a new round of benchmark feature acquisition stage. S53: Input the weight reading in the current steady state into the BP neural network model. After input normalization, it is fed into the network. Extract the hidden layer output feature vector corresponding to the steady state as the new static baseline feature vector at the current moment. S54: Store the newly extracted static benchmark feature vector into the model's dedicated cache area, and mark the original benchmark features as historical records, replacing them with the current feature vector as the reference benchmark for subsequent dynamic feature fusion calculations; the above steps, by updating the estimated quantity of items in real time and refreshing the static benchmark feature vector in a timely manner under stable weighing conditions, can not only maintain the system's high-precision tracking of changes in the actual quantity of items, but also continuously maintain the accuracy of the neural network's feature representation of the current system state, thereby improving the continuity and robustness of dynamic change monitoring.

[0036] S52 specifically includes: S521: Continuously acquires the output signal of the repeating unit at a fixed sampling interval, constructing a length of... Weight time series Each of them Indicates the first The instantaneous weight value at each sampling moment; S522: In the weighted time series, calculate the absolute difference between all adjacent sampling points and record the maximum fluctuation. Its calculation expression is: ; S523: Maximum fluctuation range Compared with the preset stability threshold Compare, if satisfied Furthermore, the duration for which the conditions are met continuously is not less than the set stable duration period. If the current weighing state has reached a stable state again, then it is determined that the current weighing state has reached a stable state again. The above steps, by calculating the maximum fluctuation amplitude of the real-time weight output sequence and combining the dual constraint criteria of continuous stability duration, can accurately determine whether the weighing system has entered a physically stable state, thereby effectively avoiding misjudgment caused by instantaneous jitter or short-term fluctuations, and providing reliable preconditions for a new round of static benchmark feature extraction.

[0037] This invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of this invention. To provide the public with a thorough understanding of this invention, specific details are described in detail in the following preferred embodiments; however, those skilled in the art will fully understand the invention even without these details. Furthermore, to avoid unnecessary misunderstanding of the essence of this invention, well-known methods, processes, procedures, components, and circuits are not described in detail.

[0038] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A dynamic mapping optimization method for weighing-quantity based on a BP neural network, characterized in that, Includes the following steps: S1: When the weighing unit is stable under no-load conditions, zero the weight and place a container containing several homogeneous items on the weighing unit. After the weight reading stabilizes, obtain the initial total weight and input it into the pre-trained BP neural network model to extract and store the static benchmark feature vector corresponding to the stable state. S2: When a change in the quantity of items in the container is detected, the dynamic weight time series output by the weighing unit is captured in real time; the dynamic weight time series is input into the BP neural network model to extract the dynamic feature vector reflecting the weight change process, and at the same time, the zero-point drift compensation amount of the system is estimated. S3: Use the drift compensation amount to perform forward correction on the static reference feature vector to generate the compensated reference feature vector; S4: The dynamic feature vector and the compensated baseline feature vector are fused and calculated in the hidden layer of the model to output the predicted change in the number of items. S5: Update the current quantity estimate of items in the container based on the change in the quantity of items, and after the weighing state stabilizes again, re-input the new stable weight information into the BP neural network model, update and store the new static benchmark feature vector as the reference benchmark for the next round of dynamic mapping processing.

2. The weighing-quantity dynamic mapping optimization method based on a BP neural network according to claim 1, characterized in that, S1 specifically includes: S11: When the weighing unit is in a stable no-load state, detect the short-time variance of the current output signal. When the variance is lower than the set static stability threshold for several consecutive sampling periods, it is determined to be stable under no-load conditions. Then execute the zero-set command to set the current output as the system zero-point reference. S12: Place the target container containing several homogeneous items on the weighing unit that has been zeroed, collect the weight reading in real time and perform fluctuation detection. When the maximum difference between multiple consecutive sampling points is less than the stability threshold, the weight reading is determined to be stable, and the weight value at this moment is extracted as the initial total weight. S13: Input the initial total weight into the pre-trained BP neural network model. After normalization by the input layer, it is passed into the hidden layer. Extract the feature vector corresponding to the stable activation state in the hidden layer. Store this feature vector as the static benchmark feature vector corresponding to the stable weighing state in the model's dedicated cache area for subsequent dynamic mapping benchmark comparison.

3. The weighing-quantity dynamic mapping optimization method based on a BP neural network according to claim 2, characterized in that, S13 specifically includes: S131: After inputting the initial total weight into the BP neural network model, the normalization function set by the input layer is called to perform linear normalization on the current input value according to the upper and lower limits of the weight input used in the model training phase. S132: The normalized standard input value is fed into the hidden layer of the BP neural network. The activation value of each hidden node is calculated according to the preset activation function to form the hidden layer activation vector. When the rate of change of the activation vector is lower than the set feature stability threshold in multiple consecutive sampling periods, the activation state of the hidden layer is determined to be stable. Then, the activation vector corresponding to the stable moment is extracted as the static baseline feature vector of the current state. S133: Store the extracted static baseline feature vectors into the model-specific cache area.

4. The weighing-quantity dynamic mapping optimization method based on a BP neural network according to claim 1, characterized in that, S2 specifically includes: S21: After the weighing unit completes the establishment of the static benchmark, the real-time output signal of the weighing unit is continuously sampled. When the weight change amplitude in adjacent sampling periods continuously exceeds the preset change judgment threshold, it is determined that the quantity of items in the container has changed. From the judgment time, the weighing output value is continuously collected at the preset sampling frequency, and a dynamic weight time series is constructed according to the time sequence. S22: Input the dynamic weight time series into the pre-trained BP neural network model. The input layer performs a uniform scale mapping on the time series data and then passes it into the hidden layer. Based on the magnitude, rate of change and direction of change of weight in the time series, the model calculates the dynamic activation response of the hidden layer nodes and aggregates the dynamic activation response within a preset time window to form a dynamic feature vector representing the weight change process. S23: Select the stable intervals before and after the change in the quantity of items in the dynamic weight time series, calculate the average weight in the corresponding intervals, and take the difference between the average weights in the stable intervals before and after as the zero-point drift of the system under the current dynamic process.

5. The weighing-quantity dynamic mapping optimization method based on a BP neural network according to claim 4, characterized in that, S22 specifically includes: S221: Perform differential calculation on the dynamic weight time series at adjacent sampling times to obtain the weight change amplitude, weight change rate and weight change direction at each sampling time, and form a ternary feature sequence for model input; S222: The magnitude of weight change and the rate of weight change are respectively processed into dimensionless values ​​according to preset scale parameters, and together with the direction of weight change, they form the standardized input vector of the input layer. S223: Input the standardized input vector into the hidden layer of the BP neural network, calculate the weighted input for the j-th node of the hidden layer, and output the node activation value through a preset activation function to form the dynamic activation response vector of the hidden layer; S224: In a window with a length equal to the number of points Within a preset time window, statistical aggregation is performed on the dynamic activation response vector sequence to obtain the dynamic feature vector of the corresponding window.

6. The weighing-quantity dynamic mapping optimization method based on a BP neural network according to claim 1, characterized in that, S23 specifically includes: S231: In the dynamic weight time series, the time when the change in the quantity of items is triggered is used as the dividing point. The time axis is traced back to the front, and the stability test is performed on the weight data of continuous sampling points. When the weight readings of no less than a preset number of consecutive sampling points meet the condition that the absolute difference between adjacent sampling points is less than the stability judgment threshold, the set of continuous sampling points is determined as the stable interval before the change in the quantity of items. S232: After the change in the quantity of items is completed, perform stability detection on the dynamic weight time series along the time axis backward; when the weight readings of no less than a preset number of consecutive sampling points meet the condition that the absolute difference between adjacent sampling points is less than the stability determination threshold, the set of consecutive sampling points is determined as the stable interval after the change in the quantity of items. S233: Calculate the average weight readings within the stability interval before and after the change, respectively, to obtain the corresponding average weight of the stability interval, denoted as... and ; S234: Subtract the average weight of the stable interval after the change from the average weight of the stable interval before the change to obtain the system zero-point drift corresponding to the current dynamic process. The formula is: .

7. The weighing-quantity dynamic mapping optimization method based on a BP neural network according to claim 6, characterized in that, S3 specifically includes: S31: Call the stored static baseline feature vector inside the BP neural network model; S32: System zero-point drift compensation amount obtained based on estimation By calling the proportional parameter used for input normalization, the input correction increment corresponding to the drift is calculated using the following formula: ,in, To correct the increment for the input layer, These are the maximum and minimum input weight boundaries set during the training of the BP neural network; S33: Will correct the increment After being superimposed on the original static input value, it is re-input into the BP neural network model. After being normalized by the input layer, it is passed into the hidden layer to reactivate the network and extract the hidden layer output feature vector under the current corrected input conditions. S34: Define the hidden layer output feature vector extracted under the corrected input as the compensated baseline feature vector and store it in the model cache bound to the current time label, replacing the original static baseline feature.

8. The weighing-quantity dynamic mapping optimization method based on a BP neural network according to claim 1, characterized in that, S4 specifically includes: S41: Perform a concatenation operation on the feature dimension between the dynamic feature vector and the compensated baseline feature vector to form a unified fused input vector. ; S42: Input the fused input vector into the BP neural network model, and perform nonlinear feature transformation through one or more hidden layers in sequence, finally obtaining the fused calculation result in the output layer; S43: The output layer of the BP neural network uses a linear activation function to map the output vector of the last hidden unit into a scalar form of the prediction result, that is, the predicted change in the number of items.

9. The weighing-quantity dynamic mapping optimization method based on a BP neural network according to claim 1, characterized in that, S5 specifically includes: S51: Receive the item quantity change value output from S4, and add or subtract it from the known item quantity estimate value of the previous moment to update the current item quantity estimate result in the container in real time. At the same time, the current estimate value is tagged with the static quantity state recorded last time to continuously track the quantity change trend. S52: Continuously monitor the changes in the output signal of the weighing unit, determine whether the current weighing state has reached stability again, and if so, enter a new round of benchmark feature acquisition stage. S53: Input the weight reading in the current steady state into the BP neural network model. After input normalization, it is fed into the network. Extract the hidden layer output feature vector corresponding to the steady state as the new static baseline feature vector at the current moment. S54: Store the newly extracted static benchmark feature vector into the model's dedicated cache area, and mark the original benchmark features as historical records, replacing them with the current feature vector as the reference benchmark for subsequent dynamic feature fusion calculations.

10. The weighing-quantity dynamic mapping optimization method based on a BP neural network according to claim 9, characterized in that, Specifically, S52 includes: S521: Continuously acquires the output signal of the repeating unit at a fixed sampling interval, constructing a length of... Weight time series Each of them Indicates the first The instantaneous weight value at each sampling moment; S522: In the weighted time series, calculate the absolute difference between all adjacent sampling points and record the maximum fluctuation. Its calculation expression is: ; S523: Maximum fluctuation range Compared with the preset stability threshold Compare, if satisfied Furthermore, the duration for which the conditions are met continuously is not less than the set stable duration period. If the current weighing state has reached a stable state again, then it is determined that the current weighing state has been stabilized.