Combined filtering method, device, system and medium for high-precision weighing sensor

By adopting a two-stage filtering method in a high-precision weighing sensor, combined with a gain value and a filter counter, the compatibility problem between real-time and stability of the filtering algorithm in the existing technology is solved, and an efficient filtering effect of weighing data is achieved. .

CN116067473BActive Publication Date: 2024-10-25HUADAO (SHANGHAI) BIOPHARMA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211542317.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-02
Publication Date
2024-10-25
Estimated Expiration
2042-12-02

AI Technical Summary

Technical Problem

The filtering algorithm of the existing high-precision weighing sensor is difficult to be compatible between real-time performance and stability, and a single filtering method cannot guarantee the real-time performance and stability of the weighing data at the same time.

Method used

A two-stage filtering method is adopted. The first stage of filtering calculates the gain value based on the process noise value, measurement noise value and measurement variance, updates the measurement variance, and calculates the current filtered weighing value based on the gain value and the last filtered weighing value. ; In the second level of filtering, a filter counter is used to accumulate the number of times that the weighing value after filtering is different from the current effective value. When the accumulated number exceeds the upper limit of counting, the current effective value is replaced.

Benefits of technology

It achieves both real-time and stability of weighing values ​​in high-precision digital load cells, and its effectiveness is verified through experiments and practical applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116067473B_ABST
    Figure CN116067473B_ABST
Patent Text Reader

Abstract

The present application provides a combined filtering method, device, system and medium for high-precision weighing sensors. In the first stage of filtering, the gain value is calculated according to the process noise value, the measurement noise value and the measurement variance; the weighing value after filtering is calculated according to the gain value and the weighing value after the last filtering and the weighing value to be filtered this time; in the second stage of filtering, the weighing value after filtering obtained in the first stage is used as the input value of the second stage of filtering, and the weighing value after filtering this time is compared with the current effective value; a filter counter is used to accumulate the number of times the weighing value after filtering this time is not equal to the current effective value, and when the accumulated number of times exceeds the counting upper limit of the filter counter, the latest weighing value after filtering this time replaces the current effective value. The present invention abandons a single filtering method and uses a two-stage filtering algorithm, so that the real-time and stability of the weighing value can be taken into account.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of high-precision weighing technology, and in particular to a combined filtering method, device, system and medium applied to a high-precision weighing sensor. Background Art

[0002] Precision weighing instruments are widely used in all walks of life, and they also have high requirements for weighing filtering algorithms. Generally speaking, in addition to taking anti-interference measures for signals in hardware, digital filtering processing should also be performed in software to further eliminate various interferences attached to the data, so that the collected data can be smoother and more stable.

[0003] At present, the software algorithms used in digital weighing systems are as follows:

[0004] (1) Limit filter algorithm (program judgment filter method): Based on experience, determine the maximum allowable deviation value (set to A) for two times, and judge each time a new value is detected: if the difference between the current value and the previous value is ≤A, then the current value is valid; if the difference between the current value and the previous value is >A, then the current value is invalid, and the current value is abandoned and replaced by the previous value. The advantage of this method is that it can effectively overcome pulse interference caused by accidental factors, but the disadvantage is that it cannot suppress periodic interference and has poor smoothness.

[0005] (2) Median filter algorithm: that is, continuous sampling n times (n is usually an odd number), the n sampling values ​​are arranged in order of size, and the middle value is taken as the effective value of this time. The advantage of this method is that it can effectively overcome the fluctuation interference caused by accidental factors, but the disadvantage is that it is poor at filtering rapidly changing parameters.

[0006] (3) Arithmetic mean filtering method: that is, the arithmetic mean of n consecutive sampling values ​​is calculated as the effective value obtained by this filtering. The advantages of this method are: when the n value is large, the signal smoothness is higher, but the sensitivity is lower; when the n value is small, the signal smoothness is lower, but the sensitivity is higher. The advantage of this method is that it has a better signal filtering effect on random interference, but its disadvantage is that it is not suitable for real-time application systems with high measurement speed requirements.

[0007] (4) Weighted average filtering algorithm: Since the "arithmetic mean filtering method" mentioned above has a contradiction between smoothness and sensitivity. In order to coordinate the relationship between smoothness and sensitivity, weighted average filtering can be used. Its principle is to multiply N consecutive sampling values ​​by different weighting coefficients and then accumulate them. The weighting coefficient is generally small at first and then large to highlight the effect of the following samplings and strengthen the system's understanding of the parameter change trend. Each weighting coefficient is a decimal less than 1 and meets the end condition that the sum is equal to 1. In this way, the cumulative sum after the weighted operation is the effective sampling value. It is expressed by the following formula:

[0008] S = (old average value S*(N-1)+C) / N (C is the new sampling value; N is the number of sampling times, which can be a constant. As long as the range of S is sufficient, N can be adjusted arbitrarily; S is the average value obtained, and the first sampling value can be directly assigned to S). The advantage of this method is that it is suitable for processes with large pure lag time constants and short sampling cycles. The disadvantage is that for signals with small pure lag time constants, long sampling cycles, and slow changes, it cannot quickly reflect the severity of the current interference to the system, and the filtering effect is poor.

[0009] (5) Sliding average filtering method (also known as recursive average filtering): N consecutive sampling values ​​are regarded as a queue, and the length of the queue is fixed to N; each time a new data is sampled, it is put at the end of the queue and the data at the head of the queue is discarded (first-in, first-out principle); the N data in the queue are arithmetic averaged to obtain a new filtering result. The advantage of this method is that it has a good suppression effect on periodic interference and high smoothness, and is suitable for high-frequency oscillation systems. Its disadvantages are low sensitivity, poor suppression ability for occasional pulse interference, and difficulty in eliminating sampling value deviations caused by pulse interference. It is not suitable for occasions where pulse interference is relatively serious, and has high requirements for the spatial complexity of the system.

[0010] (6) Anti-jitter filtering method: that is, set a filtering counter, compare each sampling value with the current effective value, if the sampling value = the current effective value, the counter is cleared, if the sampling value is greater than or less than the current effective value, the counter is incremented by 1, and it is determined whether the counter is greater than or equal to the upper limit N (overflow), if the counter overflows, the current effective value is replaced with the current value, and the counter is cleared. The advantage of this method is that it has a good filtering effect for slowly changing measured parameters, and can avoid repeated jumps of the controller near the critical value or jitter of the value on the display. The disadvantage is that it is not suitable for rapidly changing parameters. If the value sampled at the time when the counter overflows happens to be an interference value, the interference value will be imported into the system as a valid input.

[0011] (7) Kalman filter method: It is an algorithm that uses the linear system state equation and the system input and output observation matrix to make the best estimate of the system state. Since the observation data contains the influence of noise and interference in the system, the optimal estimate can also be regarded as a filtering process. When the measurement variance is known, the state of the dynamic system can be estimated from a series of data with measurement noise. The advantages of this method are that it is easy to implement with computer programming and has good real-time performance.

[0012] In addition, a fast two-stage filtering algorithm applied to high-precision digital weighing sensors is recorded in the patent document with publication number CN102175296A. However, the establishment time of the filtering algorithm of the patent is relatively long, and the stable real-time performance of the weighing data is not very good. The AD value in the algorithm is taken from the original chip data, and the data length is 23 bits, but the effective number of bits in these data is only about 16-18 bits, and the algorithm of the patent processes all 23 bits of data. Although this will slightly improve the accuracy of the weighing data, it will take a long time and the amount of data calculation is large, which puts forward high requirements on the computing power of the chip, and the loss to the real-time performance of the data is even greater. Summary of the invention

[0013] In view of the above-mentioned shortcomings of the prior art, the purpose of the present application is to provide a combined filtering method applied to a high-precision weighing sensor, so as to solve the technical problem that the existing weighing filtering is difficult to be compatible in terms of real-time performance and stability.

[0014] To achieve the above-mentioned purpose and other related purposes, the first aspect of the present application provides a combined filtering method applied to a high-precision weighing sensor, including: in the first stage of filtering, a gain value is calculated based on the process noise value, the measurement noise value and the measurement variance; the weighing value after filtering is calculated based on the gain value and the weighing value after the last filtering and the weighing value to be filtered this time; in the second stage of filtering, the weighing value after filtering this time obtained in the first stage is used as the input value of the second stage of filtering, and the weighing value after filtering this time is compared with the current effective value; a filter counter is used to accumulate the number of times the weighing value after filtering this time is not equal to the current effective value, and when the accumulated number of times exceeds the counting upper limit of the filter counter, the latest weighing value after filtering this time replaces the current effective value.

[0015] In some embodiments of the first aspect of the present application, the gain value is calculated based on the process noise value, the measurement noise value and the measurement variance, and the calculation method includes: K = (P+Q) / (P+Q+R); wherein K represents the gain value; P represents the measurement variance; Q represents the process noise; and R represents the measurement noise.

[0016] In some embodiments of the first aspect of the present application, after obtaining the gain value, the following is also performed: updating the measurement variance according to the gain value for use in the next gain value calculation; wherein, the method of updating the measurement variance according to the gain value includes: P'=(1-K)*P; P' represents the updated measurement variance; P represents the current measurement variance.

[0017] In some embodiments of the first aspect of the present application, the weighing value after filtering is calculated based on the gain value, the weighing value after the last filtering, and the weighing value to be filtered this time, including: D=LD+K*(AD-LD); wherein D represents the weighing value after filtering this time; LD represents the weighing value after the last filtering; AD represents the weighing value to be filtered this time; and K represents the gain value.

[0018] In some embodiments of the first aspect of the present application, the following is performed before executing the second-level filtering: an initial value of a count value C of a filter counter and a count upper limit value N are set; the count upper limit value N depends on the number of bits of the filter counter.

[0019] In some embodiments of the first aspect of the present application, a filter counter is used to accumulate the number of times that the weighing value after filtering is not equal to the current effective value, and when the accumulated number of times exceeds the counting upper limit of the filter counter, the latest weighing value after filtering replaces the current effective value, including: after comparing the weighing value after filtering and the current effective value, if the two values ​​are the same, the count value C is cleared, otherwise the count value C is increased by 1; if the count value C is less than the counting upper limit N, the current effective value continues to be output; if the count value C is greater than or equal to the counting upper limit N, the current effective value is replaced by the latest weighing value after filtering, and it is output, and the count value C is cleared.

[0020] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present application provides a high-precision weighing device based on combined filtering, including: a first-level filtering module, used to calculate a gain value based on a process noise value, a measurement noise value and a measurement variance; calculate a current filtered weighing value based on the gain value and the last filtered weighing value and the current filtered weighing value; a second-level filtering module, used to use the current filtered weighing value obtained in the first stage as the input value of the second stage filtering, and compare the current filtered weighing value with the current effective value; use a filter counter to accumulate the number of times the current filtered weighing value is not equal to the current effective value, and when the accumulated number exceeds the counting upper limit of the filter counter, the latest current filtered weighing value replaces the current effective value.

[0021] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present application provides a high-precision weighing system based on combined filtering, including: a weighing sensor, used to collect analog weighing data of an object to be weighed; an AD chip, electrically connected to the weighing sensor, used to amplify and perform analog-to-digital conversion on the analog weighing data to obtain corresponding digital weighing data; a single-chip microcomputer, electrically connected to the AD chip, used to filter the digital weighing data by executing the combined filtering method after receiving the digital weighing data.

[0022] To achieve the above-mentioned purpose and other related purposes, the fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the combined filtering method applied to a high-precision weighing sensor is implemented.

[0023] To achieve the above-mentioned purpose and other related purposes, the fourth aspect of the present application provides an electronic terminal, including: a processor and a memory; the memory is used to store computer programs, and the processor is used to execute the computer programs stored in the memory, so that the terminal executes the combined filtering method applied to high-precision weighing sensors.

[0024] As described above, the combined filtering method, device, system and medium applied to high-precision weighing sensors of the present application have the following beneficial effects: In the actual high-precision digital weighing sensor filtering design, the present invention abandons a single filtering method and uses a two-stage filtering algorithm, thereby being able to take into account the real-time and stability of the weighing values, and the technical solution of the present invention has been proven through experiments and practical applications to be a feasible weighing filtering solution. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 Shown is a flow chart of a combined filtering method applied to a high-precision weighing sensor in one embodiment of the present application.

[0026] Figure 2 Shown is a schematic diagram of the weighing process and principle of a weighing sensor in one embodiment of the present application.

[0027] Figure 3A Shown is a schematic diagram of a static weighing experiment result in one embodiment of the present application.

[0028] Figure 3B Shown is a schematic diagram of a static weighing experiment result in one embodiment of the present application.

[0029] Figure 3C Shown is a schematic diagram of a static weighing experiment result in one embodiment of the present application.

[0030] Figure 4 Shown is a schematic diagram of the structure of an electronic terminal in one embodiment of the present application.

[0031] Figure 5 Shown is a schematic diagram of the structure of a combined filtering device applied to a high-precision weighing sensor in one embodiment of the present application. DETAILED DESCRIPTION

[0032] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0033] It should be noted that in the following description, with reference to the accompanying drawings, several embodiments of the present application are described in the accompanying drawings. It should be understood that other embodiments may also be used, and mechanical composition, structure, electrical and operational changes may be made without departing from the spirit and scope of the present application. The following detailed description should not be considered restrictive, and the scope of the embodiments of the present application is limited only by the claims of the published patents. The terms used here are only for describing specific embodiments and are not intended to limit the present application. Spatially related terms, such as "upper", "lower", "left", "right", "below", "below", "lower", "above", "upper", etc., may be used in the text to facilitate the description of the relationship between an element or feature shown in the figure and another element or feature.

[0034] In this application, unless otherwise clearly specified and limited, the terms "install", "connect", "connect", "fix", "hold" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0035] Furthermore, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless there is an indication to the contrary in the context. It should be further understood that the terms "comprise", "include" indicate the presence of the described features, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Therefore, "A, B or C" or "A, B and / or C" means "any of the following: A; B; C; A and B; A and C; B and C; A, B and C". Exceptions to this definition will only occur when the combination of elements, functions or operations is inherently mutually exclusive in some way.

[0036] In order to solve the problems in the above background technology, the present invention provides a combined filtering algorithm applied to a high-precision weighing sensor, aiming to improve the stability of weighing data while ensuring the real-time performance of the data. The combined filtering algorithm in the present invention includes a two-stage filter, the first-stage filter is used for basic data smoothing and tracking of data changes, and the second-stage filter is used for further smoothing the output data of the first-stage filter.

[0037] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the technical solution in the embodiments of the present invention is further described in detail through the following embodiments and in combination with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the invention.

[0038] Before further describing the present invention in detail, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are applicable to the following interpretations:

[0039] 1) Process noise: Due to external environmental factors, the object does not move in a strictly uniform linear motion as expected. That is, due to the influence of the external environment, the object's motion is not completely aligned with the motion equation. This error in the dynamic model is called process noise.

[0040] 2) Measurement noise: refers to the noise in the measurement process. The error contained in the measurement is called measurement noise.

[0041] 3) Weighing sensor: A device that converts mass signals into measurable electrical signal outputs. It is a force sensor used on weighing instruments. It can convert the gravity acting on the measured object into a measurable output signal in a certain proportion. Weighing sensors are divided into photoelectric, hydraulic, electromagnetic, capacitive, magnetic pole change, vibration, gyroscopic, and resistance strain type according to the conversion method.

[0042] like Figure 1 As shown, a schematic diagram of the flow chart of the combined filtering method applied to the high-precision weighing sensor in the embodiment of the present invention is shown. The combined filtering method applied to the high-precision weighing sensor in this embodiment includes a two-stage filtering algorithm, and the specific steps are as follows:

[0043] Step S11: In the first stage of filtering, a gain value is calculated based on the process noise value, the measurement noise value and the measurement variance; and a weighing value after filtering is calculated based on the gain value and the weighing value after the last filtering and the weighing value to be filtered this time.

[0044] It is understandable that the larger the process noise Q is, the higher the real-time performance of the final weighing value will be, but the stability of the weighing value will be lower; the larger the measurement noise R is, the higher the stability of the weighing value will be, but the real-time performance of the weighing value will be lower. Therefore, the process noise Q and measurement noise P need to be set according to different environments to achieve a balance between the real-time performance and stability of the weighing value.

[0045] For ease of understanding, now combined Figure 2 To explain the weighing process and principle of digital weighing sensors: the weighing sensor collects weighing analog data and transmits it to the AD chip, which amplifies the analog signal and converts it into a digital signal. The digital signal is transmitted to the microcontroller and filtered using a software filtering algorithm, and finally the filtering outputs the AD value.

[0046] In this embodiment, K is used to represent the gain value, P is used to represent the measurement variance, the initial value of the measurement variance P is set to 10, and the gain value K is calculated as follows:

[0047] K = (P + Q) / (P + Q + R); Formula (1)

[0048] Furthermore, after obtaining the gain value, the following is further performed: updating the measurement variance according to the gain value for the next gain value calculation, and the specific calculation method is as follows:

[0049] P'=(1-K)*P;Formula (2)

[0050] Wherein, P' represents the updated measurement variance; P represents the current measurement variance.

[0051] In this embodiment, the weighing value after filtering is calculated according to the gain value, the weighing value after the last filtering, and the weighing value to be filtered this time, which means: D is used to represent the weighing value after filtering this time, LD is used to represent the weighing value after the last filtering, and AD is used to represent the weighing value to be filtered this time. Therefore, the calculation method of the weighing value D after filtering this time is as follows:

[0052] D=LD+K*(AD-LD); Formula (3)

[0053] Step S12: In the second stage filtering, the weighing value after filtering obtained in the first stage is used as the input value of the second stage filtering, and the weighing value after filtering is compared with the current effective value; a filter counter is used to accumulate the number of times that the weighing value after filtering is not equal to the current effective value, and when the accumulated number of times exceeds the counting upper limit of the filter counter, the latest weighing value after filtering is used to replace the current effective value.

[0054] It can be understood that the filter counter is a type of counter. In the digital system, it mainly counts the number of pulses to achieve the functions of measurement, counting and control. The counter is usually composed of a basic counting unit and some control gates, and the technical unit is composed of a series of various triggers with information storage functions, such as RS triggers, T triggers, D triggers and JK triggers. The number of digits of the counter is usually 3-digit counters and 4-digit counters. The maximum display of the 3-digit counter is 999, and the maximum display of the 4-digit counter is 9999.

[0055] In this embodiment, in the second stage filtering, the following is performed before executing the second stage filtering: the initial value of the count value C of the filter counter and the count upper limit value N are set, for example, the initial value C=0 and the count upper limit value N=999.

[0056] Furthermore, a filter counter is used to accumulate the number of times that the weighing value after filtering is not equal to the current effective value, and when the accumulated number of times exceeds the counting upper limit of the filter counter, the latest weighing value after filtering replaces the current effective value, which specifically means: after comparing the weighing value after filtering and the current effective value, if the two values ​​are the same, the count value C is cleared, otherwise the count value C is increased by 1; if the count value C is less than the counting upper limit N at this time, the current effective value continues to be output; if the count value C is greater than or equal to the counting upper limit N at this time, the current effective value is replaced by the latest weighing value after filtering, and it is output, and the count value C is cleared at the same time.

[0057] In order to further facilitate those skilled in the art to understand the principle and effect of the technical solution of the present invention, the present invention will be described in conjunction with the following experimental examples:

[0058] In this experimental example, a high-precision CS1237 chip is used as an AD chip, and an STM32F407c8t6 is used as a single-chip microcomputer chip. The two-stage filtering algorithm in the embodiment of the present invention is implemented on the chip system using C language. It can be understood that the high-precision CS1237 chip is a high-precision and low-power analog-to-digital conversion chip.

[0059] This experimental example performed static weighing experiments and dynamic weighing experiments respectively, and statistically analyzed the relevant data. Figure 3A , 3B and the data shown in 3C, where Figures 3A to 3C These are the results of static weighing experiments, and the results of dynamic weighing experiments are not shown in the figure; the horizontal axis in these figures represents the number of AD acquisitions (about once every 50ms), and the vertical axis represents the AD value (here, each AD value fluctuation of 1 corresponds to a weighing fluctuation of about 0.08 grams).

[0060] from Figures 3A to 3CIt can be seen that the original AD data presents a straight line after two-stage filtering, and the stability is improved compared with the original data. In the dynamic weighing experiment results, after the original AD data is filtered at the second level, the data is stable and does not affect the real-time performance.

[0061] It can be seen from the above experimental examples that in the actual high-precision digital weighing sensor filter design, the present invention abandons a single filtering method and uses a two-stage filtering algorithm, so as to take into account the real-time and stability of the weighing value. The technical solution of the present invention has been proved to be a feasible weighing filtering solution through experiments and practical applications.

[0062] The combined filtering method for high-precision weighing sensors provided in the embodiments of the present application can be applied to electronic devices. The following introduces electronic devices and embodiments for using such electronic devices. The electronic devices of the embodiments of the present application can be, for example, tablet computers, mobile phones, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), wearable devices, Internet of Things (IoT) devices, car machines, etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices. In some embodiments, the electronic device can support a stylus.

[0063] See also Figure 4 , is an optional hardware structure diagram of an electronic device 400 provided in an embodiment of the present invention. The device 400 may be a mobile phone, a computer device, a tablet device, a personal digital processing device, a factory background processing device, etc. The electronic device 400 includes: at least one processor 401, a memory 402, at least one network interface 404 and a user interface 406. The various components in the device are coupled together through a bus system 405. It can be understood that the bus system 405 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 405 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, various buses are marked as bus systems in FIG. 3.

[0064] The user interface 406 may include a display, a keyboard, a mouse, a trackball, a click gun, keys, buttons, a touch pad or a touch screen.

[0065] It is understood that the memory 402 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM). The memory described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable categories of memory.

[0066] The memory 402 in the embodiment of the present invention is used to store various categories of data to support the operation of the XX device 400. Examples of these data include: any executable program used to operate on the electronic device 400, such as an operating system 4021 and an application 4022; the operating system 4021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application 4022 may include various applications, such as a media player (MediaPlayer), a browser (Browser), etc., for implementing various application services. The implementation of the XX method provided in the embodiment of the present invention may be included in the application 4022.

[0067] The method disclosed in the above embodiment of the present invention can be applied to the processor 401, or implemented by the processor 401. The processor 401 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 401 or the instruction in the form of software. The above processor 401 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 401 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general processor 401 may be a microprocessor or any conventional processor, etc. In combination with the steps of the accessory optimization method provided in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0068] In an exemplary embodiment, the electronic device 400 may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD) to execute the aforementioned method.

[0069] like Figure 5 , which shows a schematic diagram of the structure of a high-precision weighing device based on combined filtering in an embodiment of the present invention. The high-precision weighing device 500 in this embodiment includes a primary filtering module 501 and a secondary filtering module 502.

[0070] The first-level filtering module 501 is used to calculate the gain value according to the process noise value, the measurement noise value and the measurement variance; and calculate the current filtered weighing value according to the gain value, the weighing value after the last filtering and the weighing value to be filtered this time. The second-level filtering module 502 is used to use the weighing value after the current filtering obtained in the first level as the input value of the second-level filtering, and compare the weighing value after the current filtering with the current effective value; use a filtering counter to accumulate the number of times the weighing value after the current filtering is not equal to the current effective value, and when the accumulated number exceeds the counting upper limit of the filtering counter, the latest weighing value after the current filtering replaces the current effective value.

[0071] It should be noted that: the combined filtering device applied to the high-precision weighing sensor provided in the above embodiment only uses the division of the above-mentioned program modules as an example when performing combined filtering applied to the high-precision weighing sensor. In actual applications, the above-mentioned processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the combined filtering device applied to the high-precision weighing sensor provided in the above embodiment and the embodiment of the combined filtering method applied to the high-precision weighing sensor belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0072] The embodiment of the present invention also provides a high-precision weighing system based on combined filtering, including: a weighing sensor for collecting analog weighing data of an object to be weighed; an AD chip electrically connected to the weighing sensor for amplifying and converting the analog weighing data to obtain corresponding digital weighing data; a single-chip microcomputer electrically connected to the AD chip for executing the combined filtering method applied to the high-precision weighing sensor after receiving the digital weighing data. Since the implementation process and principle of the embodiment of the present invention are similar to the combined filtering method applied to the high-precision weighing sensor mentioned above, they will not be described in detail.

[0073] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

[0074] In the embodiments provided in the present application, the computer readable and writable storage medium may include a read-only memory, a random access memory, an EEPROM, a CD-ROM or other optical disk storage device, a disk storage device or other magnetic storage device, a flash memory, a USB flash drive, a mobile hard disk, or any other medium that can be used to store a desired program code in the form of an instruction or data structure and can be accessed by a computer. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if the instruction is sent from a website, a server or other remote source using a coaxial cable, an optical fiber cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, the coaxial cable, optical fiber cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of the medium. However, it should be understood that computer readable and writable storage media and data storage media do not include connections, carriers, signals, or other temporary media, but are intended to be non-temporary, tangible storage media. Disk and disc, as used in this application, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.

[0075] Based on the above embodiments, the present application further provides a computer program product comprising instructions, and when the computer program product is run on a computer, the computer is enabled to execute the methods described in the embodiments of the present application.

[0076] Based on the above embodiments, the present application further provides a chip, which is used to read a computer program stored in a memory to implement the methods described in the embodiments of the present application.

[0077] Based on the above embodiments, the present application provides a chip system, which includes a processor for supporting a computer device to implement the methods described in the embodiments of the present application. In one possible design, the chip system also includes a memory, which is used to store the necessary programs and data for the computer device. The chip system can be composed of a chip, or it can include a chip and other discrete devices.

[0078] In summary, the present application provides a combined filtering method, device, terminal and medium for high-precision weighing sensors. In the actual high-precision digital weighing sensor filtering design, the present invention abandons a single filtering method and uses a two-stage filtering algorithm, so that the real-time and stability of the weighing value can be taken into account. The technical solution of the present invention has been proved to be a feasible weighing filtering solution through experiments and practical applications. Therefore, the present application effectively overcomes various shortcomings in the prior art and has a high industrial utilization value.

[0079] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A combined filtering method applied to a high-precision weighing sensor, characterized in that: include: In the first stage of filtering, the gain value is calculated based on the process noise value, the measurement noise value and the measurement variance; The weighing value after filtering is calculated according to the gain value, the weighing value after last filtering, and the weighing value to be filtered this time; In the second stage of filtering, the weighing value after filtering obtained in the first stage is used as the input value of the second stage of filtering, and the weighing value after filtering is compared with the current effective value; A filter counter is used to accumulate the number of times that the weighing value after filtering is not equal to the current effective value, and when the accumulated number exceeds the counting upper limit of the filter counter, the latest weighing value after filtering is used to replace the current effective value; The gain value is calculated according to the process noise value, the measurement noise value and the measurement variance, and the calculation method includes: K=(P+Q) / (P+Q+R); wherein K represents the gain value; P represents the measurement variance; Q represents the process noise; and R represents the measurement noise; After obtaining the gain value, the following is further performed: updating the measurement variance according to the gain value for the next gain value calculation; wherein the method of updating the measurement variance according to the gain value includes: P'=(1-K)*P; wherein P' represents the updated measurement variance; and P represents the current measurement variance; The weighing value after filtering is calculated based on the gain value, the weighing value after the last filtering, and the weighing value to be filtered this time, including: D=LD+K*(AD-LD); wherein D represents the weighing value after filtering this time; LD represents the weighing value after the last filtering; AD represents the weighing value to be filtered this time; and K represents the gain value.

2. The combined filtering method applied to a high-precision weighing sensor according to claim 1, characterized in that: Before executing the second level filtering, the following is performed: the initial value of the count value C of the filter counter and the count upper limit value N are set; the count upper limit value N depends on the number of bits of the filter counter.

3. The combined filtering method applied to a high-precision weighing sensor according to claim 1, characterized in that: The method uses a filter counter to accumulate the number of times that the weighing value after filtering is not equal to the current effective value, and when the accumulated number exceeds the upper limit of the filter counter, the latest weighing value after filtering replaces the current effective value, including: After comparing the weighing value after filtering this time with the current effective value, if the two values ​​are the same, the count value C is cleared, otherwise the count value C is increased by 1; if the count value C is less than the counting upper limit value N, the current effective value continues to be output; if the count value C is greater than or equal to the counting upper limit value N, the current effective value is replaced by the latest weighing value after filtering this time, and it is output, and the count value C is cleared.

4. A high-precision weighing device based on combined filtering, characterized in that: include: The first-level filtering module is used to calculate the gain value according to the process noise value, the measurement noise value and the measurement variance; The weighing value after filtering is calculated according to the gain value, the weighing value after last filtering, and the weighing value to be filtered this time; The secondary filtering module is used to use the weighing value after filtering obtained in the first stage as the input value of the second stage filtering, and compare the weighing value after filtering with the current effective value; A filter counter is used to accumulate the number of times that the weighing value after filtering is not equal to the current effective value, and when the accumulated number exceeds the counting upper limit of the filter counter, the latest weighing value after filtering is used to replace the current effective value; The gain value is calculated according to the process noise value, the measurement noise value and the measurement variance, and the calculation method includes: K=(P+Q) / (P+Q+R); wherein K represents the gain value; P represents the measurement variance; Q represents the process noise; and R represents the measurement noise; After obtaining the gain value, the following is further performed: updating the measurement variance according to the gain value for the next gain value calculation; wherein the method of updating the measurement variance according to the gain value includes: P'=(1-K)*P; wherein P' represents the updated measurement variance; and P represents the current measurement variance; The weighing value after filtering is calculated based on the gain value, the weighing value after the last filtering, and the weighing value to be filtered this time, including: D=LD+K*(AD-LD); wherein D represents the weighing value after filtering this time; LD represents the weighing value after the last filtering; AD represents the weighing value to be filtered this time; and K represents the gain value.

5. A high-precision weighing system based on combined filtering, characterized in that: include: A weighing sensor, used to collect simulated weighing data of the object to be weighed; AD chip, electrically connected to the weighing sensor, for amplifying and converting the analog weighing data into analog-to-digital data to obtain corresponding digital weighing data; A single chip microcomputer is electrically connected to the AD chip and is used for filtering the digital weighing data by executing the combined filtering method according to any one of claims 1 to 3 after receiving the digital weighing data.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the combined filtering method applied to a high-precision weighing sensor as claimed in any one of claims 1 to 3 is implemented.

7. An electronic device, characterized in that: The invention comprises at least one processor, wherein the at least one processor is coupled to at least one memory, and the at least one processor is used to read a computer program stored in the at least one memory to execute the combined filtering method applied to a high-precision weighing sensor as claimed in any one of claims 1 to 3.