Tank changing batch number retention method and device, electronic equipment and storage medium

Automatically determine the can change batch number in dairy processing plants through image recognition and error correction technology, solving the problems of low efficiency and poor accuracy, and achieving efficient and accurate retention of batch numbers.

CN120561324APending Publication Date: 2025-08-29INNER MONGOLIA MENGNIU DAIRY IND (GROUP) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510583257.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-08-29

AI Technical Summary

Technical Problem

The retention efficiency of replacing the can batch number in dairy processing plants is low and the accuracy is poor, and manual operations can easily lead to repeated collection and batch number missing problems.

Method used

The production batch number image is obtained through image recognition technology, and the production time, tank number and batch number characters are identified. Combined with character error correction and time matching, the batch number of the target tank is automatically determined and stored.

Benefits of technology

It improves the efficiency and accuracy of retention of batch numbers for tank replacement, reduces manual participation, and ensures the complete retention of all tank batch numbers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120561324A_ABST
    Figure CN120561324A_ABST
Patent Text Reader

Abstract

The invention provides a can change batch number retention method and device, electronic equipment and a storage medium, and relates to the technical field of dairy product processing, and the method comprises the steps: obtaining a plurality of production batch number images and image recognition characters of the production batch number images; based on the tank body number identification characters and the number of the batch number images corresponding to the tank body number identification characters, target tank bodies existing in the production line are determined; the production time is determined based on the occurrence frequency of each character position character in the production time identification characters of the production batch number image of the target tank body, and a batch number retention image of the target tank body is determined in the production batch number image of the target tank body based on the matching result of the production time identification characters and the production time; storing the production batch number and the batch number retention image of the target tank body; the production batch number is determined based on the production batch number recognition characters in the batch number retention image. According to the method and the device provided by the invention, the efficiency and the accuracy of tank replacement batch number retention are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of dairy product processing, and in particular to a method, device, electronic equipment and storage medium for retaining canning batch numbers. Background Art

[0002] Retaining batch numbers during tank changes in dairy processing plants is an important step in the dairy production process. The batch numbers on the tanks can be used for quality traceability and quality control of dairy products.

[0003] In the prior art, batch numbers must be manually recorded each time production equipment is started up and tanks are changed. This is done manually using stickers. This manual batch number recording process results in duplicate collection of tanks, low efficiency, and the inability to record batch numbers for all tanks. This can lead to missing batch numbers and poor accuracy.

[0004] Therefore, how to improve the efficiency and accuracy of retaining batch numbers during canning has become a technical problem that needs to be urgently solved in the industry. Summary of the Invention

[0005] The present invention provides a method, device, electronic device and storage medium for retaining batch numbers of can changes, which are used to solve the technical problem of how to improve the efficiency and accuracy of retaining batch numbers of can changes.

[0006] The present invention provides a method for retaining batch numbers when changing cans, comprising: Acquire multiple production batch number images and image recognition characters of the production batch number images; the image recognition characters include production time recognition characters, tank body number recognition characters, and production batch number recognition characters; the production batch number images are obtained by capturing images of the production batch number printing area of ​​each tank body on the production line; Determining target tanks present in the production line based on the tank number identification character and the number of production batch number images corresponding to the tank number identification character; Determining the production time based on the number of occurrences of characters at each character position in the production time recognition character of the production batch number image of the target tank body, and determining the batch number retained image of the target tank body in the production batch number image of the target tank body based on a matching result between the production time recognition character and the production time; The production batch number and the batch number retained image of the target tank are stored; the production batch number is determined based on the production batch number recognition characters in the batch number retained image.

[0007] In some embodiments, before determining the target tanks present in the production line based on the tank number identification characters and the number of production batch images corresponding to the tank number identification characters, the method further includes: Obtaining the creation date of the production batch number image; Determining the production date corresponding to the production batch number image based on the production time recognition character; comparing the production date corresponding to each production batch number image with the creation date, and determining that a recognition error occurs in the production time identification character in any production batch number image if the production date corresponding to any production batch number image is inconsistent with the creation date; Any one of the production lot number images is deleted from the plurality of production lot number images.

[0008] In some embodiments, determining the target tanks present in the production line based on the tank number identification character and the number of production batch number images corresponding to the tank number identification character includes: Using the preset tank body number as the query key character, a fuzzy query is performed on the tank body number identification characters of each production batch number image to determine the target production batch number image that matches the preset tank body number; When the number of the target production batch number images is zero, determining that the target tank body corresponding to the preset tank body number does not exist in the production line; When the number of the target production batch number images is greater than zero and less than a preset number, determining that the target production batch number image is a production batch number image with a tank body number recognition character recognition error, and determining that the target tank body corresponding to the preset tank body number does not exist in the production line; When the number of the target production batch number images is greater than the preset number, it is determined that a target tank body corresponding to the preset tank body number exists in the production line.

[0009] In some embodiments, determining the production time based on the number of occurrences of characters at each character position in the production time recognition character of the production batch number image of the target tank includes: Determine a target character position in the production time identification character; the target character position is the position of a character representing a time unit of hours; Counting the number of occurrences of the target character position of the production time identification character in the production batch number image of the target tank body; Determine the character that appears the most times as the character corresponding to the target character position; The production time is determined based on the character corresponding to the target character position.

[0010] In some embodiments, determining the batch number retained image of the target tank body in the production batch number image of the target tank body based on the matching result between the production time identification character and the production time includes: In the production batch number images of the target tank body, screening the production batch number images whose production time identification characters match the production time; Arrange the filtered production batch number images in ascending order based on the creation time of the production batch number images; The production lot number image arranged at the first position is determined as the lot number retained image.

[0011] In some embodiments, the method further comprises: determining a character recognition accuracy rate based on the number of production batch number images in which image recognition characters have recognition errors and the total number of the plurality of production batch number images; When the character recognition accuracy is less than a preset accuracy threshold, adjusting acquisition parameters of the camera and / or adjusting model parameters of the character recognition model; The camera is used to capture images of the production batch number printing area of ​​each can body on the production line; The character recognition model is used to perform text recognition on the production batch number image captured by the camera, and determine the image recognition characters of the production batch number image.

[0012] In some embodiments, adjusting the model parameters of the character recognition model includes: Determining a misrecognized image and a correction result of a recognized character corresponding to the misrecognized image; the misrecognized image is a production batch number image in which an image recognition character has a recognition error; Using the misrecognized image as a sample and the recognized character correction result as a label, an incremental training sample set is generated; Based on the incremental training sample set, the character recognition model is incrementally trained.

[0013] The present invention provides a can-changing batch number retention device, comprising: An image acquisition module is configured to acquire multiple production batch number images and image recognition characters of the production batch number images; the image recognition characters include a production time recognition character, a tank body number recognition character, and a production batch number recognition character; the production batch number images are obtained by capturing images of the production batch number printing area of ​​each tank body on the production line; a tank number error correction module, configured to determine target tanks present in the production line based on the tank number identification character and the number of production batch number images corresponding to the tank number identification character; a time error correction module, configured to determine the production time based on the number of occurrences of characters at each character position in the production time identification character of the production batch number image of the target tank body, and determine the batch number retained image of the target tank body in the production batch number image of the target tank body based on a matching result between the production time identification character and the production time; The batch number retention module is used to store the production batch number and the batch number retention image of the target tank; the production batch number is determined based on the production batch number recognition characters in the batch number retention image.

[0014] The present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and operable on the processor. When the processor executes the computer program, the method for retaining the batch number of a can change is implemented.

[0015] The present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for retaining the batch number of a can change is implemented.

[0016] The present invention provides a method, device, electronic device and storage medium for retaining batch numbers for can replacement, which obtains multiple production batch number images and image recognition characters of the production batch number images; the image recognition characters include production time recognition characters, tank body number recognition characters and production batch number recognition characters; the production batch number image is obtained by collecting images of the production batch number printing area of ​​each tank body on the production line; based on the tank body number recognition characters and the number of production batch number images corresponding to the tank body number recognition characters, the target tank body present in the production line is determined; the production time is determined based on the number of occurrences of the characters at each character position in the production time recognition characters of the production batch number image of the target tank, and the image recognition characters are used to identify the production batch number of the target tank. Based on the matching result of the production time recognition characters and the production time, the batch number retention image of the target tank body is determined in the production batch number image of the target tank body; the production batch number and the batch number retention image of the target tank body are stored; the production batch number is determined based on the production batch number recognition characters in the batch number retention image; by collecting images of the production batch number printing areas of each tank body on the production line, character recognition is performed on the collected images, and batch numbers are retained according to the recognized characters, no human intervention is required, thereby improving the efficiency of batch number retention for tank changes; by correcting tank number and time errors of the image recognition characters of the production batch number image, the accuracy of batch number retention for tank changes is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1This is one of the flow diagrams of the canning batch number retention method provided by the present invention.

[0020] Figure 2 This is the second flow chart of the method for retaining batch numbers for can replacement provided by the present invention.

[0021] Figure 3 It is a structural schematic diagram of the can-changing batch number retaining device provided by the present invention.

[0022] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0024] It should be noted that the terms "first," "second," and the like in the present invention are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps, units, or modules is not necessarily limited to those steps, units, or modules that are explicitly listed, but may include other steps, units, or modules that are not explicitly listed or that are inherent to these processes, methods, products, or apparatuses.

[0025] During dairy processing, batch numbers must be recorded every time the machine is turned on and each can is changed. The current technology uses manual batch number recording using stickers. This process can lead to problems such as reduced collection rates at earlier stations on the production line, duplicate collection, and disruption to operations at later stations. Furthermore, manual batch number recording does not capture all batch numbers from can changes, leading to missing batch numbers. In short, manual operations are inefficient and inaccurate.

[0026] In order to solve the shortcomings of related technologies, Figure 1 This is one of the flow charts of the method for retaining the batch number of a can change provided by the present invention, such as Figure 1 As shown, the method includes step 110 , step 120 , step 130 and step 140 .

[0027] Step 110: Acquire multiple production batch number images and image recognition characters of the production batch number images; the image recognition characters include production time recognition characters, tank number recognition characters and production batch number recognition characters; the production batch number images are obtained by capturing images of the production batch number printing area of ​​each tank on the production line.

[0028] Specifically, the execution body of the canning batch number retention method provided in the embodiments of the present invention is a canning batch number retention device. The device can be implemented by software, such as a canning batch number retention program running on a computer, or by hardware, such as a computer or server that executes the canning batch number retention method.

[0029] In dairy production lines, dairy products are stored, processed, or temporarily held in tanks. These tanks typically include storage tanks, temporary holding tanks, and processing tanks. At different stages of production or when producing different types of dairy products, different types of tanks are required to meet specific processing or storage requirements. By properly utilizing and replacing these tanks, dairy processing plants can ensure efficient and hygienic production processes and consistent product quality.

[0030] In dairy processing, a batch number, also known as a production lot number, is a unique code or number used to identify and trace a specific batch of products. Typically, a printing area for the batch number is provided on the tank body, using inkjet printing. For example, a flat, clean area on the side of the tank can be used for the printing area.

[0031] A camera may be provided on the production line to capture images of the production batch number printing area of ​​each circulating can body to obtain a production batch number image.

[0032] The captured production batch number image can be recognized to obtain image-recognized characters. The information printed in the production batch number printing area typically includes the production time, tank number, and production batch number. Accordingly, the image-recognized characters include production time recognition characters, tank number recognition characters, and production batch number recognition characters. Recognition technology can utilize optical character recognition (OCR) technology, or a character recognition model constructed using a neural network model to perform character recognition on the production batch number image to obtain image-recognized characters.

[0033] You can store batch number images as image files, set their file names, and generate the creation time of the batch number images. You can also sort batch number images by file name to form a list for easy reading and analysis.

[0034] Step 120 : Determine the target tanks existing in the production line based on the tank number identification characters and the number of production batch images corresponding to the tank number identification characters.

[0035] Specifically, the tank number identification characters represent the tank number identified on the tank. By counting the tank numbers, the target tanks present in the production line can be determined. The target tanks are the tanks used on the production line during the current time period. For example, if the tank number identification characters include "01," "02," and "04," this indicates that the target tanks actually in use on the production line are tanks 01, 02, and 04.

[0036] Considering the complexity of the production line environment, the tank body number recognition characters may be misidentified. Therefore, the number of production batch number images corresponding to each tank body number recognition character can be counted. If the number of production batch number images corresponding to any tank body number recognition character is zero, it means that the tank body corresponding to this tank body number does not exist on the production line. If the number of production batch number images corresponding to any tank body number recognition character is extremely small, it means that the tank body number has been misidentified and the tank body corresponding to this tank body number does not actually exist on the production line.

[0037] Step 130: Determine the production time based on the number of occurrences of characters at each character position in the production time recognition character of the production batch number image of the target tank body, and determine the batch number retention image of the target tank body in the production batch number image of the target tank body based on the matching result between the production time recognition character and the production time.

[0038] Specifically, considering the complexity of the production line environment, the production time recognition characters may be misidentified, such as recognizing the character H as A, or recognizing the letter P as F or R. This will make it impossible to accurately determine the production time based on the characters.

[0039] Therefore, the number of occurrences of the characters at each character position in the production time identification character can be counted, and the character with the largest number of occurrences can be determined as the correct character. The production time can be determined based on the correct character.

[0040] The production time recognition characters of the production batch number image of the target tank are matched with the production time. If they match, it means that the production time recognition characters of the production batch number image are correctly recognized; if they do not match, it means that the production time recognition characters of the production batch number image are incorrectly recognized.

[0041] From the images with the correct production batch number, select a batch number retention image as the target tank. The batch number retention image refers to the production batch number image that needs to be retained.

[0042] Step 140: Store the production batch number and the batch number retained image of the target tank; the production batch number is determined based on the production batch number recognition characters in the batch number retained image.

[0043] Specifically, the production batch number can be determined based on the production batch number identification characters in the batch number retention image, and the production batch number and the batch number retention image are stored, replacing manual batch number retention.

[0044] In order to prevent the operator from accidentally deleting the can change batch number retention program, you can use service management software, such as Non-Sucking Service Manager (NSSM), to register the program as a system service to prevent the operator from accidentally deleting it. At the same time, it can also complete the automatic startup without manual operation.

[0045] The embodiment of the present invention provides a method for retaining batch numbers for can replacement, which obtains multiple production batch number images and image recognition characters of the production batch number images; the image recognition characters include production time recognition characters, tank body number recognition characters and production batch number recognition characters; the production batch number image is obtained by performing image acquisition on the production batch number printing area of ​​each tank body on the production line; based on the tank body number recognition characters and the number of production batch number images corresponding to the tank body number recognition characters, the target tank body existing in the production line is determined; the production time is determined based on the number of occurrences of the characters at each character position in the production time recognition characters of the production batch number image of the target tank, and based on the production time The matching result of the recognition characters and the production time is used to determine the batch number retention image of the target tank in the production batch number image of the target tank; the production batch number and the batch number retention image of the target tank are stored; the production batch number is determined based on the production batch number recognition characters in the batch number retention image; by collecting images of the production batch number printing areas of each tank on the production line, performing character recognition on the collected images, and retaining the batch number based on the recognized characters, no human intervention is required, thereby improving the efficiency of batch number retention for tank changes; by correcting tank number and time errors by correcting image recognition characters of the production batch number image, the accuracy of batch number retention for tank changes is improved.

[0046] It should be noted that each embodiment of the present invention can be freely combined, the order can be changed, or it can be executed separately, and does not need to rely on or depend on a fixed execution order.

[0047] In some embodiments, before determining the target tanks present in the production line based on the tank number identification characters and the number of production batch images corresponding to the tank number identification characters, the method further includes: Get the creation date of the production batch number image; Based on the production time recognition characters, determine the production date corresponding to the production batch number image; Comparing the production date corresponding to each production batch number image with the creation date, and if the production date corresponding to any production batch number image is inconsistent with the creation date, determining that a recognition error occurs in the production time recognition character in any production batch number image; Delete any production batch number image from multiple production batch number images.

[0048] Specifically, the creation date refers to the file creation date of the production batch number image. Using the production date recognition characters in the production batch number image, the production date corresponding to the production batch number image can be determined. Since the production batch number image was collected and created on the same day, the production date and creation date should be consistent.

[0049] Compare the production date corresponding to each batch number image with the creation date. If the production date corresponding to any batch number image is inconsistent with the creation date of the batch number image, it indicates that the production time recognition character in the batch number image has been incorrectly recognized. The batch number image can be deleted from the acquired batch number images.

[0050] The method for retaining batch numbers for can change provided by an embodiment of the present invention compares the production date corresponding to each production batch number image with the creation date, determines and deletes production batch number images with identification errors, and improves the accuracy of retaining batch numbers for can change.

[0051] In some embodiments, determining the target tanks present in the production line based on the tank number identification characters and the number of production batch images corresponding to the tank number identification characters includes: Using the preset tank body number as the query key character, a fuzzy query is performed on the tank body number recognition characters of each production batch number image to determine the target production batch number image that matches the preset tank body number; When the number of the target production batch number images is zero, determining that the target tank body corresponding to the preset tank body number does not exist in the production line; When the number of target production batch number images is greater than zero and less than a preset number, it is determined that the target production batch number image is a production batch number image with a tank body number recognition character recognition error, and it is determined that the target tank body corresponding to the preset tank body number does not exist in the production line; When the number of the target production batch number images is greater than a preset number, it is determined that a target tank body corresponding to the preset tank body number exists in the production line.

[0052] Specifically, one or more preset tank body numbers can be determined. For example, the numbers of the tank bodies actually used on the production line can be determined as the preset tank body numbers. Using the preset tank body numbers as query keywords, a fuzzy query is performed on the tank body number recognition characters of each production batch number image. For example, the fuzzy query can be implemented using a regular expression or a database LIKE operator. If the tank body number recognition characters match the preset tank body numbers, the production batch number image corresponding to the tank body number recognition characters can be determined as the target production batch number image.

[0053] According to the number of target production batch number images, the following judgment is made: If the number of target production batch images is zero, it means that there is no production batch image matching the preset tank number, and it can be considered that there is no target tank corresponding to the preset tank number in the production line; If the number of target production batch number images is greater than zero and less than the preset number, it means that there may be production batch number images that match the preset tank body number, but the number is too small. In this case, it can be considered that these target production batch number images are production batch number images with incorrect tank body number recognition characters, and the target tank body corresponding to the preset tank body number does not actually exist in the production line; If the number of target production batch number images is greater than the preset number, it means that there are a sufficient number of target production batch number images, and it can be considered that the target tank body corresponding to the preset tank body number exists in the production line.

[0054] The preset number can be set as needed, and the embodiment of the present invention does not specifically limit this.

[0055] The method for retaining batch numbers for can replacement provided by an embodiment of the present invention determines the target can bodies actually existing in the production line based on the number of production batch number images corresponding to the tank body number identification characters, thereby realizing tank number error correction and improving the accuracy of retaining batch numbers for can replacement.

[0056] In some embodiments, determining the production time based on the number of occurrences of characters at each character position in the production time recognition character of the production batch number image of the target tank body includes: Determine a target character position in the production time recognition character; the target character position is the position of a character representing a time unit in hours; Counting the number of occurrences of the target character position of the production time recognition character in the production batch number image of the target tank; The character that appears the most times is determined as the character corresponding to the target character position; The production time is determined based on the character corresponding to the target character position.

[0057] Specifically, the production time identification character may include one or more character positions. The characters at each character position represent different time units. Since hours are important for determining the production time, the position of the character representing the time unit of hours may be determined as the target character position.

[0058] In the production time recognition characters of multiple production batch number images corresponding to the target tank body, the number of characters appearing at the target character position is counted, and the character with the most occurrences is determined as the character corresponding to the target character position. The character with the most occurrences has a higher credibility.

[0059] According to the character corresponding to the target character position, the production time can be accurately determined.

[0060] The method for retaining batch numbers for can replacement provided by an embodiment of the present invention determines the production time based on the number of occurrences of characters in each character position in the production time recognition characters of the production batch number image of the target tank body, and then determines the batch number retention image of the target tank body based on the production time, thereby realizing time error correction and improving the accuracy of retaining batch numbers for can replacement.

[0061] In some embodiments, based on the matching result between the production time recognition character and the production time, determining the batch number retained image of the target tank in the production batch number image of the target tank includes: In the production batch number image of the target tank, select the production batch number image whose production time recognition character matches the production time; Arrange the filtered production batch number images in ascending order based on the creation time of the production batch number images; The production lot number image arranged first is determined as the lot number retained image.

[0062] Specifically, in the production batch number image of the target tank, the production time identification character is compared with the production time, and if they are consistent, it is determined that the production time identification character matches the production time. All matching production batch number images are screened out.

[0063] According to the creation time of the filtered production batch number images, these production batch number images are arranged in ascending order, with the images with earlier creation times at the front and the images with later creation times at the back. The production batch number image ranked first is determined as the batch number retained image.

[0064] The method for retaining batch numbers for can changes provided by an embodiment of the present invention determines the batch number retention image of the target can body in the production batch number image of the target can body based on the matching result of the production time recognition character and the production time, thereby improving the accuracy of retaining batch numbers for can changes.

[0065] In some embodiments, the method further comprises: Determining a character recognition accuracy rate based on the number of production batch number images in which image recognition characters have recognition errors and the total number of multiple production batch number images; When the character recognition accuracy is less than a preset accuracy threshold, adjusting acquisition parameters of the camera and / or adjusting model parameters of the character recognition model; The camera is used to capture images of the production batch number printing area of ​​each can on the production line; The character recognition model is used to perform text recognition on the production batch number image captured by the camera and determine the image recognition characters of the production batch number image.

[0066] Specifically, the number of batch number images in which any of the production date, tank number, and batch number characters were incorrectly recognized is counted to determine the number of batch number images in which the image recognition characters were incorrectly recognized. The character recognition accuracy rate can be determined based on the ratio of this number to the total number of batch number images.

[0067] If the character recognition accuracy is lower than the preset accuracy threshold, it indicates that the character recognition accuracy is low and does not meet the batch number retention requirements. You need to adjust the camera acquisition parameters or the character recognition model parameters. The preset accuracy threshold can be set as needed.

[0068] The camera in this example is an image capture device installed on the production line to capture images of the batch number printing area on each can. Capture parameters can include resolution, focal length, and capture angle. By adjusting these parameters, the camera can capture clearer batch number images.

[0069] The character recognition model here is used to perform text recognition on production batch number images captured by a camera and determine the characters in the image. A character recognition model can be constructed using a neural network as the initial model. Examples of neural networks include convolutional neural networks, recurrent neural networks, generative adversarial networks, and attention mechanism networks.

[0070] A large number of images with recognized production batch numbers can be collected as training samples, with the production time, tank number, and production batch number in each production batch number image used as sample labels. This is used to train the initial model, improving its feature learning and character recognition capabilities, ultimately resulting in a character recognition model.

[0071] Model parameters include learning rate, batch size, and optimizer parameters. Tuning methods include grid search, random search, and Bayesian optimization.

[0072] The method for retaining batch numbers for can changes provided in an embodiment of the present invention adjusts the acquisition parameters of the camera or the model parameters of the character recognition model when the character recognition accuracy is low, thereby improving the image acquisition quality and character recognition accuracy of the production batch number image and improving the accuracy of retaining batch numbers for can changes.

[0073] In some embodiments, adjusting the model parameters of the character recognition model includes: Determine the misrecognized image and the correction result of the recognized characters corresponding to the misrecognized image; the misrecognized image is a production batch number image in which the image recognition characters have been misrecognized; Using misidentified images as samples and the corrected results of recognized characters as labels, an incremental training sample set is generated. Based on the incremental training sample set, the character recognition model is incrementally trained.

[0074] Specifically, incremental training refers to continuously adding new training data to the existing training model and updating and optimizing the model, rather than retraining the entire model from scratch.

[0075] A large number of misidentified images can be collected, and the image recognition characters corresponding to the misidentified images can be corrected to obtain the corrected recognition character results. The misidentified images are used as new samples, and the corrected recognition character results are used as the labels corresponding to the new samples to generate incremental training sample sets.

[0076] An automatic update mechanism can be set up to perform incremental training on the character recognition model using an incremental training sample set at a set time or based on specific trigger conditions (for example, the character recognition accuracy is less than a preset accuracy threshold), thereby optimizing and adjusting the parameters of the character recognition model.

[0077] The canning batch number retention method provided in the embodiment of the present invention can perform incremental training on the character recognition model, thereby improving the accuracy and adaptability of the character recognition model, enabling it to better handle new data and environments, while reducing training time and resource consumption.

[0078] Figure 2 This is the second flow chart of the method for retaining the batch number of the can change provided by the present invention, such as Figure 2 As shown, the method can be implemented in Python language, including: Step 210: Acquire the production batch number image captured by the OCR camera.

[0079] Traverse all batch number images captured by the OCR camera and capture the image file name, image creation time, production time, batch number, and can number information obtained after the OCR camera recognizes the batch number image. Sorting by file name creates a file list.

[0080] Step 220: Compare the date in the image creation time with the date in the production time to eliminate abnormal production batch number images.

[0081] Since the OCR camera may make mistakes in recognizing dates, a date comparison is added. If the creation time of the file is inconsistent with the production time recognized by the OCR camera, the image is judged as an abnormal image and removed.

[0082] Step 230: Create a folder with the date as the file name to store the production batch number image.

[0083] Create a folder named after the date in the new list after removing the date, and output the successful creation information to the log file. If the folder already exists, no operation is performed and the information is output to the log.

[0084] Step 240: perform error correction based on the tank number.

[0085] The tank body number is referred to as the tank number. A fuzzy query is used to select images with a specific tank number (tank numbers 01-16) from the file list for matching. If the number of matches is 0, the tank number does not exist and a log is output. If the number of matches is too small, it indicates that the camera has mistakenly identified the tank number as something else. The system will remove the abnormal tank number and output a log.

[0086] Step 250: Correct errors based on production time.

[0087] OCR cameras can easily misrecognize the hour character in the production date, such as misidentifying an H as an A or a P as an F or R. Therefore, we perform a time correction on the new list of can numbers created after the correction. We then take the first few dozen photos in the new list and use the letters with the most hour characters as the source characters (assuming these hour characters correctly represent the can's production date). We then select the first image of the source characters as the can number image, move it, and rename it.

[0088] Step 260: Register system services.

[0089] To prevent operators from accidentally deleting programs, use service management software to register the programs corresponding to the above methods as services in the computer to prevent operators from accidentally deleting them. At the same time, it can also complete automatic startup without manual operation.

[0090] The method for retaining batch numbers for can replacements provided by the embodiment of the present invention can be implemented through a software program, which has functions such as error correction, automatic startup when the industrial computer is turned on, prevention of accidental deletion, and dynamic parameter adjustment. The software program runs in the background throughout the process, has high stability, and requires no human intervention.

[0091] The following describes an apparatus provided by an embodiment of the present invention. The apparatus described below and the method described above can be referenced to each other.

[0092] Figure 3 This is a schematic diagram of the structure of the can change batch number retention device provided by the present invention, such as Figure 3 As shown, the device includes: The image acquisition module 310 is used to acquire multiple production batch number images and image recognition characters of the production batch number images; the image recognition characters include production time recognition characters, tank body number recognition characters, and production batch number recognition characters; the production batch number images are obtained by capturing images of the production batch number printing area of ​​each tank body on the production line; A tank number error correction module 320 is configured to determine the target tanks present in the production line based on the tank number identification characters and the number of production batch number images corresponding to the tank number identification characters; a time error correction module 330 for determining the production time based on the number of occurrences of characters at each character position in the production time recognition character of the production batch number image of the target tank, and determining a retained batch number image of the target tank in the production batch number image of the target tank based on a matching result between the production time recognition character and the production time; The batch number retention module 340 is used to store the production batch number of the target tank and the batch number retention image; the production batch number is determined based on the production batch number recognition characters in the batch number retention image.

[0093] The can replacement batch number retention device provided by the embodiment of the present invention obtains multiple production batch number images and image recognition characters of the production batch number images; the image recognition characters include production time recognition characters, tank body number recognition characters and production batch number recognition characters; the production batch number image is obtained by image acquisition of the production batch number printing area of ​​each tank body on the production line; based on the tank body number recognition characters and the number of production batch number images corresponding to the tank body number recognition characters, the target tank body present in the production line is determined; the production time is determined based on the number of occurrences of the characters in each character position in the production time recognition characters of the production batch number image of the target tank, and based on the production time The matching result of the recognition characters and the production time is used to determine the batch number retention image of the target tank in the production batch number image of the target tank; the production batch number and the batch number retention image of the target tank are stored; the production batch number is determined based on the production batch number recognition characters in the batch number retention image; by collecting images of the production batch number printing areas of each tank on the production line, performing character recognition on the collected images, and retaining the batch number based on the recognized characters, no human intervention is required, thereby improving the efficiency of batch number retention for tank changes; by correcting tank number and time errors by correcting image recognition characters of the production batch number image, the accuracy of batch number retention for tank changes is improved.

[0094] Figure 4Schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4 As shown, the electronic device may include: a processor (Processor) 410, a communication interface (Communications Interface) 420, a memory (Memory) 430 and a communication bus (Communications Bus) 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other via the communication bus 440. The processor 410 may call the logic commands in the memory 430 to execute the method described in the above embodiments, for example: Acquire multiple production batch number images and image recognition characters of the production batch number images; the image recognition characters include production time recognition characters, tank number recognition characters and production batch number recognition characters; the production batch number image is obtained by image acquisition of the production batch number printing area of ​​each tank on the production line; based on the tank number recognition characters and the number of production batch number images corresponding to the tank number recognition characters, determine the target tank existing in the production line; determine the production time based on the number of occurrences of the characters at each character position in the production time recognition characters of the production batch number image of the target tank, and based on the matching result of the production time recognition characters and the production time, determine the batch number retained image of the target tank in the production batch number image of the target tank; store the production batch number and the batch number retained image of the target tank; the production batch number is determined based on the production batch number recognition characters in the batch number retained image.

[0095] Furthermore, the logical commands in the aforementioned memory can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several commands for causing a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical disks.

[0096] The processor in the electronic device provided by the embodiment of the present invention can call the logic instructions in the memory to implement the above method. Its specific implementation method is consistent with the implementation method of the above method and can achieve the same beneficial effects, which will not be repeated here.

[0097] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method provided in the above embodiments is executed.

[0098] Its specific implementation is consistent with the aforementioned method implementation and can achieve the same beneficial effects, so it will not be repeated here.

[0099] An embodiment of the present invention provides a computer program product, including a computer program. When the computer program is executed by a processor, the method described above is implemented.

[0100] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.

[0101] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.

[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A method for retaining batch numbers when changing cans, characterized in that: include: Acquire multiple production batch number images and image recognition characters of the production batch number images; the image recognition characters include production time recognition characters, tank body number recognition characters, and production batch number recognition characters; the production batch number images are obtained by capturing images of the production batch number printing area of ​​each tank body on the production line; Determining target tanks present in the production line based on the tank number identification character and the number of production batch number images corresponding to the tank number identification character; Determining the production time based on the number of occurrences of characters at each character position in the production time recognition character of the production batch number image of the target tank body, and determining the batch number retained image of the target tank body in the production batch number image of the target tank body based on a matching result between the production time recognition character and the production time; The production batch number and the batch number retained image of the target tank are stored; the production batch number is determined based on the production batch number recognition characters in the batch number retained image.

2. The method for retaining the batch number of a tank change according to claim 1, wherein: Before determining the target tank bodies present in the production line based on the tank body number identification characters and the number of production batch number images corresponding to the tank body number identification characters, the method further includes: Obtaining the creation date of the production batch number image; Determining the production date corresponding to the production batch number image based on the production time recognition character; comparing the production date corresponding to each production batch number image with the creation date, and determining that a recognition error occurs in the production time identification character in any production batch number image if the production date corresponding to any production batch number image is inconsistent with the creation date; Any one of the production lot number images is deleted from the plurality of production lot number images.

3. The method for retaining the batch number of a tank change according to claim 1, wherein: The determining of the target tank bodies present in the production line based on the tank body number identification character and the number of production batch number images corresponding to the tank body number identification character includes: Using the preset tank body number as the query key character, a fuzzy query is performed on the tank body number identification characters of each production batch number image to determine the target production batch number image that matches the preset tank body number; When the number of the target production batch number images is zero, determining that the target tank body corresponding to the preset tank body number does not exist in the production line; When the number of the target production batch number images is greater than zero and less than a preset number, determining that the target production batch number image is a production batch number image with a tank body number recognition character recognition error, and determining that the target tank body corresponding to the preset tank body number does not exist in the production line; When the number of the target production batch number images is greater than the preset number, it is determined that a target tank body corresponding to the preset tank body number exists in the production line.

4. The method for retaining the batch number of a tank change according to claim 1, wherein: The determining of the production time based on the number of occurrences of characters at each character position in the production time recognition character of the production batch number image of the target tank body comprises: Determine a target character position in the production time identification character; the target character position is the position of a character representing a time unit of hours; Counting the number of occurrences of the target character position of the production time identification character in the production batch number image of the target tank body; Determine the character that appears the most times as the character corresponding to the target character position; The production time is determined based on the character corresponding to the target character position.

5. The method for retaining the batch number of a tank change according to claim 1, wherein: The determining, based on the matching result between the production time identification character and the production time, the batch number retained image of the target tank body in the production batch number image of the target tank body comprises: In the production batch number images of the target tank body, screening the production batch number images whose production time identification characters match the production time; Arrange the filtered production batch number images in ascending order based on the creation time of the production batch number images; The production lot number image arranged at the first position is determined as the lot number retained image.

6. The method for retaining the batch number of a tank change according to claim 1, characterized in that: The method further comprises: determining a character recognition accuracy rate based on the number of production batch number images in which image recognition characters have recognition errors and the total number of the plurality of production batch number images; When the character recognition accuracy is less than a preset accuracy threshold, adjusting acquisition parameters of the camera and / or adjusting model parameters of the character recognition model; The camera is used to capture images of the production batch number printing area of ​​each can body on the production line; The character recognition model is used to perform text recognition on the production batch number image captured by the camera, and determine the image recognition characters of the production batch number image.

7. The method for retaining the batch number of a tank change according to claim 6, characterized in that: The adjusting of the model parameters of the character recognition model includes: Determining a misrecognized image and a correction result of a recognized character corresponding to the misrecognized image; the misrecognized image is a production batch number image in which an image recognition character has a recognition error; Using the misrecognized image as a sample and the recognized character correction result as a label, an incremental training sample set is generated; Based on the incremental training sample set, the character recognition model is incrementally trained.

8. A device for retaining batch numbers for changing cans, characterized in that: include: An image acquisition module is configured to acquire multiple production batch number images and image recognition characters of the production batch number images; the image recognition characters include a production time recognition character, a tank body number recognition character, and a production batch number recognition character; the production batch number images are obtained by capturing images of the production batch number printing area of ​​each tank body on the production line; a tank number error correction module, configured to determine target tanks present in the production line based on the tank number identification character and the number of production batch number images corresponding to the tank number identification character; a time error correction module, configured to determine the production time based on the number of occurrences of characters at each character position in the production time identification character of the production batch number image of the target tank body, and determine the batch number retained image of the target tank body in the production batch number image of the target tank body based on a matching result between the production time identification character and the production time; The batch number retention module is used to store the production batch number and the batch number retention image of the target tank; the production batch number is determined based on the production batch number recognition characters in the batch number retention image.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for retaining the canning batch number according to any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for retaining the canning batch number according to any one of claims 1 to 7 is implemented.