An Automatic Acquisition Method and System for Weighing Values of a Balance

By generating polynomials and error byte determination polynomials, the balance weighing value is automatically obtained, which solves the problem of inefficiency in the acquisition of balance weighing data, and realizes fast and accurate automatic acquisition of balance weighing value.

CN119621003BActive Publication Date: 2025-06-03JIANGSU ENTRY-EXIT INSPECTION & QUARANTINE BUREAU IND PROD TESTING CENT
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510147584.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-11
Publication Date
2025-06-03
Estimated Expiration
2045-02-11

AI Technical Summary

Technical Problem

In the prior art, when using intelligent optimization algorithms to obtain balance weighing data, there are problems such as slow convergence speed, many control variables, and complex algorithm termination criteria, which makes it difficult to quickly obtain weighing results when facing heavy weighing tasks.

Method used

By obtaining the weighing value transmitted by the balance, encoding and computing to generate a polynomial, determining whether there is an incorrect byte, re-reading the weighing value if it does not exist, decoding and automatically obtaining the weighing value data.

Benefits of technology

It avoids the inefficiency caused by intelligent optimization algorithms, takes into account the efficiency and accuracy of automatic acquisition of balance weighing value data, and reduces the time for false byte detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621003B_ABST
    Figure CN119621003B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for automatically obtaining weighing values of a balance, belonging to the technical field of data processing. A set of weighing values transmitted by the balance is obtained and encoded, the power sum function is calculated based on the generated polynomial after encoding, then an error byte determination polynomial is constructed based on the above power sum function, whether there is an error byte is judged according to the error byte determination polynomial, and finally, according to the judgment result, it is decided whether to re-read another set of weighing values transmitted by the balance. The present invention uses the decomposable feature of the error byte determination polynomial to judge whether there is an error byte in the automatically obtained weighing values of the balance, avoiding problems such as slow convergence speed, many control variables, and complex algorithm termination criteria brought by the intelligent optimization algorithm in the prior art, and taking into account the efficiency and accuracy of the automatic acquisition of balance weighing value data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data processing, and particularly relates to a method and system for automatically obtaining the weighing value of a balance. Background Art

[0002] The weighing value of a balance, as a key parameter, plays a crucial role in the calculation, evaluation, and traceability of the test results of samples to be weighed. In the laboratory testing of mineral products, it is often necessary to use an electronic balance to weigh a large number of mineral samples. For example, in the moisture detection of imported copper concentrate, multiple weighing operations are required. Generally, one sample is taken every 500 tons and multiple moisture determinations are carried out on this sample separately. Taking a batch of 10,000 tons of copper concentrate as an example, 20 sub-samples need to be taken, and 2 test specimens are extracted from each sub-sample for moisture determination. For a single moisture determination, it is necessary to weigh and record the mass of the sample tray, the mass of the sample tray and the specimen before drying, the mass of the sample tray and the specimen after drying, and at least one weighing for constant weight verification, that is, a single specimen requires at least 4 weighings for moisture determination, and the whole batch requires 160 weighings and records. In the traditional operation mode, the numerous weighing times pose a huge challenge and pressure to the manual recording of inspectors. Each time an inspector records, they need to repeatedly and carefully check whether the balance reading is consistent with the recorded value, which is time-consuming and laborious, and it is also very difficult to achieve subsequent data traceability verification.

[0003] In the prior art, a variety of methods for automatically reading balance weighing data have been disclosed. For example, in the patent document with the publication number CN106815428A, intelligent optimization algorithms such as genetic algorithm, particle swarm optimization algorithm, differential evolution algorithm, simulated plant growth algorithm, fruit fly algorithm, etc. are used to optimize the independent variables of the balance component equations to improve the quality of weighing data processing; in the patent document with the publication number CN115752666A, a multi-strategy wolf pack algorithm is used to predict the dynamic weighing of the electronic balance of tobacco leaves through the improved wolf pack algorithm's ELM neural network, improving the problem that the ELM neural network is prone to falling into local optimum and enhancing the accuracy of the dynamic weighing of tobacco leaves. After the applicant's retrieval, it is found that the existing methods for automatically reading balance data mostly rely on intelligent optimization algorithms, and intelligent optimization algorithms represented by the above genetic algorithm, particle swarm optimization algorithm, differential evolution algorithm, simulated plant growth algorithm, fruit fly algorithm, wolf pack algorithm, etc. all have common problems such as slow convergence speed, many control variables, and complex algorithm termination criteria. When faced with heavy weighing tasks, intelligent optimization algorithms often consume a large amount of time and are difficult to quickly obtain weighing results. Therefore, how to balance the efficiency and accuracy of automatically obtaining the weighing value of a balance is a problem that needs to be considered. Summary of the Invention

[0004] To solve the above problems existing in the prior art, the present invention proposes a method and system for automatically obtaining the weighing value of a balance, so as to solve the problems of slow convergence speed, many control variables, and complex algorithm termination criteria when using intelligent optimization algorithms to obtain balance weighing data in the prior art, thereby taking into account the efficiency and accuracy of automatically obtaining balance weighing value data.

[0005] To achieve the above object, the present invention adopts the following technical solutions: A method for automatically obtaining the weighing value of a balance, the method comprising the steps of: S1: obtaining a set of weighing values transmitted by the balance; S2: encoding the weighing values transmitted by the balance obtained in S1; S3: calculating the generating polynomial of the encoded weighing values transmitted by the balance; S4: based on the generating polynomial calculated in S3, determining whether there is an error byte; if there is, execute S5, if not, execute S6; S5: re-reading another set of weighing values transmitted by the balance, and executing S2; S6: decoding the encoded weighing values transmitted by the balance in S2, and transmitting them to the data reading module for automatically obtaining the weighing values transmitted by the balance.

[0006] Further, the basic form of the generating polynomial in S3 is:

[0007] ;

[0008] where GP(x) represents the generating polynomial, x represents the polynomial unknown, r represents the length of the information redundancy bit, gp 1 、gp r-1 、gp r-2 represent binary code numbers.

[0009] Further, in S4, based on the generating polynomial calculated in step S3, determining whether there is an error byte, specifically: S41: calculating the power sum function based on the roots of the generating polynomial calculated in S3:

[0010] ;

[0011] where k represents the number of consecutive powers, S k represents the power sum function with k consecutive powers, α represents the primitive element of the GF field, j 0 ……j v-1 represents the bit position to be determined whether there is an error byte, v represents the bit position number and v ≤ k / 2, where k / 2 represents the number of error bytes, is the root of the generating polynomial;

[0012] S42: constructing an error byte determination polynomial based on the power sum function, and determining whether there is an error byte according to the error byte determination polynomial.

[0013] Further, in S42, constructing an error byte determination polynomial based on the power sum function specifically includes:

[0014] ;

[0015] where EL(x) represents the error byte determination polynomial, and σ 1 ……σ v represents the coefficients of the error byte determination polynomial.

[0016] Further, the coefficients of the error byte determination polynomial are solved according to the following formula:

[0017] ;

[0018] where m represents the odd serial number of the power sum function, m = 1, 3, 5 ……, S 1 represents the power sum function with 1 consecutive power, S 2 represents the power sum function with 2 consecutive powers, S m represents the power sum function with m consecutive powers.

[0019] Further, in S42, determining whether there is an error byte according to the error byte determination polynomial specifically includes: if the error byte determination polynomial is an irreducible polynomial, or the roots of the error byte determination polynomial do not belong to the set of roots of the generating polynomial, it indicates that there is no error byte; if the error byte determination polynomial is a decomposable polynomial and the roots of the error byte determination polynomial belong to the set of roots of the generating polynomial, it indicates that there is an error byte.

[0020] According to another aspect of the present invention, there is also provided an automatic acquisition system for the weighing value of a balance, including a balance weighing value reading module, an error byte judgment module, and a data reading module. The input end of the balance weighing value reading module is connected to the data output end of the electronic balance, the output end of the balance weighing value reading module is connected to the input end of the error byte judgment module, and the output end of the error byte judgment module is connected to the input end of the data reading module; the electronic balance is connected to the balance weighing value reading module through an RS232 serial port and an RS9 data line. This system is used to implement the aforementioned automatic acquisition method for the weighing value of a balance.

[0021] The beneficial technical effects of the present invention compared with the prior art are as follows: using the power sum function calculated by the generating polynomial to construct an error byte determination polynomial, and judging whether there is an error byte in the automatically acquired weighing value of the balance based on the decomposable characteristics of the error byte determination polynomial, avoiding problems such as slow convergence speed, many control variables, and complex algorithm termination criteria brought by the intelligent optimization algorithm in the prior art, and taking into account both the efficiency and accuracy of the automatic acquisition of balance weighing value data. Brief Description of the Drawings

[0022] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings described below are only exemplary. For those of ordinary skill in the art, without creative efforts, other implementation drawings can be obtained by extending the provided drawings.

[0023] Figure 1 It is a flowchart of a method for automatically obtaining the weighing value of a balance provided in the first embodiment of the present invention;

[0024] Figure 2 It is a structural schematic diagram of a system for automatically obtaining the weighing value of a balance provided in the second embodiment of the present invention. Specific embodiments

[0025] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of them. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0026] The following first explains the concepts involved in this application with reference to the drawings. It should be noted here that the following explanations of each concept are only for making the content of this application easier to understand, and do not represent a limitation on the protection scope of this application; at the same time, without conflict, the embodiments in this application and the features in the embodiments can be combined with each other. The following will detail this application with reference to the drawings and in combination with the embodiments.

[0027] Combined with the specification drawings Figure 1 , the present invention provides a method for automatically obtaining the weighing value of a balance, which specifically includes: Step S1: Obtain a set of weighing values transmitted by the balance. After the interface mode of the balance is set to the data transmission mode and the setting is successful, the balance can continuously send data to the computer. At this time, obtain a set of weighing values transmitted by the balance; in the present invention, METTLER TOLEDO PL6001E or ME4002E balances are used. Both balances have RS232 serial ports, and an RS9 data cable can be used to connect the balance to the computer. Program codes can be written using appropriate programming languages (Visual Basic, Visual C++, Delphi, Java) and related controls (MSComm, SPCOMM) to realize the reading of the weighing value data of the balance. Step S2: Encode the weighing values transmitted by the balance obtained in Step S1. Step S3: Calculate the generating polynomial of the encoded weighing values transmitted by the balance; the basic form of the generating polynomial is as follows:

[0028] ;

[0029] where GP(x) represents the generating polynomial, x represents the polynomial unknown, r represents the length of the information redundancy bits, gp 1 , gp r-1 , gp r-2 represent binary code numbers, satisfying 2r ≥ mes + r + 1, where mes represents the length of the information bits. It can be understood that the above binary code numbers are binary codes of 0 or 1, and the binary code numbers described above can be, for example, 100110.

[0030] Step S4: Based on the generating polynomial calculated in step S3, determine whether there is an error byte; if there is, execute step S5, if not, execute step S6; the specific steps for determining whether there is an error byte are as follows:

[0031] Step S41: Based on the roots of the generating polynomial calculated in step S3, calculate the power sum function:

[0032] ;

[0033] where k represents the degree of consecutive powers, S k represents the power sum function with k consecutive powers, α represents the primitive element of the GF field, j 0 ... j v-1 represents the bit position to be determined whether there is an error byte, v represents the bit position serial number and v ≤ k / 2, where k / 2 represents the number of error bytes, is the root of the generating polynomial;

[0034] Step S42: Based on the power sum function, construct an error byte determination polynomial, and the error byte determination polynomial is constructed in the following form:

[0035] ;

[0036] where EL(x) represents the error byte determination polynomial, σ 1 ... σ v represents the error byte determination polynomial coefficient. The above error byte determination polynomial coefficient is solved according to the following formula:

[0037] ;

[0038] where m represents the odd serial number of the power sum function, m takes odd numbers, that is, m = 1, 3, 5..., S 1 represents the power sum function with 1 consecutive power, S 2 represents the power sum function with 2 consecutive powers, S m represents the power sum function with m consecutive powers.

[0039] In step S42, it is determined whether there is an error byte according to the error byte determination polynomial. Specifically, if the error byte determination polynomial is an irreducible polynomial, or the roots of the error byte determination polynomial do not belong to the set of roots of the generator polynomial, it indicates that there is no error byte. If the error byte determination polynomial is a decomposable polynomial and the roots of the error byte determination polynomial belong to the set of roots of the generator polynomial, it indicates that there is an error byte. The above error byte may be caused by an abnormality in the storage unit in the computer or the data transmission channel. It should be noted that when there is an error byte in the transmitted weighing value data of the balance, the transmitted weighing value data of the balance is equivalent to a model in which a set of correct weighing value data of the balance is superimposed on a set of noise weighing value data of the balance. In the GF field (finite field), the error byte determination polynomial constructed only by the correct weighing value data of the balance can be decomposed, and the error byte determination polynomial can be expressed as the least common multiple of the minimal polynomials of the roots of the generator polynomial. Therefore, the roots of the solved error byte determination polynomial must belong to the set of roots of the generator polynomial; when there is an error byte, the equivalent noise data cannot be decomposed, or even if it can be decomposed, its corresponding roots do not belong to the set of roots of the generator polynomial. Therefore, it can be determined whether there is an error byte in the transmitted weighing value data of the balance by determining whether the error byte determination polynomial is decomposable and whether its roots belong to the set of roots of the generator polynomial, without using the complex intelligent optimization algorithm in the prior art, saving the time for detecting the error byte in the data and taking into account the efficiency and accuracy of the automatic acquisition of the weighing value data of the balance.

[0040] Step S5: Re-read the weighing values transmitted by another set of balances and execute step S2; when there is an error byte in the weighing value data of the balance, this set of data needs to be discarded and a new set of weighing values transmitted by the balance needs to be re-read to ensure the correctness of the data.

[0041] Step S6: Decode the weighing values transmitted by the balance encoded in step S2, and use the decoding rule corresponding to the encoding rule to decode the weighing value data, such as CRC encoding and CRC decoding. Then transmit the decoded data to the data reading module to automatically obtain the weighing values transmitted by the balance.

[0042] As shown in the attached Figure 2As shown in the figure, the present invention also provides an automatic acquisition system for the weighing value of a balance. The system implements the automatic acquisition method for the weighing value of the balance described above. The automatic acquisition system for the weighing value of the balance includes a weighing value reading module, an error byte judgment module, and a data reading module. The input end of the weighing value reading module is connected to the data output end of the electronic balance. The output end of the weighing value reading module is connected to the input end of the error byte judgment module. The output end of the error byte judgment module is connected to the input end of the data reading module. In this embodiment, the weighing value reading module and the data reading module are implemented through a web page. The web page can control the connection and disconnection of the balance, the real-time display of the balance reading, the recording of the balance reading in a table, the dynamic increase and decrease of the recording table, and the export of the recorded data with a specified name. Specifically, when the weighing value reading module determines that the serial port connection of the balance is successful, it calls the readable of the port object in the web page program to obtain the data stream. At this time, the locked state of the readable is true. The reader is created using the method "reader = port.readable.getReader()" and the binary data is obtained using "{ value, done} = await reader.read()". The conversion between binary data and strings is completed by connecting the reading stream of the serial port and the writing stream of the textDecoder through the data channel. The data reading module is used to trigger the "record" event of the page when the balance reading is stable, execute the custom "save(this)" method, and the carried this parameter refers to the "record" button object. The page is obtained through "w = document.getElementById("show").innerHTML" The "weight" in the label, then capture the element in the column of weighing mass of this row through the button object, use the "text(w)" method to set the text content of the element to w, and record the current time in the column of weighing time.

[0043] The above-described embodiments and / or implementation manners are only used to illustrate the preferred embodiments and / or implementation manners for implementing the technology of the present invention, and do not impose any formal restrictions on the implementation manners of the technology of the present invention. Any person skilled in the art, without departing from the scope of the technical means disclosed in the content of the present invention, may make some modifications or changes to other equivalent embodiments, but should still be regarded as the same technology or embodiment as the essence of the present invention.

[0044] In this article, specific examples are used to elaborate on the principles and implementation manners of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. The above is only the preferred implementation manner of the present application. It should be noted that due to the limited nature of language expression and objectively existing infinite specific structures, for those of ordinary skill in the art, without departing from the principle of the present application, several improvements, refinements or changes can also be made, or the above technical features can be combined in an appropriate manner; these improvements, refinements, changes or combinations, or directly applying the concept and technical solution of the invention to other occasions without improvement, should all be regarded as the protection scope of the present application.

Claims

1. A method for automatically obtaining a balance weighing value, characterized in that: The specific steps include: S1: Get a set of weighing values ​​transmitted by a balance; S2: Encode the weighing value transmitted by the balance obtained by S1; S3: Calculate the generating polynomial of the weighing value transmitted by the encoded balance; S4: Based on the generator polynomial calculated in S3, determine whether there is an error byte; if so, execute S5; if not, execute S6; S5: Re-read the weighing values ​​transmitted by another set of balances and execute S2; S6: decoding the weighing value transmitted by the balance after being encoded in S2, and transmitting it to the data reading module to automatically obtain the weighing value transmitted by the balance; The basic form of the generator polynomial in S3 is: ; Where GP(x) represents the generating polynomial, x represents the unknown quantity of the polynomial, r represents the length of the redundant bits of information, gp1, gp r-1 、gp r-2 Represents a binary code number; In S4, based on the generator polynomial calculated in S3, it is determined whether there is an error byte, specifically: S41: Calculate the power and function based on the roots of the generator polynomial calculated in S3: ; Where k represents the number of consecutive powers, S k represents a power sum function with k consecutive powers, α represents a primitive element of the GF domain, j0…j v-1 Indicates the bit to be determined whether there is an error byte, v represents the bit number and v≤k / 2, where k / 2 represents the number of error bytes. are the roots of the generating polynomial; S42: constructing an error byte determination polynomial based on the power sum function, and determining whether an error byte exists according to the error byte determination polynomial.

2. The method for automatically obtaining a balance weighing value according to claim 1, characterized in that: In the S42, an error byte determination polynomial is constructed based on the power sum function, specifically: ; Where EL(x) represents the error byte determination polynomial, σ1…σ v Indicates the error byte determination polynomial coefficient.

3. A method for automatically obtaining a balance weighing value according to claim 2, characterized in that: The error byte determination polynomial coefficients are solved according to the following formula: ; Where m represents the odd number of the power sum function, m = 1, 3, 5, ..., S1 represents a power sum function with 1 consecutive power, S2 represents a power sum function with 2 consecutive powers, S m represents a power sum function with m consecutive powers.

4. A method for automatically obtaining a balance weighing value according to claim 3, characterized in that: In the S42, it is determined whether there is an error byte based on the error byte determination polynomial. Specifically, if the error byte determination polynomial is an indecomposable polynomial, or the root of the error byte determination polynomial does not belong to the set of roots of the generating polynomial, it indicates that there is no error byte. If the error byte determination polynomial is a decomposable polynomial and the root of the error byte determination polynomial belongs to the set of roots of the generating polynomial, it indicates that there is an error byte.

5. A system for automatically acquiring a balance weighing value, comprising a balance weighing value reading module, an error byte judgment module and a data reading module, wherein the input end of the balance weighing value reading module is connected to the data output end of an electronic balance, the output end of the balance weighing value reading module is connected to the input end of the error byte judgment module, and the output end of the error byte judgment module is connected to the input end of the data reading module; characterized in that: The automatic acquisition system for balance weighing values ​​is used to execute the automatic acquisition method for balance weighing values ​​as described in any one of claims 1 to 4 to automatically acquire balance weighing values.

6. A system for automatically acquiring weighing values ​​of a balance according to claim 5, characterized in that: The electronic balance is connected to the balance weighing value reading module via an RS232 serial port and an RS9 data line.

Citation Information

Patent Citations

  • Method for processing wind-tunnel balance calibration data based on intelligent optimization algorithm

    CN106815428A

  • Tobacco leaf dynamic weighing method based on multi-strategy wolf pack algorithm ELM

    CN115752666A

  • Fast and efficient decoder for low-distance RS and BCH codes

    CN119010924A

  • A computer system to implement the basic arithmetical operations of finite field with polynomial basis

    GB0213571D0