Packaging machine QR code dynamic tracing method, device and equipment

By establishing a distributed verification engine and real-time verification queue on the packaging machine production line, combining data cache and timestamp synchronization mechanisms, a chain traceability data structure is introduced, which solves the accuracy and efficiency of QR code collection and data processing in a high-speed production environment, and achieves efficient and reliable product traceability.

CN119295104BActive Publication Date: 2025-05-09SHENZHEN HUALONG XUNDA INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411809051.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-05-09
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

In the high-speed production environment of traditional packaging machine production lines, the QR code collection accuracy is low, the hierarchical correlation is complex, and the data processing is delayed, which affects the accuracy and efficiency of product traceability.

Method used

By establishing a distributed verification engine and real-time verification queue mechanism, combining 50:1 accurate mapping rules, using dual data caching mechanism and breakpoint continuation technology, a synchronization mechanism based on global timestamps is designed, and a chain traceability data structure is introduced to achieve efficient traceability chain management and rapid retrieval.

Benefits of technology

It significantly improves the accuracy of QR code association of multi-level packaging units, ensures reliable transmission and storage of data, ensures data integrity and timing consistency, and improves the system's fault tolerance and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295104B_ABST
    Figure CN119295104B_ABST
Patent Text Reader

Abstract

The present invention relates to a method, device and equipment for dynamic tracing of two-dimensional codes of packaging machines. The method: input the registration identification information of the on-site management unit into the central control system for identity verification and clock synchronization calculation, and generate a global timestamp sequence; generate a trigger timing control signal; collect the first two-dimensional code image of the inner packaging unit and the second two-dimensional code image of the outer packaging unit to obtain the first coded data stream and the second coded data stream; perform hierarchical association operations to generate hierarchical rejection signals; generate associated data packets for the first coded data stream and the second coded data stream that pass the verification, and generate an associated backup table; establish a multi-level tracing index based on the associated data packet, sort the multi-level tracing index according to the global timestamp sequence, and generate a chain tracing data structure. The implementation of the present invention ensures the real-time and accuracy of the two-dimensional code data of the packaging machine, and has an effective data exception processing mechanism and backup recovery strategy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of two-dimensional code tracing, and in particular to a two-dimensional code dynamic tracing method, device and equipment for a packaging machine. Background Art

[0002] Although QR code identification of single packaging units has been realized on traditional packaging machine production lines, there are still many technical difficulties in the process of associating and tracing multi-level packaging units. Especially in high-speed production environments, due to the high speed of the production line and the large amount of data, the low accuracy of QR code collection, complex hierarchical association, and data processing delays have seriously affected the accuracy and efficiency of product traceability.

[0003] Most existing traceability systems use simple data collection and storage methods, lacking the ability to deeply analyze and process the relationships between multi-level packaging units. At the same time, due to the complex production site environment and unstable equipment status, problems such as code reading failure, data loss, and association errors often occur. These problems lead to a break in the traceability chain and affect the quality control of the product throughout its life cycle. Summary of the invention

[0004] The main purpose of the present invention is to provide a packaging machine two-dimensional code dynamic tracing method, device and equipment to ensure the real-time and accuracy of the packaging machine two-dimensional code data, and have an effective data exception handling mechanism and backup recovery strategy.

[0005] To achieve the above object, the present invention provides a packaging machine two-dimensional code dynamic tracing method, comprising the following steps:

[0006] Input the registration identification information of the field management unit into the central control system for identity verification and clock synchronization calculation to generate a global timestamp sequence;

[0007] Perform task analysis on production plan data, perform status self-check on code reading equipment, and generate trigger timing control signals;

[0008] According to the trigger timing control signal, a first two-dimensional code image of the inner packaging unit and a second two-dimensional code image of the outer packaging unit are collected and decoded to obtain a first coded data stream and a second coded data stream;

[0009] Inputting the first coded data stream and the second coded data stream into a real-time verification queue, performing hierarchical association operation, and generating a hierarchical rejection signal;

[0010] Based on the graded rejection signal, the first coded data stream and the second coded data stream that have passed the verification are used to generate associated data packets, and the data packets are uploaded to the central control system to generate an associated backup table;

[0011] A multi-level tracing index is established based on the associated data packet, and the multi-level tracing index is sorted according to the global timestamp sequence to generate a chain tracing data structure.

[0012] The present invention also provides a two-dimensional code dynamic tracing device for a packaging machine, comprising:

[0013] A verification module is used to input the registration identification information of the field management unit into the central control system for identity verification and clock synchronization calculation to generate a global timestamp sequence;

[0014] The parsing module is used to perform task parsing on the production plan data, perform status self-check on the code reading device, and generate a trigger timing control signal;

[0015] A calculation module, used for collecting the first two-dimensional code image of the inner packaging unit and the second two-dimensional code image of the outer packaging unit according to the trigger timing control signal and performing decoding operations to obtain a first coded data stream and a second coded data stream;

[0016] A grading module, used for inputting the first coded data stream and the second coded data stream into a real-time verification queue, performing a hierarchical association operation, and generating a grading rejection signal;

[0017] An uploading module, used for generating a correlation data packet from the first coded data stream and the second coded data stream that have passed the verification based on the graded rejection signal, and uploading the data packet to the central control system to generate a correlation backup table;

[0018] A generating module is used to establish a multi-level tracing index based on the associated data packet, sort the multi-level tracing index according to the global timestamp sequence, and generate a chain tracing data structure.

[0019] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the above methods when executing the computer program.

[0020] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned methods are implemented.

[0021] In summary, the technical solution provided by the present invention significantly improves the accuracy of the association of the two-dimensional code of the multi-level packaging unit by establishing a distributed verification engine and a real-time verification queue mechanism, combined with a 50:1 precise mapping rule, and effectively solves the data association problem in a high-speed production environment; adopts a dual data cache mechanism and breakpoint resume technology, and cooperates with the establishment of a local association backup table to achieve reliable transmission and storage of traceability data and ensure data integrity; designs a synchronization mechanism based on a global timestamp, and ensures the timing consistency in the distributed system through 1-hour periodic detection and dynamic calibration of a 10-minute threshold; introduces a chain traceability data structure, and realizes efficient traceability chain management and fast retrieval through the dynamic construction of multi-level index nodes and the association of predecessor and successor pointers; based on the exception handling mechanism of graded rejection signals, unqualified data is identified and eliminated in real time, thereby improving the fault tolerance and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 It is a schematic diagram of the steps of a two-dimensional code dynamic tracing method for a packaging machine in one embodiment of the present invention;

[0023] Figure 2 It is a structural block diagram of a two-dimensional code dynamic tracing device for a packaging machine in one embodiment of the present invention;

[0024] Figure 3 It is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.

[0025] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

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

[0027] Reference Figure 1 This embodiment provides a packaging machine two-dimensional code dynamic tracing method, including the following steps:

[0028] S1, input the registration identification information of the field management unit into the central control system for identity verification and clock synchronization calculation to generate a global timestamp sequence;

[0029] Among them, the system code, communication port number, and IP address of the field management unit are input into the central control system for data analysis. The central control system identifies the basic information of each field management unit to ensure the legitimacy and uniqueness of its identity and generate a registration data pair. Through the registration data pair, the central control system confirms whether these units have valid connection permissions and obtains the connection permission parameters. Based on the connection permission parameters, the communication connection status with the field management unit is established. Data synchronization is performed based on the communication connection status, and configuration data related to production is obtained. The configuration data includes shift parameters, product specification parameters, and personnel parameters. The shift parameters reflect the production schedule, the product specification parameters involve the product specifications of the current production, and the personnel parameters are used to confirm the information of the operator. Through the acquisition of these parameters, the central control system organizes the data to form a basic parameter data structure with a logical structure. The organized processing helps to improve the systematicness and manageability of the data, ensuring that a specific shift, a specific specification product, or an operator can be accurately located in the subsequent traceability process. Time synchronization management is performed on the basic parameter data structure to ensure that all production activities are operated on the same time basis. Through time synchronization management, the current standard time data is obtained. Based on the current standard time data, establish an internal clock operation to achieve time consistency of the entire traceability system. Perform regular detection on the status of the internal clock. The internal clock operation is regularly detected in a cycle of 1 hour. Through regular detection, the operation status of the internal clock is dynamically monitored to ensure that it will not cause time deviation due to environmental changes or hardware drift. After the detection, the clock deviation value is obtained, which reflects the error between the internal clock and the standard time. The clock deviation value is compared with the preset threshold. The preset threshold is set to 10 minutes, that is, if the detected clock deviation value exceeds 10 minutes, it is determined that the accuracy of the current internal clock has been affected and calibration is required. The result of the comparison operation will determine whether to calibrate the internal clock data. If the comparison result shows that the deviation value exceeds the preset threshold, the calibration process is started to adjust the internal clock to restore it to a state consistent with the standard time. The calibrated time data stream is the time benchmark of the entire traceability system. The calibrated time data stream is encoded and processed according to the time series to ensure the consistency and traceability of the time data in the entire traceability process, obtain a global timestamp sequence, and effectively link the data of different production links in chronological order to form a chain traceability data structure to ensure the integrity and accuracy of the traceability process.

[0030] S2, performs task analysis on the production plan data, performs status self-check on the code reading device, and generates a trigger timing control signal;

[0031] Specifically, the production plan data in the factory-level management subsystem is task parsed and deconstructed through the data interface, and key plan task information such as plan number, specification code, planned output, team information, planned start time and planned end time are extracted from the original production plan data. Specification verification and parameter matching processing are performed based on the specification code to ensure that the product specifications in the production plan are consistent with the actual production requirements. By verifying the specification code, it is confirmed whether the specifications of the current products meet the predetermined production requirements to avoid production deviations caused by inconsistent specifications. After the verification is passed, the two-dimensional code rule configuration data is obtained, including the generation rules, encoding method and reading requirements of the two-dimensional code. According to the two-dimensional code rule configuration data, the self-test program of the connected code reader is activated to ensure that the code reader can start normally and start to read the two-dimensional code. After the self-test program is started, the code reader detection start signal is obtained. Based on the code reader detection start signal, the code reader's lens cleanliness, communication link, and trigger signal are multi-mode tested to ensure that the code reader can read the two-dimensional code in the best state. Through these tests, the working status data of the equipment is obtained, which reflects the current operating health of the equipment. If any abnormality is found during the detection process, the system can identify and handle it in time. Perform a code reading success rate test operation on the working status data of the equipment. By statistically analyzing the reading success rate of the code reader in the past period of time, the status evaluation data of the equipment is obtained to determine whether the code reader can continue to work efficiently and stably. The status evaluation data will be compared with the preset standard threshold to obtain the abnormal level data of the equipment. If the working status of the equipment fails to meet the expected standard, further processing will be performed according to the abnormal level data to prompt the relevant operators to perform maintenance or adjustments. Based on the planned task data and the equipment abnormal level data, the operation status feedback data is generated and uploaded to the factory-level management subsystem for storage. These feedback data include the execution of the production plan, the working status of the equipment, and the existing equipment abnormality information. By uploading the operation status feedback data in real time, the factory-level management subsystem can take timely measures to optimize the production process and reduce the impact of equipment failures. According to the QR code rule configuration data and the equipment working status data, the trigger parameters are set to generate the trigger timing control signal. These signals are used to control each link in the production process, ensuring that production tasks can proceed smoothly according to the established time nodes, and that the generation, collection and decoding of QR codes can proceed smoothly throughout the process.

[0032] S3, according to the trigger timing control signal, collecting the first two-dimensional code image of the inner packaging unit and the second two-dimensional code image of the outer packaging unit and performing decoding operations to obtain a first coded data stream and a second coded data stream;

[0033] It should be noted that the trigger sequence is allocated based on the trigger timing control signal to obtain the inner code reading trigger signal and the outer code reading trigger signal. These trigger signals provide time nodes for the image capture of the high-speed acquisition module. By controlling the image capture of the high-speed acquisition module, the two-dimensional code images of the inner and outer packaging units are acquired at the right time to obtain a real-time two-dimensional code image sequence. The real-time two-dimensional code image sequence is subjected to regional positioning processing to locate the two-dimensional code image area of ​​the inner packaging unit and the two-dimensional code image area of ​​the outer packaging unit. The located two-dimensional code image area is input into the image enhancement model for processing. The image enhancement model performs grayscale compensation and contrast adjustment on the image to improve the clarity and readability of the two-dimensional code image, effectively overcoming the image quality problems caused by ambient lighting, shooting angle or device performance. After the enhancement processing, the first two-dimensional code image and the second two-dimensional code image are obtained. The binarization threshold parameter is generated according to the first two-dimensional code image and the second two-dimensional code image. By setting a reasonable threshold, the grayscale value in the two-dimensional code image is converted into binary black and white tones. The generated binarization threshold parameters are used for image segmentation and binarization processing, and the two-dimensional code image is segmented into clear black and white areas to obtain a binary coded image. The binary coded image is geometrically transformed to adjust the shape and angle of the two-dimensional code image to meet the requirements of the standardized two-dimensional code matrix, so that the decoding process is not affected by image tilt or deformation. After the geometric transformation, the standardized two-dimensional code matrix obtained is used for code extraction to extract the digital or character information in the two-dimensional code to form a code extraction result. According to the code extraction result, the two-dimensional code data of the inner packaging unit and the outer packaging unit are classified and sorted, and they are classified as inner and outer layer code data respectively, and the data stream is reconstructed according to the acquisition timing to ensure the timing consistency of the two-dimensional code data, so that the code data corresponding to each two-dimensional code image can be stored and transmitted in the correct order. The reconstructed data streams form a first code data stream and a second code data stream, respectively corresponding to the two-dimensional code data of the inner and outer packaging units.

[0034] S4, inputting the first coded data stream and the second coded data stream into a real-time verification queue, performing hierarchical association operation, and generating a hierarchical rejection signal;

[0035] Specifically, the first coded data stream and the second coded data stream are input into the data buffer pool, and first-in-first-out sorting is performed in the data buffer pool. Each data item in the data stream is processed in the order of collection to ensure the timeliness of data processing. The sorted data forms a time sequence verification data group, and the data is grouped and processed according to the data collection time, and the data is divided into an inner layer code set and an outer layer code set. The system can perform independent verification and association processing on the two-dimensional code data of the inner and outer layers of packaging, avoid cross interference, and improve the verification accuracy. The mapping relationship between the inner layer code set and the outer layer code set is verified. The preset 50:1 mapping rule is adopted, which means that every 50 inner layer code data should correspond to 1 outer layer code data. Through the mapping rule, the quantity between the inner and outer layers of packaging is matched and checked to obtain the quantity matching result. Assuming that the inner layer code set contains 1000 code data and the outer layer code set contains 20 code data, a check is performed according to the 50:1 rule to check whether there is a mismatch between the inner and outer layers of coding. Based on the quantity matching result, the first coded data stream and the second coded data stream are tested for repeatability. Mark the repeated codes and generate repeated code marks. The repeated code mark indicates that the same QR code data has been collected multiple times during the data collection process, or the system has been repeatedly collected due to a fault or other reasons. Repeatability detection helps to ensure the uniqueness of the QR code information of each packaging unit and the accuracy of the traceability data. Verify the validity period of the inner and outer code sets to ensure the timeliness of each QR code information, because the validity of the QR code is affected by the production cycle, batch and other factors during the packaging and production process. According to the collection time of the code, determine whether the QR code is still within the validity period and generate the code timeliness data. Assuming that the validity period of the QR code is 24 hours, if the collection time of a QR code data exceeds 24 hours, it is marked as expired and can no longer be used for traceability. A comprehensive score is calculated based on the quantity matching results, repeated code marks and code timeliness data. Perform a quality assessment on each code data and generate code matching data. Classify all code data according to the code matching data. Assuming that the set threshold is 80%, if the code matching data is higher than 80%, the code data is considered valid, otherwise it is marked as abnormal data. The abnormal level identification is obtained through level classification. If the coding matching degree is lower than a preset threshold (such as 60%), it is marked as a serious abnormality, between 60% and 80% is marked as a slight abnormality, and more than 80% is marked as normal. According to the abnormal level identification, the rejection control parameters are configured to generate a graded rejection signal. This signal guides the system to eliminate abnormal data to ensure that only valid data that meets the conditions is retained.

[0036] S5, based on the graded rejection signal, generating an associated data packet from the first coded data stream and the second coded data stream that have passed the verification, and uploading the data packet to the central control system to generate an associated backup table;

[0037] According to the hierarchical elimination signal, the first coded data stream and the second coded data stream that have passed the verification are subjected to abnormal data elimination, and the data that does not meet the standards due to quality problems or collection errors is removed, and only the valid and verified data is retained, so as to obtain the first coded data stream and the second coded data stream that have passed the verification and meet the standards. Data aggregation processing is performed on these data streams, and a one-to-many relationship is constructed according to the requirements, so that each coded data can be associated with multiple related data items (such as production batches, shifts, production equipment, etc.) to form a coded association pair. The coded association pairs are classified and grouped according to the production line number to obtain a grouped data set. The data is effectively managed according to the production line, production shift, or other key dimensions to ensure that the data of each production link can be traced according to the production line. The grouped data set is associated and bound with the shift information to enhance the hierarchical management of the data. After binding, a unique data packet identifier is generated for each grouped data set, and the identifier can help the system accurately identify and manage the data packet in the subsequent data transmission process. The coded association pair and the identifier are organized into a complete associated data packet. The generated associated data packet is input into the message queue service module for cache sorting to ensure that the data is stored in order and is ready for transmission. The message queue module ensures the order and timeliness of data transmission by caching and sorting data. Before data transmission, the data sequence to be transmitted is checked for data integrity to ensure that no data is lost or damaged during the data transmission process. After the check is passed, the check result data is generated, and the network status of these data is checked to ensure that the network connection is good and the data transmission channel is unobstructed. If the network status check fails, measures are taken to adjust, such as reconnecting the network or switching the data transmission channel. When the network status is good, the data sequence to be transmitted is packetized according to the preset transmission protocol. The large amount of associated data packets are divided into multiple smaller sub-packets to ensure that the data in the transmission process will not fail or be delayed due to the large size of a single data packet. These packetized data are stored in the local database to form a preliminary associated backup table. By mapping and binding the backup table with the transmission status identifier, it is ensured that the status of each data packet can be accurately tracked. The data is uploaded to the central control system through the data cache channel to ensure the stability and reliability of the data during the transmission process. During the data upload process, if the upload fails, the failed data is added to the retransmission queue. Through the cache mechanism of the retransmission queue, the data that failed to be uploaded is retransmitted until the data is successfully uploaded to the central control system. This ensures the integrity and high availability of data transmission to the greatest extent possible, and avoids data loss due to network failure or other reasons. Through the above steps, it is ensured that all verified data can be accurately uploaded to the central control system and a reliable associated backup table can be generated.

[0038] S6, establishing a multi-level traceability index based on the associated data packets, sorting the multi-level traceability index according to the global timestamp sequence, and generating a chain traceability data structure.

[0039] Specifically, the code matching degree data and the associated data packets are parsed to extract the code mapping relationship table. The hierarchical structure between the inner packaging unit and the outer packaging unit is parsed to clarify the relationship between different levels and obtain the hierarchical relationship data. The hierarchical relationship data includes the relative position relationship between the inner and outer packaging units, as well as the various packaging levels of the product and their corresponding time nodes in the production process. Data stratification is performed based on the hierarchical relationship data, and multiple multi-level index nodes are generated according to different hierarchical information. Each index node represents a specific link in the packaging chain. A unique identification code is generated for each multi-level index node to ensure that each node can be uniquely identified and distinguished during the entire traceability process to avoid data confusion and mismatching. The parent-child relationship of the multi-level index nodes is constructed according to the unique identification code, which means that each node is not only an independent traceability information unit, but also has a hierarchical relationship with other nodes. For example, an inner packaging unit depends on the existence of an outer packaging unit, or a batch of production is alternately carried out between multiple production lines. The construction of the parent-child relationship helps the system clarify the logical order of each data node in the traceability process. By establishing the parent-child relationship, a traceability index tree is formed. Each node in the traceability index tree represents a traceability information unit, and the parent-child relationship between nodes describes their hierarchical structure in the traceability process. In order to ensure the accuracy of traceability, the traceability index tree is temporally associated with the global timestamp sequence to ensure the temporal order of the traceability process, so that each data node is arranged in chronological order. After the traceability index tree is temporally associated, it is traversed to obtain the node access sequence to ensure the correct order of each node on the traceability path. The node access sequence is sorted according to the global timestamp sequence to ensure that the data is arranged in the order of the actual occurrence time, thereby ensuring the timeliness and order of the data. The sorted node access sequence is converted into a linked list structure. The bidirectional linked list structure allows forward or backward traversal from any node in the linked list, thereby improving the flexibility and efficiency of data access. The predecessor and successor pointers of adjacent nodes in the bidirectional linked list are associated to ensure that each node can be accurately associated with its predecessor node and successor node to form a complete chain traceability structure. The node pointer relationship in the chain traceability structure makes the traceability process not only a linear traversal starting from a certain node, but also achieves more efficient search and data reconstruction through predecessor and successor pointers. A node index table is established based on the chain traceability structure. The node index table is an index data structure that records the address and associated information of each node in the chain traceability structure, which can accelerate subsequent access and retrieval of the node. The node index table is input into the fast retrieval unit for structural optimization. Through structural optimization, it is ensured that when facing a large amount of data, the query and data tracing of the node can still be completed in the shortest time, thereby improving the efficiency of data processing. All these processing results form a chain traceability data structure.This data structure can achieve accurate traceability of the packaging process through multi-level traceability index, time sorting, bidirectional linked lists and other technical means, ensuring that each packaging link is accurately tracked and verified according to the time sequence and hierarchical relationship. At the same time, it can quickly respond to different query requirements and improve traceability efficiency.

[0040] Among them, before the registration identification information of the on-site management unit is input into the central control system for identity verification and clock synchronization calculation, the following steps are also included: feature extraction of mechanical vibration frequency data collected by the production line sensor to obtain a working condition feature vector, and input the working condition feature vector into the working condition analysis model for state recognition; based on the state recognition result, real-time compensation calculation of the installation angle of the code reader is performed to obtain an angle adjustment parameter, and the code reader bracket is controlled to automatically level according to the angle adjustment parameter; the image signal collected by the code reader is input into the image quality evaluation unit for fuzziness analysis to obtain clarity score data, and an image quality optimization instruction is generated according to the clarity score data; based on the image quality optimization instruction, the exposure parameters, aperture size, and LED fill light intensity of the code reader are adaptively adjusted to obtain an image acquisition parameter group; the working condition feature vector and the image acquisition parameter group are combined into a matrix; The deep learning model is input for dynamic feature association to obtain the working condition-imaging mapping model; the working condition-imaging mapping model is trained and updated online to obtain the optimal acquisition parameter set, and the optimal acquisition parameter set is sent to the on-site code reading equipment; the code reading trigger timing is dynamically predicted according to the running speed of the packaging machine to obtain the optimal trigger timing parameters, and the optimal trigger timing parameters are input into the code reading controller; the code reading equipment is controlled for parallel acquisition based on the optimal trigger timing parameters to obtain a multi-channel image data stream, and the multi-channel image data stream is fused in real time; the multi-channel image data stream is input into the neural network model for image quality evaluation to obtain the image quality score, and the acquisition strategy is automatically adjusted according to the image quality score; the working conditions with an acquisition success rate lower than the preset threshold are marked with features to obtain an abnormal working condition feature library, and the acquisition parameters are continuously optimized based on the abnormal working condition feature library.

[0041] In one example, the registration identification information of the field management unit is input into the central control system for identity verification and clock synchronization calculation to generate a global timestamp sequence, including:

[0042] Input the system code, communication port number, and IP address of the field management unit into the central control system for data analysis to obtain a registration data pair, perform system verification on the registration data pair, obtain connection permission parameters, and establish a communication connection state according to the connection permission parameters;

[0043] Based on the communication connection status, data synchronization and configuration data acquisition are performed to obtain shift parameters, product specification parameters and personnel parameters, and the data is organized and processed according to the shift parameters, product specification parameters and personnel parameters to obtain the basic parameter data structure;

[0044] Perform time synchronization management on the basic parameter data structure, obtain the current standard time data, and establish internal clock calculation for the current standard time data;

[0045] The internal clock operation is regularly detected with a cycle of 1 hour to obtain a clock deviation value, and the clock deviation value is compared with a preset threshold of 10 minutes to obtain a comparison result;

[0046] Based on the comparison operation result, the internal clock data is calibrated to obtain a calibrated time data stream, and the calibrated time data stream is encoded according to the time series to obtain a global timestamp sequence.

[0047] In this example, the system receives the system code, communication port number, IP address and other information of the field management unit, and inputs it into the central control system for data analysis. By analyzing the system code, communication port number, IP address and other information, a registration data pair is formed. The registration data pair contains the identification information of the field management unit and the necessary parameters for communicating with it. These data are verified by the system to confirm whether the identity of the field management unit is authentic and legal, ensuring the security of the system connection. If the verification is successful, the connection permission parameters are obtained. The connection permission parameters are the key for the central control system to determine whether to allow the establishment of a connection with the field management unit. After the connection permission parameters are verified, the central control system establishes a communication connection state, indicating that the communication between the two can be carried out stably. Data synchronization and configuration data acquisition are performed based on the communication connection state to obtain various configuration data related to the current production, including shift parameters, product specification parameters and personnel parameters. Shift parameters include the start and end time of the current production shift, production date, etc., product specification parameters include product specifications, models and other information, and personnel parameters include the identity information of the personnel involved in the production process. Based on these parameters, data is organized and processed. The original configuration data is classified and integrated according to certain rules to form a structured data system, namely the basic parameter data structure. Time synchronization management is performed on the basic parameter data structure so that the time records and various operations of the entire production process can be coordinated in a unified manner to avoid data confusion or distortion caused by time inconsistencies between different devices or management systems. At this time, the current standard time data is obtained. By parsing the standard time data, an internal clock operation model is established, and the model is used for time synchronization. The internal clock operation converts the standard time into the clock time inside the field management unit through a precise algorithm, thereby ensuring that all operations are based on a unified time standard. The accuracy of the internal clock is regularly tested to ensure its stability and accuracy. The system performs regular detection in a cycle of 1 hour, that is, the clock deviation is checked every 1 hour. The clock deviation value refers to the difference between the system's internal clock and the standard time, which is calculated using the following formula:

[0048] Clock deviation value

[0049] in, is the time value of the system's current internal clock, The clock deviation value is a key indicator to measure the consistency between the system clock and the standard time. The clock deviation value is compared with the preset threshold (for example, 10 minutes) to ensure that the difference between the system internal clock and the standard time does not exceed a reasonable range. For example, if the clock deviation value is greater than 10 minutes, it means that the clock needs to be calibrated. The comparison operation is performed using the following formula:

[0050] Comparison results ;

[0051] If the comparison result shows that the clock deviation is too large, perform clock calibration. Adjust the time value of the system's internal clock according to the standard time, reduce or correct the clock deviation, and align it with the standard time again. Through calibration, ensure that future operations and data records can accurately reflect the actual time progress. After the clock calibration is completed, a calibrated time data stream is generated. In order to ensure that these time data can be effectively managed and used, the calibrated time data stream is encoded according to the time series. The encoded time data stream forms a global timestamp sequence, that is, a chronological sequence of time identifiers that is used to mark the specific time of each data point or operation.

[0052] In one example, the production plan data is task parsed, and the status self-check is performed on the code reading device to generate a trigger timing control signal, including:

[0053] Through the data interface, the production plan data of the plant-level management subsystem is parsed and deconstructed to obtain the planned task data, and field extraction operations are performed on the planned task data to obtain the planned number, product specification code, planned output, team information, planned start time, and planned end time;

[0054] Based on the product specification code, product specification verification and parameter matching processing are performed to obtain the QR code rule configuration data, and the self-test program of the code reader is activated according to the QR code rule configuration data to obtain the code reader detection start signal;

[0055] Based on the code reader detection start signal, multi-mode detection is performed on the code reader's lens cleanliness, communication link, and trigger signal to obtain the equipment working status data;

[0056] Perform code reading success rate test calculation on the equipment working status data to obtain status evaluation data, compare the status evaluation data with the preset standard threshold value to obtain equipment abnormality level data;

[0057] Generate operating status feedback data based on planned task data and equipment abnormality level data, and upload the operating status feedback data to the plant-level management subsystem for storage;

[0058] The trigger parameters are set according to the QR code rule configuration data and the equipment working status data to obtain a trigger timing control signal.

[0059] In this example, the production plan data of the plant-level management subsystem is parsed and deconstructed through the data interface to extract key information from the production plan. The production plan data includes the plan number, specification code, planned output, team information, and planned start and end time. The production plan data obtained through the parsing interface is gradually deconstructed for subsequent processing. For example, the plan number is the unique identifier of the entire production plan, the specification code is the key to identifying the product specifications, the planned output refers to the number of products that need to be produced during the entire production cycle, the team information is related to the team of personnel who specifically implement the plan, and the planned start and end time define the time frame of the production plan. Specification verification and parameter matching processing are performed based on the specification code. As an important production information, the specification code needs to be verified to ensure that the product type, specification and production requirements corresponding to the code are consistent with the actual production task. By comparing with the specification information in the database, the validity of the specification is verified, and the QR code rule configuration data is obtained according to the verification result. The QR code rule configuration data contains information such as the generation rules of the product code, the construction method of the QR code, and the QR code requirements for each packaging level. These rules are used to activate the self-check program of the code reader to ensure that the device functions normally when reading the QR code. The self-check program will start the hardware and software check of the device to check whether there are hardware failures, poor communication links or program abnormalities. The obtained code reader detection start signal indicates that the device can start working normally. Based on the code reader detection start signal, various working states of the device are detected. This includes multi-mode detection of the cleanliness of the code reader lens, the stability of the communication link and the effectiveness of the trigger signal. The cleanliness of the lens directly affects the reading accuracy of the QR code. The cleanliness detection algorithm is used to determine whether the lens is stained or damaged. The stability of the communication link is evaluated by analyzing parameters such as signal strength and transmission delay. If there is an abnormality in the link, it will cause data transmission delay or loss, affecting the accuracy of production traceability. The trigger signal is the signal for the code reader to start scanning the QR code. Any abnormality in the trigger signal will cause the scanning process to fail. This series of tests ensures that the device is in the best working state, thereby ensuring the accurate collection of the QR code. The code reading success rate test calculation is performed on the device working status data. The code reading success rate directly reflects the performance of the device. This indicator is obtained by counting the ratio of the number of successfully scanned QR codes to the total number of scans within a certain period of time. This result can clearly show whether the device is in normal working condition. If the success rate is lower than the preset standard threshold, it means that the device is faulty or abnormal and needs to be repaired or adjusted. At this time, the status assessment data of the device will be compared with the preset standard threshold. By comparison, the device abnormality level data is obtained, which reflects the severity of the current status of the device.For example, when the equipment status evaluation result is lower than the preset threshold (such as 90% success rate), the evaluation result is marked as "mild abnormality", and when it is lower than 80%, it is marked as "serious abnormality". These abnormality level data will help production personnel determine whether the equipment needs maintenance or replacement, and make decisions in time. Based on the production plan data and equipment abnormality level data, the operation status feedback data is generated. The operation status feedback data includes information such as equipment status, production progress, and QR code recognition, which can reflect the operation status of the production line in real time. The operation status feedback data is uploaded to the factory-level management subsystem for storage for subsequent monitoring, tracing and analysis. The uploaded data includes the working status of the equipment, the completion of the planned tasks, and abnormal conditions in production. These data are used for the generation of production reports in the later stage to help the factory to carry out production scheduling, equipment maintenance plan formulation and efficiency optimization. According to the QR code rule configuration data and the equipment working status data, the trigger parameters are set to generate a trigger timing control signal. The trigger timing control signal is used to control the scanning sequence of the packaging machine equipment and the timing of the QR code collection. The setting of the trigger is determined according to the current status of the equipment, the QR code rules and the requirements of the production plan. For example, if the device is in the "normal working" state, the trigger will set the precise scanning sequence according to the schedule in the production plan to ensure that the collection of QR codes is consistent with the production progress. If the device is in the "abnormal" state, the trigger will suspend the scanning operation and wait until the device status returns to normal before continuing the QR code collection.

[0060] In one example, according to the trigger timing control signal, the first two-dimensional code image of the inner packaging unit and the second two-dimensional code image of the outer packaging unit are collected and decoded to obtain the first coded data stream and the second coded data stream, including:

[0061] Based on the trigger timing control signal, the trigger sequence is allocated to obtain the inner layer code reading trigger signal and the outer layer code reading trigger signal, and the high-speed acquisition module is controlled to capture the image according to the inner layer code reading trigger signal and the outer layer code reading trigger signal to obtain a real-time two-dimensional code image sequence;

[0062] Performing regional positioning processing on the real-time two-dimensional code image sequence to obtain the two-dimensional code image area of ​​the inner packaging unit and the two-dimensional code image area of ​​the outer packaging unit;

[0063] Inputting the inner packaging unit two-dimensional code image region and the outer packaging unit two-dimensional code image region into the image enhancement model for grayscale compensation and contrast adjustment to obtain a first two-dimensional code image and a second two-dimensional code image;

[0064] Generate a binarization threshold parameter according to the first two-dimensional code image and the second two-dimensional code image, and perform image segmentation and binarization processing based on the binarization threshold parameter to obtain a binarized coded image;

[0065] Performing geometric transformation on the binary coded image to obtain a standardized two-dimensional code matrix, and performing code extraction based on the standardized two-dimensional code matrix to obtain a code extraction result;

[0066] The two-dimensional code data of the inner packaging unit and the outer packaging unit are classified and sorted according to the code extraction results to obtain initial code data, and the initial code data is reconstructed according to the acquisition sequence to obtain a first code data stream and a second code data stream.

[0067] In this example, the trigger sequence is allocated based on the trigger timing control signal to obtain the inner layer code reading trigger signal and the outer layer code reading trigger signal. The two-dimensional code image acquisition of the inner and outer packaging units is parallel, but due to the different positioning and decoding requirements of the inner and outer layer two-dimensional codes, the trigger signal is precisely controlled. The two signals trigger the inner and outer layer two-dimensional code acquisition tasks respectively to ensure the timing and synchronization of image acquisition and avoid image misalignment or loss caused by improper scanning timing. Once the inner layer code reading trigger signal and the outer layer code reading trigger signal are activated, the corresponding high-speed acquisition module starts real-time image capture to obtain a real-time two-dimensional code image sequence. The real-time two-dimensional code image sequence is subjected to regional positioning processing. Due to the differences in position and size of the two-dimensional code images of the inner and outer packaging units, the task of regional positioning processing is to determine the position of the inner and outer two-dimensional code images in the image sequence, and then accurately decode them. By performing edge detection and regional segmentation on the image, the inner and outer two-dimensional code image areas are identified. This process uses algorithms such as Hough transform or Canny edge detection to ensure the precise positioning of the two-dimensional code image area. For example, assuming the size of the image area is The inner and outer QR code areas are divided into two parts through a specific recognition algorithm: the coordinates of the inner area are to , the coordinates of the outer region are to , and obtain the location information of the inner and outer QR code areas. After completing the area positioning, the inner and outer QR code image areas are respectively input into the image enhancement model for processing, and the image is grayscale compensated and contrast adjusted to improve the readability of the QR code image. Grayscale compensation refers to adjusting the brightness of the image to make the various parts of the image more visually balanced, while contrast adjustment is to increase the difference between light and dark in the image to make the graphics in the QR code more prominent and easier to identify. Assume that the grayscale value of the original image is , the new gray value after gray compensation is:

[0068] ;

[0069] in, and are adjustment factors to control the contrast and brightness of the image, respectively. The enhanced image is processed into a first two-dimensional code image and a second two-dimensional code image, corresponding to the two-dimensional code images of the inner and outer layers, respectively. A binarization threshold parameter is generated based on the first two-dimensional code image and the second two-dimensional code image. The grayscale image is converted into an image containing only black and white colors, thereby simplifying the decoding process. By calculating the grayscale histogram of the image, a threshold is automatically generated, and the Otsu algorithm is used to determine the optimal binarization threshold. This threshold divides the pixel values ​​in the image into two categories: pixels below the threshold are set to black (background), and pixels above the threshold are set to white (two-dimensional code encoding). The binarized encoded image, as the basis for two-dimensional code decoding, significantly improves the accuracy of image recognition. After binarization, the image is geometrically transformed to ensure the standardization of the two-dimensional code matrix. Through operations such as rotation, scaling, and cropping, the shape and proportion of the two-dimensional code matrix are consistent with those of the standard two-dimensional code matrix to avoid deformation of the two-dimensional code due to shooting angles or light problems. Assume that the original two-dimensional code matrix is , after geometric transformation, the standardized two-dimensional code matrix is ​​obtained , so that the QR code can maintain the correct shape under any conditions for subsequent decoding. The standardized QR code matrix is ​​further processed, and the system extracts the coded information therein. The data in the QR code is arranged by a series of black and white squares (modules). After the decoding algorithm, the coded data is extracted from the standardized QR code matrix. The code extraction process relies on the Reed-Solomon algorithm in the QR code decoder, which can still successfully decode in the presence of certain noise or damage. Through decoding and extraction, the data in the QR code, such as product number, production date, batch information and other key information, is obtained. According to the code extraction results, the QR code data of the inner packaging unit and the outer packaging unit are classified and sorted to obtain the initial code data. These data are organized into a clear structure for subsequent traceability and analysis. The initial code data is reconstructed according to the acquisition sequence of the QR code and converted into the first code data stream and the second code data stream. The two data streams correspond to the QR code data of the inner and outer packaging units respectively.

[0070] In one example, the first coded data stream and the second coded data stream are input into a real-time verification queue, hierarchical association operation is performed, and a hierarchical rejection signal is generated, including:

[0071] Input the first coded data stream and the second coded data stream into a data buffer pool for first-in-first-out sorting to obtain a timing verification data group, and group the timing verification data group according to the acquisition time to obtain an inner layer coding set and an outer layer coding set;

[0072] Verify the mapping relationship between the inner layer code set and the outer layer code set, and perform quantity matching verification according to the preset mapping rule of 50:1 to obtain the quantity matching result;

[0073] Based on the quantity matching result, the first coded data stream and the second coded data stream are tested for duplication to obtain a repeated coding mark, and the inner coding set and the outer coding set are verified for validity to obtain coding timeliness data;

[0074] A comprehensive score is calculated based on the quantity matching results, repeated coding marks and coding timeliness data to obtain coding matching data;

[0075] The coding matching degree data is graded and processed according to the preset threshold value to obtain the abnormal grade identification, and the rejection control parameters are configured for the abnormal grade identification to obtain the graded rejection signal.

[0076] In this example, the first encoded data stream and the second encoded data stream are input into the data buffer pool for first-in-first-out sorting to ensure the order of the data and ensure that the system will not be out of order when processing data, thereby ensuring the time consistency of the data stream. For example, assuming that the first encoded data stream contains a timestamp of The second encoded data stream contains a timestamp of The data stream is processed in chronological order after first-in-first-out sorting, and a timing verification data group is obtained. The timing verification data group is grouped according to the acquisition time, and the inner and outer QR code data are sorted into independent sets. By grouping the data according to the acquisition time, two main data sets are obtained: the inner encoding set and the outer encoding set. The acquisition time of the inner and outer QR codes will be slightly different. The grouping process ensures that the inner and outer QR code data will not be confused in the subsequent verification process. For example, assuming that the acquisition time of the first encoded data stream (inner QR code) and the second encoded data stream (outer QR code) are and , after time grouping, the inner coding set contains the coding data within a time range, while the outer coding set contains the coding data within another time range. The mapping relationship between the inner coding set and the outer coding set is verified, and the quantity matching check is performed according to the preset mapping rule of 50:1. The data of the inner packaging and the outer packaging need to maintain a certain mapping relationship, that is, each inner QR code must correspond to an outer QR code. The preset mapping rule of 50:1 means that every 50 inner coding data corresponds to 1 outer coding data. Through this rule, a quantity matching check is performed to ensure that each inner QR code has corresponding outer QR code data. This process is achieved by comparing the number of inner and outer codes. If the quantity match does not meet the preset rules, the data is marked as abnormal. Assume that the number of inner coding sets is , the number of outer encoding sets is , then the mapping rules require: ;

[0077] If this relationship does not hold, the system will issue a warning, indicating that the mapping relationship does not comply with the preset rules. Based on the quantity matching results, the first encoded data stream and the second encoded data stream are checked for repeatability to obtain a repeated encoding mark. Find out whether there are repeated QR code codes. In the same production batch, repeated QR code codes will cause data redundancy, which will affect subsequent traceability and analysis. Repeatability detection uses a hash algorithm or a data fingerprint recognition algorithm to ensure the uniqueness of each QR code code. If a repeated code is detected, a repeated encoding mark is generated for the code. The validity period of the inner code set and the outer code set are verified to confirm the validity of the QR code. The validity period of the QR code is usually related to factors such as the production batch, storage time, and transportation time. Only the QR code data within the validity period is considered valid. The validity period verification is achieved by comparing the generation time, production date, and expiration date of the code. For example, if the generation time of the QR code is , the expiration time is , check the current time Whether it is within the validity period, the formula is: ;

[0078] If the time of the QR code does not meet this condition, the QR code is considered invalid and marked as expired. Based on the quantity matching results, repeated coding marks and coding timeliness data, a comprehensive score calculation is performed to obtain the coding matching data. This calculation process combines information from various data sources to evaluate the accuracy and completeness of the QR code data. The calculation of the comprehensive score is based on the weighted average method, which converts the results of quantity matching, repeatability detection and validity period verification into a comprehensive score. For example, the weight of the quantity matching is set to , the weight of repeatability detection is , the weight of validity period verification is , the comprehensive score is expressed as:

[0079] Score Match Result Duplicate Flag Validity;

[0080] Among them, Match Result is the score of quantity matching, Duplicate Flag is the score of duplicate flag, and Validity is the score of validity period. According to the coding matching data, the level is divided and processed according to the preset threshold to obtain the abnormal level identification. According to the scoring results of the matching data, the coding data is divided into multiple levels. For example, if the comprehensive score is greater than 0.9, the data is regarded as high-quality coding; if the comprehensive score is between 0.7 and 0.9, it is qualified coding; if the score is lower than 0.7, the data is regarded as abnormal coding. According to the abnormal level identification, the elimination control parameter configuration is generated to control the elimination of abnormal data in the subsequent data processing process. For example, if the comprehensive score of a certain code is lower than 0.7, the code will be eliminated from the data stream to prevent unqualified data from affecting the traceability results.

[0081] In one example, based on the graded rejection signal, the first coded data stream and the second coded data stream that have passed the verification are generated into associated data packets, and uploaded to the central control system to generate an associated backup table, including:

[0082] Abnormal data is eliminated from the first coded data stream and the second coded data stream according to the graded elimination signal to obtain the first coded data stream and the second coded data stream that pass the verification, and data aggregation and one-to-many relationship construction are performed on the first coded data stream and the second coded data stream that pass the verification to obtain a coded association pair;

[0083] Classify and group the coded association pairs according to the production line number to obtain a grouped data set, associate and bind the grouped data set with the shift information, generate a data packet identifier based on the grouped data set, and organize the data packet identifier and the coded association pairs into an associated data packet;

[0084] Input the associated data packets into the message queue service module for cache sorting, obtain the data sequence to be transmitted, perform data integrity check on the data sequence to be transmitted, obtain the check result data, and perform network status detection on the check result data;

[0085] The data sequence to be transmitted is packetized according to the transmission protocol, an associated backup table is generated in the local database, the associated backup table is mapped and bound to the transmission status identifier, and uploaded to the central control system through the data cache channel, and the data that failed to be uploaded is cached in the retransmission queue.

[0086] In this example, according to the hierarchical elimination signal, the first encoded data stream and the second encoded data stream are respectively subjected to abnormal data elimination. Through pre-set rules or models, according to the matching degree of the code, validity period and other standards, the abnormal data in the data stream is identified and eliminated. For example, assuming that the first encoded data stream contains several codes that do not comply with the timestamp rule or repeated codes, these data are marked as abnormal according to the hierarchical elimination signal and deleted from the data stream. After the abnormal data is eliminated, the first encoded data stream and the second encoded data stream that pass the verification are obtained. Data aggregation and one-to-many relationship construction are performed on the data streams that pass the verification to obtain a coding association pair. Data aggregation means merging multiple data points into a new data set for subsequent processing. In this process, the code of the inner packaging unit (first encoded data stream) and the code of the outer packaging unit (second encoded data stream) are associated according to certain rules, and a one-to-many relationship is constructed. For example, assuming that a certain code in the first encoded data stream With multiple outer encodings Correspondingly, multiple encoding association pairs are constructed, such as After completing data aggregation and the construction of coding association pairs, the coding association pairs are classified and grouped according to the production line number. The production line number is used to distinguish products on different production lines. Therefore, these coding association pairs are classified according to the production line number to form a grouped data set. Assume that the production line number of the system is At this stage, each production line number will have a corresponding set of encoding association pairs. For example, the production line number is The grouped data set includes all the data belonging to the production line The encoding association pairs form a set: . Associate the grouped data set with the shift information. The shift information includes the start and end time of production, operator and other information. Bind this information to each grouped data set for subsequent traceability and management. For example, suppose the shift information includes "Shift A" and its corresponding production time period, and the production line number is The packet data set of will be bound to "Shift A" so that each data packet contains the production time and shift information. Based on this information, a unique identifier is generated for each data packet as the data packet identifier. The data packet identifier is a unique ID that can accurately identify a set of code association pairs and the associated production information. After the data packet identifier is generated, these identifiers are organized into associated data packets together with the code association pairs. For example, suppose the data packet identifier is , whose content includes the coded association pair and production information. The generated association data packet contains the following information: , shift information, production line number. The associated data packets are input into the message queue service module for cache sorting to ensure that the data packets are transmitted in the appropriate order and to prevent data loss or duplication. In the message queue, a first-in-first-out strategy or other typesetting mechanism is adopted to sort the data packets according to the timestamp or priority of the data packets to ensure the transmission order of the data and the consistency of the production process. After processing and sorting, the data sequence to be transmitted is obtained, which contains all the associated data packets that need to be transmitted. After sorting the data sequence to be transmitted, a data integrity check is performed to ensure that the data packets have not been tampered with or lost during the transmission process, which is achieved through a checksum or hash algorithm. For example, a checksum is calculated for each data packet. , and compare it with the checksum calculated during the transmission process. If the two are consistent, it means that the data has maintained integrity during the transmission process. The network status detection is performed on the check result data to ensure the stability of the network environment during the transmission process. For example, if the system detects that the network delay is high or packet loss occurs, the data transmission strategy is adjusted in time to avoid data transmission failure. The network status detection is achieved by regularly detecting the bandwidth, delay, packet loss rate and other parameters of the transmission channel. Assume that the parameters of the network status are If an abnormal network status is detected, corresponding adjustments are made to ensure that the data can be uploaded smoothly. After passing the data integrity check and network status detection, the data sequence to be transmitted is packetized according to the predetermined transmission protocol. The transmission protocol is selected according to the network environment, data size and application requirements. Common transmission protocols include TCP, UDP, etc. In this process, the data packet is divided into several small packets and a sequence number is assigned to each small packet. For example, if the size of the data packet to be transmitted is , and the maximum size of each subpacket is , the data packet is divided according to the following formula: ;

[0087] After packet processing, each packet is added to the transmission queue and transmitted according to the order of packet processing. After the packet processing is completed, an associated backup table is generated in the local database. The role of the associated backup table is to back up each transmitted data packet and its status so that it can be restored in the event of a transmission error. The backup table records the transmission status of each data packet, such as "sent", "not sent" or "retransmitted". By maintaining this backup table, it is ensured that data can be restored and retransmitted in time even if a failure occurs. The data is uploaded to the central control system through the data cache channel. The transmission is monitored and managed according to the status identifier of the upload. If the upload fails, the failed data packet is added to the retransmission queue and waits for re-upload. The data packets in the retransmission queue are reordered according to information such as priority and timestamp, and retransmitted at the appropriate time until all data are successfully uploaded to the central control system.

[0088] The data sequence to be transmitted is packetized according to the transmission protocol, an associated backup table is generated in the local database, the associated backup table is mapped and bound to the transmission status identifier, and uploaded to the central control system through the data cache channel, and the data that failed to be uploaded is cached in the retransmission queue, including: dynamically slicing the data sequence to be transmitted according to the network status indicator to obtain data slicing of adaptive size, inputting the data slicing into the reinforcement learning training module to learn the optimal slicing strategy; dynamically planning the data packet size and transmission timing based on the optimal slicing strategy to obtain transmission optimization parameters, and generating an adaptive transmission queue according to the transmission optimization parameters; inputting the transmission optimization parameters into the deep neural network to predict the network status to obtain the transmission risk assessment value, and prioritizing the adaptive transmission queue according to the transmission risk assessment value; based on Q-learn ing algorithm extracts features and constructs reward functions for historical transmission data to obtain a transmission strategy model, which is then iteratively optimized online. The transmission strategy model and the adaptive transmission queue are input into the decision execution unit to obtain intelligent scheduling instructions, and data is uploaded in batches according to the intelligent scheduling instructions. The network throughput, delay fluctuation, and packet loss rate during the upload process are monitored in real time to obtain transmission quality indicators, which are then input into the reinforcement learning model for status update. Based on the transmission quality indicators, the failure causes of the data that failed to be transmitted are analyzed to obtain fault feature vectors, which are then input into the deep learning model for fault pattern recognition and prediction. The retransmission strategy is dynamically adjusted according to the prediction results of the fault pattern to obtain the optimized retransmission time window, and the retransmitted data is intelligently retransmitted according to the optimized retransmission time window.

[0089] In one example, a multi-level traceability index is established based on associated data packets, and the multi-level traceability index is sorted according to a global timestamp sequence to generate a chain traceability data structure, including:

[0090] Parsing the coding matching degree data and the associated data packets to obtain a coding mapping relationship table, and parsing the hierarchical structure of the inner packaging unit and the outer packaging unit based on the coding mapping relationship table to obtain hierarchical relationship data;

[0091] Perform data stratification processing based on hierarchical relationship data to obtain multi-level index nodes, and generate unique identification codes for the multi-level index nodes;

[0092] Constructing parent-child relationships of multi-level index nodes according to unique identification codes to obtain a tracing index tree, temporally associating the tracing index tree with a global timestamp sequence, traversing the tracing index tree to obtain a node access sequence, and sorting the node access sequence according to the global timestamp sequence to obtain a sorted node access sequence;

[0093] The sorted node access sequence is converted into a linked list to obtain a doubly linked list structure, and the predecessor and successor pointers of adjacent nodes in the doubly linked list structure are associated to obtain a chain traceability structure. A node index table is established based on the chain traceability structure, and the node index table is input into a fast retrieval unit for structural optimization to obtain a chain traceability data structure.

[0094] In this example, the code matching data and the associated data packets are parsed to obtain a code mapping table. The code of the inner packaging unit is associated and mapped with the code of the outer packaging unit to reveal their hierarchical relationship in the production chain. For example, in a packaging process, the QR code of the inner packaging unit represents the production batch of a product, while the QR code of the outer packaging unit represents the outer packaging information of the product. By parsing the code matching data and the associated data packets, the corresponding relationship between these codes can be extracted to obtain a code mapping table. Based on the code mapping table, the hierarchical structure of the inner packaging unit and the outer packaging unit is parsed to obtain hierarchical relationship data. Hierarchical relationship data is structural data that describes how packaging units are interrelated and nested in the production process. For example, an outer packaging unit contains multiple inner packaging units, and the inner packaging unit contains multiple smaller units. This hierarchical relationship is reflected by parsing the code of each packaging unit. In the hierarchical structure parsing process, the position and level of each packaging unit are determined based on the information in the code mapping table, and the hierarchical data of the product from the outermost layer to the innermost layer is constructed. Based on the hierarchical relationship data, data is hierarchically processed to obtain multi-level index nodes. Multi-level index nodes are the key in the traceability process, representing packaging units or items at different levels. Each index node has a unique identifier to help the system distinguish different nodes. According to the unique identification code, the parent-child relationship of the multi-level index nodes is constructed to form a traceability index tree. The traceability index tree is a typical tree data structure, representing the hierarchical relationship from the outermost packaging unit to the inner packaging unit. In this tree, each node represents a packaging unit, and the parent-child relationship between each node represents the inclusion relationship between packaging units. For example, the outer packaging unit is the parent node and the inner packaging unit is the child node. Through the construction of the parent-child relationship, the source of each packaging unit and its position in the production process can be accurately tracked. In the process of constructing the traceability index tree, the tree hierarchy is ensured to be clear, each parent node has multiple child nodes, and each node has a unique identifier. After the traceability index tree is constructed, it is time-associated with the global timestamp sequence. The global timestamp is time data that records the time point of each stage of the production process and marks the event. For example, assume that each packaging unit has a timestamp during the production process, indicating the time when the unit was produced. Associate the timestamp with each node in the traceability index tree to ensure that each node has accurate time information. Through time association, the time node of each packaging unit in the production process is traced. Traverse the traceability index tree to obtain a node access sequence. Traversal is an operation in data structure processing, which accesses each node in the tree in a certain order. According to the global timestamp sequence, traverse the nodes in the traceability index tree to obtain a node access sequence in time order.Assume that the system has a traceability index tree containing multiple nodes, and the nodes are accessed in the order sorted by timestamps. Indicates that Indicates the earliest completed node, Indicates the last completed node. In order to achieve the optimal sorting of node access order, the node access sequence is sorted according to the global timestamp sequence to obtain the sorted node access sequence. For example, suppose that in a production process, the timestamp of the first packaging unit is , the timestamp of the second packaging unit is , by comparing the timestamps, according to The sorted node access sequence is sorted according to the rules. After the sorted node access sequence is processed by linked list conversion, a doubly linked list structure is obtained. A doubly linked list is a bidirectional traversal data structure in which each node contains two pointers: one pointing to the previous node and the other pointing to the next node. The linked list conversion process will convert the sorted node access sequence from a tree structure to a linear structure, which is convenient for subsequent traversal and access operations. In a doubly linked list, assuming that the node and nodes Adjacent, then The successor pointer points to ,and The predecessor pointer points to . After obtaining the bidirectional linked list structure, the predecessor and successor pointers of adjacent nodes are associated to obtain a chain traceability structure. A chain traceability structure refers to a set of nodes associated by pointers, which can be quickly accessed by traversing the linked list. Based on the chain traceability structure, a node index table is established. The node index table records the unique identifier of each node and their position in the linked list, thereby facilitating subsequent search and access. The node index table is input into the fast retrieval unit for structural optimization to obtain a chain traceability data structure. Through this optimization process, the query efficiency is improved, so that the position of each node can be quickly located during tracing, thereby accelerating the tracing process. For example, by storing the node index table in a hash table or a tree index, the system can complete the search for nodes in a constant time, thereby improving the speed of data retrieval.

[0095] Reference Figure 2 This embodiment provides a two-dimensional code dynamic tracing device for a packaging machine, including:

[0096] Verification module 1, used to input the registration identification information of the field management unit into the central control system for identity verification and clock synchronization calculation, and generate a global timestamp sequence;

[0097] Analysis module 2, used to perform task analysis on production plan data, perform status self-check on the code reading device, and generate a trigger timing control signal;

[0098] The operation module 3 is used to collect the first two-dimensional code image of the inner packaging unit and the second two-dimensional code image of the outer packaging unit according to the trigger timing control signal and perform decoding operation to obtain the first coded data stream and the second coded data stream;

[0099] A grading module 4, used for inputting the first coded data stream and the second coded data stream into the real-time verification queue, performing a hierarchical association operation, and generating a grading rejection signal;

[0100] The uploading module 5 is used to generate a related data packet from the first coded data stream and the second coded data stream that have passed the verification based on the graded rejection signal, and upload it to the central control system to generate a related backup table;

[0101] The generating module 6 is used to establish a multi-level tracing index based on the associated data packets, sort the multi-level tracing index according to the global timestamp sequence, and generate a chain tracing data structure.

[0102] In this embodiment, for the specific implementation of each unit in the above device embodiment, please refer to the above method embodiment, which will not be repeated here.

[0103] Reference Figure 3 In an embodiment of the present invention, a computer device is also provided. The computer device may be a server, and its internal structure may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a display screen, an input device, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the corresponding data in this embodiment. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.

[0104] Those skilled in the art will understand that Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied.

[0105] An embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented. It can be understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0106] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided by the present invention and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-speed data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM.

[0107] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

[0108] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A packaging machine two-dimensional code dynamic tracing method, characterized in that: The following steps are involved: Input the registration identification information of the field management unit into the central control system for identity verification and clock synchronization calculation to generate a global timestamp sequence; Perform task analysis on production plan data, perform status self-check on code reading equipment, and generate trigger timing control signals; According to the trigger timing control signal, a first two-dimensional code image of the inner packaging unit and a second two-dimensional code image of the outer packaging unit are collected and decoded to obtain a first coded data stream and a second coded data stream; Input the first coded data stream and the second coded data stream into a real-time verification queue, perform hierarchical association operations, and generate a graded rejection signal; specifically, the method includes: inputting the first coded data stream and the second coded data stream into a data buffer pool for first-in-first-out sorting to obtain a timing verification data group, and grouping the timing verification data group according to the acquisition time to obtain an inner layer coding set and an outer layer coding set; verifying the mapping relationship between the inner layer coding set and the outer layer coding set, and performing a quantity matching check according to a preset mapping rule of 50:1 to obtain a quantity matching result; performing a repeatability check on the first coded data stream and the second coded data stream based on the quantity matching result to obtain a repeated coding mark, and performing a validity period verification on the inner layer coding set and the outer layer coding set to obtain coding timeliness data; performing a comprehensive score calculation based on the quantity matching result, the repeated coding mark and the coding timeliness data to obtain coding matching degree data; performing a grade classification process on the coding matching degree data according to a preset threshold to obtain an abnormal level identifier, and performing a rejection control parameter configuration on the abnormal level identifier to obtain a graded rejection signal; Based on the graded rejection signal, the first coded data stream and the second coded data stream that have passed the verification are used to generate associated data packets, and the data packets are uploaded to the central control system to generate an associated backup table; A multi-level tracing index is established based on the associated data packet, and the multi-level tracing index is sorted according to the global timestamp sequence to generate a chain tracing data structure.

2. The packaging machine two-dimensional code dynamic tracing method according to claim 1 is characterized in that: The method of inputting the registration identification information of the field management unit into the central control system for identity verification and clock synchronization calculation to generate a global timestamp sequence includes: Input the system code, communication port number, and IP address of the field management unit into the central control system for data analysis to obtain a registration data pair, perform system verification on the registration data pair, obtain connection permission parameters, and establish a communication connection state according to the connection permission parameters; Based on the communication connection status, data synchronization and configuration data acquisition are performed to obtain shift parameters, product specification parameters and personnel parameters, and data is organized and processed according to the shift parameters, product specification parameters and personnel parameters to obtain a basic parameter data structure; Performing time synchronization management on the basic parameter data structure to obtain current standard time data, and establishing internal clock operation for the current standard time data; The internal clock operation is periodically detected with a period of 1 hour to obtain a clock deviation value, and the clock deviation value is compared with a preset threshold value of 10 minutes to obtain a comparison result; Based on the comparison operation result, the internal clock data is calibrated to obtain a calibrated time data stream, and the calibrated time data stream is encoded according to a time series to obtain a global timestamp sequence.

3. The packaging machine two-dimensional code dynamic tracing method according to claim 2 is characterized in that: The task analysis of the production plan data and the self-check of the status of the code reading device are performed to generate a trigger timing control signal, including: Perform task parsing and deconstruction processing on the production plan data of the plant-level management subsystem through the data interface to obtain the planned task data, and perform field extraction operation on the planned task data to obtain the planned number, product specification code, planned output, team information, planned start time, and planned end time; Performing product specification verification and parameter matching processing based on the product specification code to obtain two-dimensional code rule configuration data, and activating a self-check program of the code reader according to the two-dimensional code rule configuration data to obtain a code reader detection start signal; Based on the code reader detection start signal, a multi-mode detection is performed on the code reader's lens cleanliness, communication link, and trigger signal to obtain device working status data; Performing a code reading success rate test operation on the equipment working status data to obtain status evaluation data, and performing a threshold comparison between the status evaluation data and a preset standard to obtain equipment abnormality level data; Generate operation status feedback data based on the planned task data and the equipment abnormality level data, and upload the operation status feedback data to the plant-level management subsystem for storage; The trigger is parameterized according to the two-dimensional code rule configuration data and the device working status data to obtain a trigger timing control signal.

4. The packaging machine two-dimensional code dynamic tracing method according to claim 3 is characterized in that: The method of collecting the first two-dimensional code image of the inner packaging unit and the second two-dimensional code image of the outer packaging unit and performing decoding operations according to the trigger timing control signal to obtain the first coded data stream and the second coded data stream includes: Based on the trigger timing control signal, a trigger sequence is allocated to obtain an inner layer code reading trigger signal and an outer layer code reading trigger signal, and according to the inner layer code reading trigger signal and the outer layer code reading trigger signal, an image capture control is performed on a high-speed acquisition module to obtain a real-time two-dimensional code image sequence; Performing regional positioning processing on the real-time two-dimensional code image sequence to obtain an inner packaging unit two-dimensional code image region and an outer packaging unit two-dimensional code image region; Input the inner packaging unit two-dimensional code image region and the outer packaging unit two-dimensional code image region into an image enhancement model for grayscale compensation and contrast adjustment to obtain a first two-dimensional code image and a second two-dimensional code image; Generate a binarization threshold parameter according to the first two-dimensional code image and the second two-dimensional code image, and perform image segmentation and binarization processing based on the binarization threshold parameter to obtain a binarized coded image; Performing geometric transformation on the binary coded image to obtain a standardized two-dimensional code matrix, and performing code extraction based on the standardized two-dimensional code matrix to obtain a code extraction result; The two-dimensional code data of the inner packaging unit and the outer packaging unit are classified and sorted according to the code extraction result to obtain initial code data, and the initial code data is reconstructed according to the acquisition sequence to obtain a first code data stream and a second code data stream.

5. The packaging machine two-dimensional code dynamic tracing method according to claim 1 is characterized in that: Based on the graded rejection signal, the first coded data stream and the second coded data stream that have passed the verification are used to generate associated data packets, and the associated data packets are uploaded to the central control system to generate an associated backup table, including: According to the hierarchical elimination signal, abnormal data is eliminated from the first coded data stream and the second coded data stream to obtain a first coded data stream and a second coded data stream that pass the verification, and data aggregation and one-to-many relationship construction are performed on the first coded data stream and the second coded data stream that pass the verification to obtain a coded association pair; Classifying and grouping the coded association pairs according to the production line numbers to obtain a grouped data set, associating and binding the grouped data set with shift information, generating a data packet identifier based on the grouped data set, and organizing the data packet identifier and the coded association pairs into an associated data packet; Input the associated data packets into the message queue service module for cache sorting to obtain a data sequence to be transmitted, perform data integrity check on the data sequence to be transmitted to obtain check result data, and perform network status detection on the check result data; The data sequence to be transmitted is packetized according to the transmission protocol, an associated backup table is generated in the local database, the associated backup table is mapped and bound to the transmission status identifier, and uploaded to the central control system through the data cache channel, and the data that failed to be uploaded is cached in the retransmission queue.

6. The packaging machine two-dimensional code dynamic tracing method according to claim 5 is characterized in that: The step of establishing a multi-level tracing index based on the associated data packet, sorting the multi-level tracing index according to the global timestamp sequence, and generating a chain tracing data structure includes: Parsing the coding matching degree data and the associated data packet to obtain a coding mapping relationship table, and parsing the hierarchical structure of the inner packaging unit and the outer packaging unit based on the coding mapping relationship table to obtain hierarchical relationship data; Performing data hierarchical processing based on the hierarchical relationship data to obtain multi-level index nodes, and generating unique identification codes for the multi-level index nodes; Constructing a parent-child relationship of the multi-level index nodes according to the unique identification code to obtain a tracing index tree, temporally associating the tracing index tree with the global timestamp sequence, traversing the tracing index tree to obtain a node access sequence, and sorting the node access sequence according to the global timestamp sequence to obtain a sorted node access sequence; The sorted node access sequence is converted into a linked list to obtain a bidirectional linked list structure, and the predecessor and successor pointers of adjacent nodes in the bidirectional linked list structure are associated to obtain a chain tracing structure. A node index table is established based on the chain tracing structure, and the node index table is input into a fast retrieval unit for structural optimization to obtain a chain tracing data structure.

7. A packaging machine two-dimensional code dynamic tracing device, characterized in that: For implementing the steps of the method according to any one of claims 1 to 6, the device comprises: A verification module is used to input the registration identification information of the field management unit into the central control system for identity verification and clock synchronization calculation to generate a global timestamp sequence; The parsing module is used to perform task parsing on the production plan data, perform status self-check on the code reading device, and generate a trigger timing control signal; A calculation module, used for collecting the first two-dimensional code image of the inner packaging unit and the second two-dimensional code image of the outer packaging unit according to the trigger timing control signal and performing decoding operations to obtain a first coded data stream and a second coded data stream; A grading module, used for inputting the first coded data stream and the second coded data stream into a real-time verification queue, performing a hierarchical association operation, and generating a grading rejection signal; An uploading module, used for generating a correlation data packet from the first coded data stream and the second coded data stream that have passed the verification based on the graded rejection signal, and uploading the data packet to the central control system to generate a correlation backup table; A generating module is used to establish a multi-level tracing index based on the associated data packet, sort the multi-level tracing index according to the global timestamp sequence, and generate a chain tracing data structure.

8. A computer device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Quality safety tracing method for food processing enterprises

    CN103761546A

  • Two-dimensional code online association management method and packaging machine association system

    CN118691294A