A weighing information intelligent processing system and a weighing seal device for tobacco leaf pre-inspection
By combining peak-valley range algorithm and visual anchor point positioning technology, the problems of data instability and difficulty in data entry of heterogeneous systems in the weighing system are solved, realizing accurate acquisition of weighing data and strict quality control, and improving the system's adaptability and error prevention capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LIUYANG BRANCH OF CHANGSHA COMPANY OF HUNAN TOBACCO
- Filing Date
- 2026-02-05
- Publication Date
- 2026-05-26
AI Technical Summary
Existing tobacco weighing systems are susceptible to mechanical vibration during data acquisition, resulting in unstable weight signals. Manual data entry is prone to errors, and data entry between heterogeneous systems is difficult and lacks a mandatory blocking mechanism, leading to data entry errors and the influx of substandard tobacco leaves into subsequent stages.
A stability judgment logic based on the peak-valley range algorithm and digital filtering processing of the first-in-first-out data buffer queue are adopted. Combined with visual anchor point positioning technology, a non-intrusive information transmission channel is established, and a finite state machine model is constructed for anomaly handling. This enables accurate acquisition and dynamic adaptive input of repetitive data and forcibly blocks the inflow of unqualified data.
This ensures the accuracy and consistency of weighing data, improves the system's adaptability to dynamic software environments, prevents the inflow of substandard tobacco leaves, and forms a tight quality control closed loop.
Smart Images

Figure CN122089210A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of tobacco purchasing information technology, specifically to an intelligent processing system for weighing information of tobacco leaves for pre-inspection and a weighing and sealing device. Background Technology
[0002] In the tobacco leaf purchasing and warehousing management process, pre-inspection and weighing are crucial steps that determine the accuracy of trade settlement and the reliability of inventory data. With the advancement of digital transformation in the tobacco industry, purchasing stations need to collect the weight information and identity-related information of tobacco baskets in real time and simultaneously enter this data into the superior business management system to generate corresponding physical labels or circulation vouchers, thereby achieving refined management and control of tobacco leaf purchasing.
[0003] Existing weighing operations typically employ manual or semi-automated methods. Operators place the tobacco baskets on the electronic scale, visually read the weight displayed on the instrument, and then manually input the data into the business management software running on an industrial control computer via a keyboard. Some improved technical solutions attempt to directly read the scale readings using serial communication tools, or use barcode scanners to obtain barcode information, and then use macro scripts to fill the data into the input boxes of the business system, attempting to replace manual transcription and data entry.
[0004] While existing technologies have aided data collection to some extent, significant shortcomings remain: First, electronic weighing equipment at the acquisition site is highly susceptible to impacts from the placement of tobacco baskets or surrounding mechanical vibrations, causing continuous fluctuations in the output weight signal. Relying solely on manual visual judgment or instantaneous software sampling makes it difficult to accurately capture stable data points, resulting in unreliable gross weight data. Second, tobacco business management systems at various levels are typically closed in architecture and have long iteration cycles, often lacking standard data interfaces for external access. Existing automated data entry methods largely rely on simulated clicks using fixed screen coordinates; if the business system window shifts, its resolution changes, or the interface is slightly adjusted, the data entry program will fail or produce errors, failing to adapt to dynamic software environments. Furthermore, existing anomaly handling mechanisms are mostly independent audible and visual warnings, lacking substantial disruption to the business process. When weighing data deviates or fails to meet standards, operators can still continue data entry and label printing due to negligence or violations, allowing substandard tobacco leaves to flow into subsequent stages, making it difficult to form a robust quality control loop. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides an intelligent processing system for weighing information and a weighing sealing device for tobacco leaf pre-inspection, which solves the problems of unstable weighing data acquisition, difficulty in interface connection between heterogeneous systems, and data entry errors caused by the lack of a mandatory blocking mechanism for abnormal data during tobacco leaf procurement.
[0006] To achieve the above objectives, the present invention provides the following technical solution: The first aspect of the present invention provides an intelligent processing system for weighing information of tobacco leaf pre-inspection, the system comprising: a data acquisition module, a data processing module, a data interaction module, and an execution control module; The data acquisition module is configured to perform time-series alignment and extraction of continuous weight data frames from electronic weighing equipment and identity identification data stream from identity recognition equipment, and output a basic data stream carrying timestamps. The data processing module is connected to the data acquisition module and is configured to perform stability determination and tare weight deduction calculation on the basic data stream, generate a verification result signal containing qualified or unqualified status, and lock the net weight data. The data interaction module is connected to the data processing module and is configured to establish a non-intrusive information transmission channel between the system and the external tobacco business management system based on visual anchor point positioning technology and interface element mapping, correct the coordinate deviation of the target input control and drive simulated input; The execution control module is connected to the data processing module, the data interaction module, and the external hardware execution mechanism, respectively, and is configured to respond to the verification result signal based on a finite state machine model. When the verification result signal is unqualified, it outputs an alarm trigger command to the external hardware execution mechanism and forcibly blocks the start signal to the data interaction module to achieve process circuit breaking.
[0007] Preferably, the data acquisition module has an internal first-in-first-out (FIFO) data buffer queue; the data acquisition module is configured with digital filtering logic, which is used to store the most recently sampled raw weight data into the FIFO data buffer queue, and calculate the arithmetic mean of all data in the FIFO data buffer queue, and output the filtered weight value at the current moment to the data processing module.
[0008] Preferably, the data processing module is configured with stability determination logic based on the peak-valley range algorithm; the data processing module maintains an analysis window, traverses the data set in the analysis window in real time to find the maximum weight value and the minimum weight value, and calculates the difference between the maximum weight value and the minimum weight value as the fluctuation range; When the fluctuation amplitude is less than or equal to the preset stability threshold, the stability counter is triggered to accumulate; only when the value of the stability counter reaches the preset lock frame number threshold, the data processing module confirms that the weighing state is finally stable, and locks the latest weight value in the analysis window as the gross weight.
[0009] Preferably, the data processing module is configured with business verification logic; the business verification logic is used to retrieve a preset tare weight database based on the identity data stream to obtain the standard tare weight, subtract the standard tare weight from the locked gross weight to obtain the actual net weight; and compare the actual net weight with a preset graded standard weight threshold to calculate the weight deviation value; if the weight deviation value exceeds the allowable quality deviation threshold, a verification result signal for the unqualified state is generated.
[0010] Preferably, the data interaction module is pre-set with anchor point image templates for the external tobacco business management system interface and offset vector data of the target input control center relative to the center of the anchor point image template; When the data entry job starts, the data interaction module searches for a region in the current screen display buffer that matches the anchor point image template to obtain a reference position, and dynamically calculates the screen absolute coordinates of the target input control based on the reference position and the offset vector data.
[0011] Preferably, the data interaction module is configured with data simulation input logic; after receiving the start signal from the execution control module, the data interaction module uses the absolute screen coordinates to move the cursor to the target input control and triggers a focus acquisition operation, then converts the locked net weight data into a virtual keyboard scan code sequence, and sends it to the target input control character by character.
[0012] Preferably, the data interaction module is also configured with an abnormal pop-up monitoring logic; the data interaction module periodically collects real-time image data of the screen monitoring area and calculates the absolute value of the difference between the real-time image data and the pre-stored background image template at the corresponding pixel points; when the arithmetic mean of the absolute values of the differences of all pixel points exceeds the preset abnormal judgment threshold, an interaction suspension signal is generated and transmitted to the execution control module.
[0013] Preferably, the execution control module is configured to maintain standby state, execution state, and alarm state; When the verification result signal is in a qualified state, the system transitions to the execution state, the execution control module outputs a seal generation instruction to the seal generation component in the external hardware execution mechanism, and sends the start signal to the data interaction module in parallel; When the verification result signal is unqualified, the system transitions to the alarm state, the execution control module outputs the alarm trigger command to the audible and visual alarm component in the external hardware execution mechanism, and prohibits the sending of the seal generation command.
[0014] Preferably, the execution control module is further configured with automatic reset logic; in the alarm state, the execution control module continuously monitors real-time weight data; when it detects that the weight value on the electronic weighing platform has fallen back to the zero threshold range, it automatically resets the alarm state, cuts off the alarm trigger command, and resets the system to the standby state.
[0015] A second aspect of the present invention provides a weighing seal device, the device comprising: The industrial control host is used to run the intelligent processing system for weighing information of the tobacco leaf pre-inspection, serving as the calculation and control center of the device, and displaying real-time data and system status information; The electronic weighing platform, connected to the industrial control host, is used to carry the cigarette basket to be inspected, collect real-time weight signals and transmit them to the industrial control host; The identification component connects to the industrial control host and is used to read the identification information of tobacco farmers or tobacco baskets and transmit the identification code to the industrial control host. The seal generation component connects to the industrial control host and is used to receive seal generation instructions from the industrial control host, output physical tags or write electronic tags. The audible and visual alarm component connects to the industrial control host and is used to receive alarm trigger commands from the industrial control host and issue audible and visual alert signals to indicate abnormal conditions.
[0016] This invention provides an intelligent processing system for weighing information in tobacco leaf pre-inspection and a weighing sealing device. It has the following beneficial effects: 1. This invention employs a stability determination logic based on a peak-valley range algorithm, combined with digital filtering processing of a first-in-first-out (FIFO) data buffer queue, enabling accurate identification of stable states in continuous dynamic weight data streams. This processing method effectively suppresses signal fluctuations in electronic weighing equipment caused by mechanical vibration or environmental noise, avoiding visual errors or subjective judgment biases that may occur when manually reading readings, thereby ensuring the accuracy and consistency of basic weight data acquisition.
[0017] 2. This invention utilizes visual anchor point positioning technology to establish a non-intrusive information transmission channel. By calculating the offset vector of the target control relative to the image anchor point, it achieves dynamic tracking of the input interface of the external business system. This mechanism does not require obtaining the underlying development interface or source code authorization of the external system, solving the data silo problem between heterogeneous systems. At the same time, it can automatically correct positioning deviations caused by operating system window dragging or resolution changes, improving the adaptability and stability of the automated data entry process.
[0018] 3. This invention constructs a dual physical and logical blocking mechanism based on a finite state machine. When the business verification result is unqualified, the system not only triggers an external hardware audible and visual alarm, but also forcibly cuts off the start signal to the data interaction module and prohibits the sending of the seal generation command at the software logic layer. This design prevents operators from forcibly entering data or incorrectly affixing labels while the alarm is active, thus eliminating the flow of unqualified tobacco leaves into subsequent stages and achieving strict closed-loop quality control of the weighing operation. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the module architecture of the present invention; Figure 2 This is a schematic diagram of the device structure of the present invention; Figure 3 This is a schematic diagram of the multi-channel data acquisition and signal preprocessing logic of the present invention; Figure 4 This is a flowchart of the automatic locking and verification logic of the present invention; Figure 5 This is a schematic diagram of the non-intrusive data interaction logic of the present invention; Figure 6 This is a schematic diagram of the execution control and exception response logic of the present invention; Figure 7 This is a graph showing the weight data acquisition and filtering effect of the present invention. Figure 8 This is a schematic diagram of the weighing stability determination counting and locking logic of the present invention.
[0020] The components include: 1. Industrial control host; 2. Electronic weighing platform; 3. Identification component; 4. Seal generation component; 5. Audible and visual alarm component; 100. Data acquisition module; 200. Data processing module; 300. Data interaction module; 400. Execution control module. Detailed Implementation
[0021] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] See attached document Figure 1 , Figure 1 This is a schematic diagram of the module architecture according to an embodiment of the present invention. The present invention provides an intelligent processing system for weighing information of tobacco leaf pre-inspection, the system comprising: a data acquisition module 100, a data processing module 200, a data interaction module 300, and an execution control module 400.
[0023] The data acquisition module 100 receives continuous weight data frames from the electronic weighing device in real time via a full-duplex communication link, and simultaneously monitors the identity data stream from the identification device. The continuous weight data frames and the identity data stream constitute the unstructured input signal of the system. This module is equipped with parsing logic to extract payload data from the unstructured input signal and stores the extracted payload data in a first-in-first-out (FIFO) data buffer queue according to time sequence. Based on this FIFO data buffer queue, the data acquisition module 100 completes the time sequence alignment and preliminary processing of the data, and finally outputs a system-identifiable basic data stream with a timestamp.
[0024] The data processing module 200 is connected to the data acquisition module 100 and is configured to receive the aforementioned basic data stream and perform logical operations and multi-dimensional verification on it. The data processing module 200 includes signal filtering logic and stability judgment logic based on a peak-valley range algorithm, used to calculate and analyze the fluctuation range of weight data within the analysis window, and to lock the final weight value using a stability counter mechanism. The data processing module 200 also includes business verification logic, configured to perform tare weight deduction calculations based on a preset tobacco basket tare weight database to obtain the actual net weight, compare the actual net weight with a preset grading standard weight threshold, generate a verification result signal including a qualified or unqualified status, and lock the verified net weight data and identity-related data.
[0025] The data interaction module 300 is connected to the data processing module 200 and configured to establish a non-intrusive information transmission channel between this system and the external tobacco business management system. The data interaction module 300 employs interface element mapping and visual anchor point positioning technology. Based on preset anchor point image templates and relative offset vector data, it dynamically calculates the coordinates of the target input control on the user interface of the external tobacco business management system to correct positioning deviations caused by window displacement or resolution changes. The data interaction module 300 is also configured with abnormal pop-up monitoring logic, which identifies abnormal states of the external system by calculating the image difference in the screen monitoring area. Upon receiving start permission from the execution control module 400, the data interaction module 300 drives analog input technology to fill the locked net weight data and identity association data output by the data processing module 200 into the positioned target control via the aforementioned non-intrusive information transmission channel.
[0026] The execution control module 400 is respectively connected to the data processing module 200 and the external hardware execution mechanism, serving as the scheduling center of the system. The external hardware execution mechanism specifically includes a seal generation component for completing label production and an acoustic-optic alarm component for emitting physical warning signals. Based on the finite state machine model, the execution control module 400 determines the system state transition according to the verification result signal output by the data processing module 200. When the verification result signal is qualified, the execution control module 400 outputs a seal generation instruction to the seal generation component in the external hardware execution mechanism, and sends a start signal to the data interaction module 300 to trigger data entry; when the verification result signal is unqualified, the execution control module 400 outputs an alarm trigger instruction to the acoustic-optic alarm component in the external hardware execution mechanism, and at the same time forcibly blocks the start signal to the data interaction module 300 at the logical level and prohibits the sending of the seal generation instruction, realizing dual control of physical alarm and process fusing.
[0027] Refer to the appendix Figure 2 , Figure 2 which is a schematic diagram of the device structure according to an embodiment of the present invention. The present invention provides a weighing seal device, which includes: an industrial control host 1, an electronic weighing platform 2, an identity recognition component 3, a seal generation component 4, and an acoustic-optic alarm component.
[0028] The industrial control host 1 serves as the core computing and control center of the device, and the intelligent processing system 10 for weighing information of tobacco leaf pre-inspection runs inside. The industrial control host 1 is equipped with a touch display screen for displaying real-time weight data, operation progress, and system status information, and serving as a human-computer interaction interface for operators to view abnormal prompts.
[0029] The electronic weighing platform 2 establishes a physical connection with the industrial control host 1 through a serial communication interface or an industrial bus. The electronic weighing platform 2 bears the tobacco basket to be inspected, and the weighing sensor integrated inside converts the force condition into an electrical signal and transmits it to the industrial control host 1. The industrial control host 1 obtains the real-time weight value by reading the serial port data stream, rather than relying on manual reading of the display screen value.
[0030] The identity recognition component 3 is installed on the side of the industrial control host 1 or fixed to the operation area through a bracket and is connected to the industrial control host 1. The identity recognition component 3 is a radio frequency identification reader or a barcode scanner for reading the identity document of the tobacco farmer, the IC card, or the electronic tag information on the tobacco basket, and transmitting the read identity identification code to the industrial control host 1.
[0031] The seal generation component 4 is connected to the industrial control host 1 and is used to output physical labels or write electronic labels. In one embodiment, the seal generation component 4 is a thermal label printer used to print paper self-adhesive labels containing weight, grade, and time information; in another embodiment, the seal generation component 4 is an RFID writing device used to write the above information into the electronic chip attached to the cigarette basket.
[0032] The audible and visual alarm component is connected to the industrial control host 1 via an I / O interface. The component includes a buzzer and indicator lights, and emits an audible and visual alert signal when the industrial control host 1 determines that the data is abnormal.
[0033] Based on the above systems and devices, the working logic of this embodiment is as follows: The operator places the tobacco baskets containing tobacco leaves onto the electronic weighing platform 2 and uses the identification component 3 to read the tobacco farmer or basket information. The data acquisition module 100 inside the industrial control host 1 simultaneously acquires the identification data and the real-time weight data sent by the electronic weighing platform 2.
[0034] The data processing module 200 performs sliding window analysis on the real-time weight data. Once the weight data is determined to be stable and passes the matching verification, the data processing module 200 locks the final net weight value. If the data verification fails, the industrial control host 1 activates the audible and visual alarm component 5 and suspends subsequent processes; if the data verification passes, the data interaction module 300 initiates the automated data entry process. At this time, the data interaction module 300 uses interface mapping technology to locate the target control on the external backend business system interface and simulates inputting the locked final net weight value and identity data into the target control, thereby completing the data entry to the backend business system.
[0035] Subsequently, the execution control module 400 drives the seal generation unit 4 to complete the label production or information writing, completing the single pre-inspection weighing and sealing operation. The entire process is achieved through direct acquisition and closed-loop control of hardware data by the industrial control host 1, avoiding the steps of manually entering weight data and manually judging the matching degree.
[0036] See attached document Figure 3 , Figure 3 This is a schematic diagram of the multi-channel data acquisition and signal preprocessing logic in an embodiment of the present invention. The establishment of the data acquisition channel is based on the physical connection between the industrial control host and the underlying sensing device. The industrial control host establishes a full-duplex communication link with the electronic weighing platform through a serial communication protocol, and establishes a data transmission link with the identification component through a universal serial bus interface or a wireless radio frequency protocol.
[0037] For data acquisition from the electronic weighing platform, the system configures serial port parameters, setting the baud rate to the standard industrial communication rate, and matching and setting the data bits, parity bits, and stop bits according to the device communication manual. The industrial control host starts a serial port listening thread to receive weight data frames sent by the electronic weighing platform in real time. The data frame format typically includes a start bit, data bits, unit identifier bits, and an end bit. The system parses the received data frames and extracts the weight value.
[0038] To address noise interference in the raw weight signal, the data processing module performs digital filtering on the acquired raw weight signal. This embodiment employs a moving average filtering algorithm to smooth the continuously sampled weight data. Specifically, the system establishes a first-in, first-out (FIFO) data buffer queue to store the raw weight data from the most recent sampling. Whenever new sampled data arrives, it is enqueued, and the oldest data in the queue is removed. The data processing module calculates the arithmetic mean of all data in the buffer queue as the filtered weight value for the current moment. This processing effectively suppresses periodic interference and random noise, outputting smooth weight data.
[0039] For data acquisition by the identification component, the industrial control host listens to input events or data streams to obtain barcode, QR code, or electronic tag information scanned by the identification component. The system performs format verification on the acquired identification information, removes invalid characters, and extracts key identification fields. To ensure accurate correspondence between weight data and identification information, the system records the current system timestamp upon receiving valid identification information and uses this timestamp as a synchronization marker, binding it to weight data within the same time window to establish a correlation between identification information and weight data.
[0040] During data acquisition, if a communication timeout or verification error is detected, the system automatically logs and resets the connection. The specific communication driver and interface circuit design are standard techniques for those skilled in the art and will not be elaborated upon here.
[0041] See attached document Figure 4 , Figure 4 This is a flowchart illustrating the automatic locking and verification logic in this embodiment of the invention. In this embodiment, the data processing module automatically determines the weighing status based on the weight fluctuation characteristics within a time window using a peak-valley range algorithm, and performs multi-dimensional verification in conjunction with business rules.
[0042] After acquiring the preprocessed weight data, the system maintains an analysis window for stability assessment. This window stores the most recently collected set of weight values. The data processing module calculates the extreme value difference of the weight data within the analysis window in real time, using this as a quantitative indicator to measure the current weighing stability.
[0043] Let the length of the analysis window be... The data set within the analysis window at the current moment is denoted as . The data processing module iterates through the set, finds the maximum and minimum weight values, and calculates the difference between them as the fluctuation range. The calculation formula is as follows: In the formula, This represents the calculated fluctuation range; Indicates the length of the analysis window; This represents the data set within the analysis window at the current moment; This indicates the maximum weight value within the analysis window; This indicates the minimum weight value within the analysis window.
[0044] The system has a preset stability threshold, which is set according to the accuracy level of the electronic weighing platform. The data processing module compares the calculated fluctuation amplitude with the stability threshold. If the fluctuation amplitude is less than or equal to the stability threshold, the weight at the current moment is determined to be in a potentially stable state.
[0045] The system employs a counter mechanism for continuous stability confirmation. The data processing module maintains a stability counter; when a potentially stable state is detected, the counter value increments; when fluctuations exceed a stability threshold, the counter value is reset to zero. Only when the counter value reaches a preset lock frame threshold does the system confirm that the weighing state is finally stable and trigger an automatic locking action. At this point, the system locks the latest weight value in the analysis window as the gross weight for this operation.
[0046] After locking the gross weight, the system automatically enters the business verification process. First, a tare weight deduction is performed. The data processing module, based on the cigarette basket type identifier obtained during the identification process, retrieves the corresponding standard tare weight from the pre-set tare weight database, subtracts the standard tare weight from the locked gross weight, and obtains the actual net weight.
[0047] Subsequently, the system executes the matching degree verification logic. Based on the acquired tobacco leaf grade information, the system retrieves the system's preset standard weight per bale corresponding to that grade. The data processing module calculates the absolute value of the difference between the actual net weight and the standard weight to obtain the weight deviation value.
[0048] The system compares the weight deviation value with a preset allowable mass deviation threshold. If the weight deviation value is less than or equal to the allowable mass deviation threshold, the matching verification of the weighing data is deemed successful, a qualified signal is generated, and the process is allowed to proceed to the next stage. If the weight deviation value is greater than the allowable mass deviation threshold, the verification is deemed unsuccessful, and an abnormal signal is generated. Through this logic, the system can automatically intercept weight data that does not meet the grading standards, preventing abnormal data from flowing into subsequent business processes. The construction and retrieval technology of the tare weight database is well-known to those skilled in the art and will not be described in detail here.
[0049] See attached document Figure 5 , Figure 5 This is a schematic diagram of the non-intrusive data interaction logic in an embodiment of the present invention. The data interaction module constructs a non-intrusive data transmission channel based on interface element mapping, and realizes data entry by simulating peripheral device input events.
[0050] The data interaction module first establishes an element mapping relationship for the user interface of the external business system. The system identifies key control features of the external business system's input interface using pre-configured tools or image recognition algorithms. For each data item to be entered, the system defines its position information in the screen coordinate system or its control handle identifier at the operating system level. The system establishes a mapping set containing several key-value pairs, each corresponding to a specific data entry item. In the formula, This represents a set of mappings containing a number of key-value pairs. This represents the index of the data item, with values ranging from 1 to... _n_ natural numbers; This indicates the total number of data items to be entered; Indicates the first The names of the data items to be entered; This represents a unique identifier for the corresponding data item input control, and this identifier is an absolute screen coordinate. Or the handle of a window control.
[0051] The data interaction module 300 is equipped with visual anchor point positioning logic. The internal memory of the data interaction module 300 contains pre-set anchor point image templates for the external business system interface, as well as offset vector data of the target input control center relative to the center of the anchor point image template. When a data entry job starts, the data interaction module 300 searches the current screen display buffer for a region that matches the anchor point image template and obtains the reference position of that region in the current screen coordinate system.
[0052] The data interaction module 300 calculates the dynamic coordinates of the target input control based on the reference position and preset offset vector data. The calculation rules for the dynamic coordinates are as follows: In the formula, This represents the calculated x-coordinate of the center of the target input control; This represents the calculated ordinate of the center of the target input control; This represents the x-coordinate of the center of the anchor point image template matched in the current screen; This represents the ordinate of the center of the anchor point image template matched in the current screen; This indicates the preset horizontal pixel offset component; This indicates the preset vertical pixel offset component.
[0053] The data interaction module 300 uses the calculated dynamic coordinates as the target parameters for simulating mouse click commands, thereby achieving precise positioning of the target input control.
[0054] The data interaction module 300 is also configured with anomaly pop-up monitoring logic. Based on the interface layout of the external business system, the data interaction module 300 pre-defines the screen monitoring area and stores the background image template of that area under normal operating conditions. During system operation, the data interaction module 300 periodically collects real-time image data of the screen monitoring area.
[0055] The data interaction module 300 uses an image difference analysis algorithm to compare real-time image data with a background image template. Specifically, the data interaction module 300 calculates the absolute value of the difference in grayscale values between the real-time image data and the background image template at corresponding pixels, and calculates the arithmetic mean of the absolute values of all pixel differences to obtain an image difference value. The data interaction module 300 compares the calculated image difference value with a system-preset anomaly detection threshold. When the image difference value exceeds the anomaly detection threshold, the data interaction module 300 generates an interaction suspension signal and transmits it to the execution control module 400. The execution control module 400 then interrupts the analog input process and triggers an alarm.
[0056] Once the data processing module completes locking and verification and generates a qualified data packet, the data interaction module initiates the automated data entry sequence. The system parses the qualified data packet into a sequence of input values corresponding to the mapping set. For each data item in the sequence, the system sequentially performs focus acquisition, simulated data input, and confirmation operations.
[0057] For focus acquisition operations, if coordinate identifiers are used, the system calls the operating system's underlying mouse control interface to move the cursor to the specified coordinate position and sends a left mouse button click command to make the target input box gain input focus; if handle identifiers are used, the system directly sends a window activation message to the target control handle.
[0058] For simulated data input operations, the system calls the operating system's underlying input interface to convert the numerical or text data to be entered into a corresponding virtual keyboard scan code sequence. At this point, the system treats the external business system as the object being operated on, and the input box, text field, or drop-down list in the external business system's interface that is in focus is considered the target control. The system sequentially sends the scan code sequence to the currently locked target control, thus filling in characters one by one. To ensure the reliability of the input timing, the system inserts a microsecond-level delay between sending the scan codes of two adjacent characters to prevent character loss due to response delays from the external business system.
[0059] After all data items have been filled in, the system locates the control icon of the submit or save button, sends a click confirmation command, and completes the submission of a single data entry.
[0060] To ensure the stability of the interaction process, the system is equipped with an exception handling mechanism. Before executing each operation step, the system checks the visibility or presence status of the target control. This is achieved by polling the validity of the target control handle or calculating the pixel matching degree between the current screen area and the pre-stored control image. If the target control is not detected within a preset time, or if an exception prompt window pops up from an external business system, the system immediately suspends the automated process and sends an interaction exception signal to the industrial control host, prompting manual intervention. Through this mechanism, the system can avoid erroneous operations when there are minor changes to the external business system interface or when the system lags. The specific operating system application programming interface calls and screen coordinate acquisition techniques are well-known to those skilled in the art and will not be described in detail here.
[0061] See attached document Figure 6 , Figure 6 This is a schematic diagram of the execution control and exception response logic in an embodiment of the present invention. The execution control module, as the scheduling center of the system, uses a finite state machine model to manage the system's operation flow, ensuring accurate execution of actions when business verification passes and implementing both physical and logical blocking when verification fails.
[0062] The execution control module primarily maintains the standby state, verification state, execution state, and alarm state. After system initialization, it enters standby state by default and monitors the output signals of the data processing module in real time.
[0063] After the data processing module completes the stability locking and business rule verification of the weight data, it generates a status signal containing a Boolean value of the verification result. The execution control module determines the state machine's transition path based on this status signal. If the verification result is satisfactory, the system transitions to the execution state; if the verification result is unsatisfactory, the system transitions to the alarm state.
[0064] In execution mode, the system initiates data writing and interaction processes in parallel. On one hand, the system sends data writing instructions to the identification component or dedicated label printing device. To ensure the integrity of the written data, the system constructs an instruction frame conforming to the device's communication protocol. This instruction frame typically includes a frame header, instruction code, the net weight and encrypted identity data to be written, a cyclic redundancy check (CRC) code, and a frame trailer. The system sends the instruction frame to the hardware device via the communication interface and starts a timer to wait for the device's confirmation frame indicating completion of the writing process. If no confirmation frame is received within the specified time, the system triggers a retransmission mechanism. On the other hand, the system sends a start signal to the data interaction module, triggering the automated data entry process of external business systems.
[0065] In alarm mode, the system activates anomaly response and blocking mechanisms. To prevent defective products from mistakenly flowing into the next stage, the system executes physical-level audible and visual alarms and logical-level process circuit breakers.
[0066] For physical alarms, the industrial control host connects to the relay control board via a general-purpose input / output interface. When an alarm is triggered, the system writes a high-level signal to the corresponding port, closing the alarm circuit, driving the three-color alarm light in the field to flash red, and controlling the buzzer to emit intermittent alarm sounds.
[0067] For circuit breaking at the logical level, the execution control module internally cuts off the signal path to the data interaction module, ensuring that even accidental operations cannot trigger input actions from external business systems. Simultaneously, the system sends a prohibition on printing command to the label printing device or directly withholds the write command, preventing the generation of physical labels at the source and implementing a mandatory constraint that no label is issued for failed verification.
[0068] To restore system operation, the execution control module monitors real-time weight data. When the weight value on the electronic weighing platform falls back to the zero-point threshold range, it indicates that the abnormal material has been removed. At this time, the system automatically resets the alarm state, cuts off the audible and visual alarm signals, and resets the state machine to standby mode, awaiting the next operation. The connection method and underlying implementation of the relay control circuit are well-known technologies to those skilled in the art and will not be described in detail here.
[0069] Specific application examples This embodiment selects a C3F grade tobacco leaf pre-inspection line at a tobacco purchasing station in a certain province as the deployment scenario.
[0070] Hardware environment configuration: The industrial control host uses an Advantech IPC-610L industrial chassis, equipped with an Intel Core i7 processor and 16GB of memory, running Windows 10 IoT Enterprise Edition operating system. The electronic weighing platform uses a Mettler Toledo industrial platform scale with a capacity of 100kg and a graduation of 0.02kg, connected to the industrial control host's COM1 port via an RS-232 serial port. The identification component uses a ThingMagic M6 UHF RFID reader / writer, connected via an Ethernet interface, used to read anti-metal electronic tags on the bottom of the cigarette basket. The seal generation component is a Zebra ZT411 industrial barcode printer. The audible and visual alarm tower light is connected to the industrial control host via a USB-IO control card.
[0071] Software parameter settings: The system sets a standard net weight threshold of 50.0 kg per crate for C3F grade tobacco leaves, with an allowable weight deviation threshold of ±0.2 kg. The tare weight database pre-stores the tare weights of three different crate sizes; this example primarily uses the Type-A plastic crate, with a standard tare weight set at 3.5 kg. The sliding filter window length of the data acquisition module is set to 10 frames, the stability threshold is set to 0.05 kg, and the locked frame threshold is set to 5 frames.
[0072] Workflow description: At the start of the operation, the operator pushes the Type-A tobacco crate containing the initially graded tobacco leaves into the electronic weighing platform. The RFID reader reads the crate's ID, and the system retrieves the tare weight of 3.5 kg based on the ID. At this point, the data acquisition module receives the raw weight data via serial port at a frequency of 10 Hz. Due to the impact when the crate is placed, the raw data fluctuates wildly between 53.0 kg and 54.5 kg. After approximately 1.2 seconds, a moving average filtering algorithm brings the data fluctuations to a convergence.
[0073] When the data processing module calculates that the range of five consecutive frames of data is less than 0.05 kg, it determines that the weighing is stable and locks the current gross weight at 53.60 kg. The system automatically performs the calculation: Net weight = 50.10 kg. Then, it compares 50.10 kg with the standard value of 50.0 kg. If the deviation of 0.10 kg is within the allowable range of ±0.2 kg, the verification result is considered qualified.
[0074] Upon receiving a valid signal, the execution control module sends a low-level maintenance command (alarm light off) to the USB-IO card and simultaneously sends a ZPL command to the Zebra printer to print the label. Simultaneously, the data interaction module starts. At this time, the external tobacco purchasing management system is running in the foreground. The data interaction module locates the coordinates of the weight input box on the interface through image matching, simulates keyboard input of 50.10, and sends an Enter key command to complete the data entry. The entire process requires no manual intervention.
[0075] If the net weight of the placed tobacco basket is calculated to be 49.50 kg (deviation -0.5 kg), exceeding the allowable range, the data processing module outputs a non-compliance signal. The execution control module immediately sends a high-level signal to the USB-IO card, driving the red alarm light to flash and the buzzer to sound; simultaneously, the software internally cuts off the trigger signal to the data interaction module, and the printer remains silent. The system enters a deadlock state until the weight data is zeroed (the tobacco basket is removed), at which point it resets.
[0076] To verify the system's performance, two sets of comparative tests were conducted on the same production line. Group A used the traditional method of manual weighing, manual data entry, and manual labeling; Group B used the intelligent processing system described in this embodiment. The test sample consisted of 500 baskets of tobacco leaves of different weights, including 20 baskets of substandard weight samples.
[0077] Test data record: This section shows a portion of the raw sensor data stream and processing results from the experiment, used to demonstrate the actual performance of the stability determination logic. The data is subject to environmental noise interference.
[0078] Table 1: Data segments of weight signal acquisition and status determination (unit: kg)
[0079] It should be noted that the range is shown in Table 1 at time T+2200ms. The stability counter is displayed as "-", indicating that the stability determination algorithm has stopped running at this point. Since the stability counter value has reached the preset lock frame threshold (5 frames) at time T+2000ms, the system determines the weighing state as finally stable and triggers the locking action. The state machine then transitions to the business verification phase. According to the system design logic, once the locking and verification process begins, the data processing module pauses processing the peak-valley range of the real-time data within the sliding window. The calculation and counter accumulation operation ensures that the weight data sent to the subsequent verification stage has atomicity in time, preventing the verification base value from drifting due to subsequent minor vibrations.
[0080] Table 2: Performance Comparison Test Data Between Traditional Mode and Intelligent System
[0081] Based on the test data in Table 2 and the process analysis in Table 1, the intelligent weighing information processing system proposed in this invention demonstrates significant technical advantages in practical applications: Table 2 shows that the average time per basket for Group B using this system was only 8.2 seconds, compared to 42.5 seconds for Group A, representing an 80.7% improvement in work efficiency. Group A's data had a high standard deviation of 8.43, indicating that manual operation was significantly affected by fatigue, skill level, and attention fluctuations, resulting in unstable work rhythms. In contrast, Group B's standard deviation was only 1.12, demonstrating the high time determinism of the automated logic when handling repetitive tasks. The non-intrusive data interaction module, through millisecond-level interface element positioning and simulated input, eliminates the time-consuming manual reading of readings, keyboard typing, and verification, which is a key factor in the efficiency improvement.
[0082] Regarding data quality, Group B achieved a 0% error rate, while Group A had a 2.8% data entry error rate. Errors in manual mode primarily stemmed from visual errors and input mistakes. This system directly acquires signals from underlying sensors via a data acquisition module and uses a sliding window algorithm to filter out mechanical vibration noise in the T+200ms to T+800ms range (as shown in Table 1), ensuring the accuracy of the source data. Simultaneously, a non-intrusive channel directly writes the locked values from memory into the business system, eliminating the possibility of human tampering or mis-entry.
[0083] Regarding the abnormal interception indicator, Group A experienced 3 missed detections out of 20 non-compliant sample tests, resulting in an interception success rate of only 85%. This reflects subjective negligence in human judgment when dealing with weights approaching critical values. Group B, relying on the logic circuit breaker mechanism of the execution control module, achieved a 100% interception rate. When verification fails, the system not only issues audible and visual alarms but also physically prevents the sending of seal generation commands, fundamentally eliminating the possibility of non-compliant tobacco leaves flowing into subsequent stages. This system ensures the stability of unstructured input signals through multi-level filtering algorithms, solves the data silo problem between the old and new systems using non-intrusive interaction technology, and strengthens the quality management closed loop with a finite state machine-driven physical blocking mechanism. Experimental results fully demonstrate the practical effectiveness of this solution in improving tobacco leaf purchasing efficiency, reducing data error rates, and strictly enforcing grading standards.
[0084] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An intelligent processing system for weighing information in tobacco leaf pre-inspection, characterized in that, The system includes: a data acquisition module, a data processing module, a data interaction module, and an execution control module; The data acquisition module is configured to perform time-series alignment and extraction of continuous weight data frames from electronic weighing equipment and identity identification data stream from identity recognition equipment, and output a basic data stream carrying timestamps. The data processing module is connected to the data acquisition module and is configured to perform stability determination and tare weight deduction calculation on the basic data stream, generate a verification result signal containing qualified or unqualified status, and lock the net weight data. The data interaction module is connected to the data processing module and is configured to establish a non-intrusive information transmission channel between the system and the external tobacco business management system based on visual anchor point positioning technology and interface element mapping, correct the coordinate deviation of the target input control and drive simulated input; The execution control module is connected to the data processing module, the data interaction module, and the external hardware execution mechanism, respectively, and is configured to respond to the verification result signal based on a finite state machine model. When the verification result signal is unqualified, it outputs an alarm trigger command to the external hardware execution mechanism and forcibly blocks the start signal to the data interaction module to achieve process circuit breaking.
2. The intelligent processing system for weighing information of tobacco leaf pre-inspection according to claim 1, characterized in that, The data acquisition module has an internal first-in-first-out (FIFO) data buffer queue. The data acquisition module is configured with digital filtering logic, which is used to store the most recently sampled raw weight data into the FIFO data buffer queue, and calculate the arithmetic mean of all data in the FIFO data buffer queue, and output the filtered weight value at the current moment to the data processing module.
3. The intelligent processing system for weighing information of tobacco leaves for pre-inspection according to claim 1, characterized in that, The data processing module is configured with stability determination logic based on the peak-valley range algorithm; the data processing module maintains an analysis window, and iterates through the data set in the analysis window in real time to find the maximum weight value and the minimum weight value, and calculates the difference between the maximum weight value and the minimum weight value as the fluctuation range; When the fluctuation amplitude is less than or equal to the preset stability threshold, the stability counter is triggered to accumulate; only when the value of the stability counter reaches the preset lock frame number threshold, the data processing module confirms that the weighing state is finally stable, and locks the latest weight value in the analysis window as the gross weight.
4. The intelligent processing system for weighing information of tobacco leaves for pre-inspection according to claim 1, characterized in that, The data processing module is configured with business verification logic; the business verification logic is used to retrieve a preset tare weight database based on the identity identification data stream to obtain the standard tare weight, subtract the standard tare weight from the locked gross weight to obtain the actual net weight; and compare the actual net weight with a preset graded standard weight threshold to calculate the weight deviation value; if the weight deviation value exceeds the allowable quality deviation threshold, a verification result signal for the unqualified state is generated.
5. The intelligent processing system for weighing information of tobacco leaves for pre-inspection according to claim 1, characterized in that, The data interaction module is pre-set with anchor point image templates for the external tobacco business management system interface and offset vector data of the target input control center relative to the center of the anchor point image template. When the data entry job starts, the data interaction module searches for a region in the current screen display buffer that matches the anchor point image template to obtain a reference position, and dynamically calculates the screen absolute coordinates of the target input control based on the reference position and the offset vector data.
6. The intelligent processing system for weighing information of tobacco leaves for pre-inspection according to claim 5, characterized in that, The data interaction module is configured with data simulation input logic; after receiving the start signal from the execution control module, the data interaction module uses the absolute screen coordinates to move the cursor to the target input control and triggers the focus acquisition operation, then converts the locked net weight data into a virtual keyboard scan code sequence, and sends it to the target input control in a character-by-character filling manner.
7. The intelligent processing system for weighing information of tobacco leaves for pre-inspection according to claim 1, characterized in that, The data interaction module is also configured with abnormal pop-up monitoring logic; the data interaction module periodically collects real-time image data of the screen monitoring area and calculates the absolute value of the difference between the real-time image data and the pre-stored background image template at the corresponding pixel point. When the arithmetic mean of the absolute values of the differences between all pixels exceeds a preset anomaly threshold, an interactive suspension signal is generated and transmitted to the execution control module.
8. The intelligent processing system for weighing information of tobacco leaves for pre-inspection according to claim 1, characterized in that, The execution control module is configured to maintain standby state, execution state, and alarm state. When the verification result signal is in a qualified state, the system transitions to the execution state, the execution control module outputs a seal generation instruction to the seal generation component in the external hardware execution mechanism, and sends the start signal to the data interaction module in parallel; When the verification result signal is unqualified, the system transitions to the alarm state, the execution control module outputs the alarm trigger command to the audible and visual alarm component in the external hardware execution mechanism, and prohibits the sending of the seal generation command.
9. The intelligent processing system for weighing information of tobacco leaves for pre-inspection according to claim 8, characterized in that, The execution control module is also equipped with automatic reset logic; in the alarm state, the execution control module continuously monitors real-time weight data; when it detects that the weight value on the electronic weighing platform has fallen back to the zero threshold range, it automatically resets the alarm state, cuts off the alarm trigger command, and resets the system to the standby state.
10. A weighing and sealing device, characterized in that, The intelligent processing system for weighing information of tobacco leaf pre-inspection according to any one of claims 1 to 9, the device comprising: The industrial control host is used to run the intelligent processing system for weighing information of the tobacco leaf pre-inspection, serving as the calculation and control center of the device, and displaying real-time data and system status information; The electronic weighing platform, connected to the industrial control host, is used to carry the cigarette basket to be inspected, collect real-time weight signals and transmit them to the industrial control host; The identification component connects to the industrial control host and is used to read the identification information of tobacco farmers or tobacco baskets and transmit the identification code to the industrial control host. The seal generation component connects to the industrial control host and is used to receive seal generation instructions from the industrial control host, output physical tags or write electronic tags. The audible and visual alarm component connects to the industrial control host and is used to receive alarm trigger commands from the industrial control host and issue audible and visual alert signals to indicate abnormal conditions.