A two-dimensional code recognition method and device, electronic equipment and storage medium

By employing a two-stage detection model and deep learning network training pruning techniques, the QR codes on multiple chips on a memory module can be quickly and accurately identified, solving the problems of slow recognition speed and high cost in existing technologies and improving recognition efficiency and accuracy.

CN115510888BActive Publication Date: 2026-05-12CHANGXIN MEMORY TECH INC
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHANGXIN MEMORY TECH INC
Filing Date
2022-09-23
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

In existing technologies, the process of recognizing QR codes on multiple chips on a memory module is slow and labor-intensive, making it difficult to complete QR code recognition quickly and accurately.

Method used

A two-stage detection model is adopted. First, the first detection model is used to locate the chip area in the memory bar image. When the recognition fails, the second detection model is used to further locate the QR code area. Combined with the training and pruning techniques of the deep learning network model, the model performance is optimized to adapt to the image recognition needs of different lighting, angles and backgrounds.

Benefits of technology

It achieves fast and accurate recognition of QR codes on multiple chips on a memory module, balancing recognition speed and accuracy while reducing labor costs and time consumption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510888B_ABST
    Figure CN115510888B_ABST
Patent Text Reader

Abstract

The application discloses a two-dimensional code recognition method and device, electronic equipment and storage medium, and belongs to the technical field of image processing. The method comprises the following steps: acquiring a memory bank image, inputting the memory bank image into a first detection model pre-trained, obtaining at least one chip region in the memory bank image, performing two-dimensional code recognition on a chip image corresponding to each chip region, if the recognition fails, inputting the chip image into a second detection model pre-trained, obtaining a two-dimensional code region in the chip image, and performing two-dimensional code recognition on a two-dimensional code image corresponding to the two-dimensional code region. In this way, the two-dimensional codes of multiple chips on the memory bank can be recognized with the aid of the memory bank image, the recognition speed is relatively fast, in addition, the two-dimensional code recognition is performed in the order from the chip image to the two-dimensional code image, the speed and accuracy of the two-dimensional code recognition can also be considered, and the recognition mode is also relatively reasonable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a QR code recognition method, apparatus, electronic device and storage medium. Background Technology

[0002] With the development of society, QR codes have been widely used in various fields such as e-commerce and product traceability due to their advantages such as large information capacity, strong fault tolerance and low cost.

[0003] Currently, when recognizing QR codes on multiple chips on a memory module, users typically need to hold a barcode scanner and point it at each QR code area on the memory module one by one for recognition. The recognition process is relatively slow and labor costs are also relatively high.

[0004] Therefore, how to quickly identify the QR codes of multiple chips on a memory module is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] This application provides a QR code recognition method, device, electronic device, and storage medium for quickly recognizing QR codes on multiple chips on a memory module.

[0006] In a first aspect, embodiments of this application provide a QR code recognition method, including:

[0007] Get the image of the memory module;

[0008] The memory bar image is input into a pre-trained first detection model to obtain at least one chip region in the memory bar image;

[0009] Perform QR code recognition on the chip image corresponding to each chip area;

[0010] When recognition fails, the chip image is input into a pre-trained second detection model to obtain the QR code region in the chip image;

[0011] Perform QR code recognition on the QR code image corresponding to the QR code area.

[0012] In some embodiments, the first detection model and the second detection model are the same detection model, or the first detection model and the second detection model are different detection models.

[0013] In some embodiments, when the first detection model and the second detection model are the same detection model, the detection model is trained according to the following steps:

[0014] Acquire multiple first image samples, including memory bar image samples and chip image samples;

[0015] The constructed deep learning network model is trained using the multiple first image samples;

[0016] When the training level reaches a preset level, the current deep learning network model is pruned.

[0017] The pruned deep learning network model is then trained using the multiple first image samples.

[0018] Whenever the pruning conditions are met, the current deep learning network model is pruned, and the pruned deep learning network model is trained again using the multiple first image samples.

[0019] The current deep learning network model is determined as the detection model when it is determined that the current deep learning network model meets the training stopping condition.

[0020] In some embodiments, when the first detection model and the second detection model are different detection models, the first detection model is trained according to the following steps:

[0021] Acquire multiple second image samples, including memory bar image samples and chip image samples;

[0022] The constructed deep learning network model is trained using the multiple second image samples;

[0023] The current deep learning network model is determined as the first detection model when it is determined that the current deep learning network model meets the training stopping condition.

[0024] In some embodiments, the second detection model is trained according to the following steps:

[0025] Acquire multiple third image samples, including chip image samples and QR code image samples;

[0026] The constructed deep learning network model is trained using the multiple third image samples;

[0027] The current deep learning network model is designated as the second detection model when it is determined that the current deep learning network model meets the training stopping condition.

[0028] In some embodiments, it also includes:

[0029] Determine the number of chips detected from the memory module image and the number of QR codes successfully recognized;

[0030] Based on whether the number of chips and the number of QR codes match, it is determined whether there is an anomaly in the QR code recognition of the memory stick image.

[0031] In some embodiments, it also includes:

[0032] Before performing QR code recognition on either the chip image or the QR code image, the target image is corrected.

[0033] In some embodiments, after inputting the memory bar image into a pre-trained first detection model to obtain at least one chip region in the memory bar image, the method further includes:

[0034] Determine the region size of the at least one chip region;

[0035] The chip image corresponding to a chip region whose size is smaller than a preset size is input into a pre-trained second detection model to obtain the QR code region in the chip image.

[0036] Perform QR code recognition on the QR code image corresponding to the QR code area.

[0037] Secondly, embodiments of this application provide a QR code recognition device, including:

[0038] The acquisition module is used to acquire images of memory modules.

[0039] The first detection module is used to input the memory bar image into a pre-trained first detection model to obtain at least one chip region in the memory bar image;

[0040] The first recognition module is used to perform QR code recognition on the chip image corresponding to each chip area;

[0041] The second detection module is used to input the chip image into a pre-trained second detection model when recognition fails, so as to obtain the QR code area in the chip image.

[0042] The second recognition module is used to perform QR code recognition on the QR code image corresponding to the QR code area.

[0043] In some embodiments, the first detection model and the second detection model are the same detection model, or the first detection model and the second detection model are different detection models.

[0044] In some embodiments, when the first detection model and the second detection model are the same detection model, the detection model is trained according to the following steps:

[0045] Acquire multiple first image samples, including memory bar image samples and chip image samples;

[0046] The constructed deep learning network model is trained using the multiple first image samples;

[0047] When the training level reaches a preset level, the current deep learning network model is pruned.

[0048] The pruned deep learning network model is then trained using the multiple first image samples.

[0049] Whenever the pruning conditions are met, the current deep learning network model is pruned, and the pruned deep learning network model is trained again using the multiple first image samples.

[0050] The current deep learning network model is determined as the detection model when it is determined that the current deep learning network model meets the training stopping condition.

[0051] In some embodiments, when the first detection model and the second detection model are different detection models, the first detection model is trained according to the following steps:

[0052] Acquire multiple second image samples, including memory bar image samples and chip image samples;

[0053] The constructed deep learning network model is trained using the multiple second image samples;

[0054] The current deep learning network model is determined as the first detection model when it is determined that the current deep learning network model meets the training stopping condition.

[0055] In some embodiments, the second detection model is trained according to the following steps:

[0056] Acquire multiple third image samples, including chip image samples and QR code image samples;

[0057] The constructed deep learning network model is trained using the multiple third image samples;

[0058] The current deep learning network model is designated as the second detection model when it is determined that the current deep learning network model meets the training stopping condition.

[0059] In some embodiments, an exception handling module is further included, for:

[0060] Determine the number of chips detected from the memory module image and the number of QR codes successfully recognized;

[0061] Based on whether the number of chips and the number of QR codes match, it is determined whether there is an anomaly in the QR code recognition of the memory stick image.

[0062] In some embodiments, it also includes:

[0063] The correction module is used to correct the target image before performing QR code recognition on either the chip image or the QR code image.

[0064] In some embodiments, a determining module is further included, configured to:

[0065] After the first detection module inputs the memory bar image into the pre-trained first detection model to obtain at least one chip region in the memory bar image, the region size of the at least one chip region is determined.

[0066] The chip image corresponding to a chip region whose size is smaller than a preset size is input into a pre-trained second detection model to obtain the QR code region in the chip image.

[0067] Perform QR code recognition on the QR code image corresponding to the QR code area.

[0068] Thirdly, embodiments of this application provide an electronic device, including: at least one processor, and a memory communicatively connected to the at least one processor, wherein:

[0069] The memory stores a computer program that can be executed by at least one processor, which enables the at least one processor to perform the QR code recognition method described above.

[0070] Fourthly, embodiments of this application provide a storage medium in which the electronic device can execute the above-described QR code recognition method when the computer program in the storage medium is executed by the processor of the electronic device.

[0071] In this embodiment, a first detection model is first used to determine the chip region in the acquired memory module image. QR code recognition is then performed on the chip image corresponding to the chip region. If recognition fails, a second detection model is used to determine the QR code region in the chip image, and QR code recognition is performed on the QR code image corresponding to the QR code region. In this way, QR codes for multiple chips on the memory module can be identified using the memory module image, resulting in a relatively fast recognition speed. Furthermore, performing QR code recognition in the order from chip image to QR code image balances speed and accuracy, making the recognition method quite reasonable. Attached Figure Description

[0072] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0073] Figure 1 A flowchart illustrating the training process of a detection model provided in this application embodiment;

[0074] Figure 2 A schematic diagram illustrating the collection of images provided in an embodiment of this application;

[0075] Figure 3 A schematic diagram of image annotation provided for an embodiment of this application;

[0076] Figure 4 A flowchart illustrating a QR code recognition method provided in this application embodiment;

[0077] Figure 5 A flowchart illustrating another QR code recognition method provided in this application embodiment;

[0078] Figure 6 This is a schematic diagram of the structure of a QR code recognition device provided in an embodiment of this application;

[0079] Figure 7 This is a schematic diagram of the hardware structure of an electronic device for implementing a QR code recognition method, provided as an embodiment of this application. Detailed Implementation

[0080] To quickly identify the QR codes on multiple chips on a memory module, embodiments of this application provide a QR code recognition method, device, electronic device, and storage medium.

[0081] The preferred embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit this application. Furthermore, the embodiments and features in the embodiments of this application can be combined with each other without conflict.

[0082] For ease of understanding, the technical terms used in this application are as follows:

[0083] A QR code is a graphic that uses specific geometric shapes arranged in a certain pattern on a plane to form a black and white pattern to record data symbols. Common QR codes, such as QR (Quick Response) codes, overcome the capacity limitations of traditional barcodes and expand their form and content to create two-dimensional barcodes. They contain information both vertically and horizontally, and can store text data in addition to numbers. They are effectively utilized by digital cameras and / or dedicated scanners. Especially in industrial production, QR codes are often used to store information such as the manufacturer, production date, and production batch of a product. In the embodiments of this application, the QR code can also be a QR code, used to store information such as the manufacturer, production date, and production batch of a chip.

[0084] A memory module is a computer component that the central processing unit (CPU) can address and perform read and write operations on via a bus. A memory module typically has multiple chips, and each chip corresponds to at least one QR code.

[0085] To batch identify QR codes on multiple chips from a memory module image, this embodiment first uses a first detection model to determine the chip region in the memory module image, and then performs QR code recognition on the corresponding chip image. If recognition fails, a second detection model is used to determine the QR code region in the chip image, and QR code recognition is performed again on the corresponding QR code image. This two-step QR code recognition approach balances recognition speed and accuracy, making it a more reasonable method.

[0086] The first detection model and the second detection model can be the same detection model or different detection models. The following description uses the example of the first detection model and the second detection model being the same detection model to illustrate the solution of this application.

[0087] The solution of this application mainly includes two processes: model training and model use. The two processes are described below.

[0088] I. Model training process.

[0089] Figure 1 A training flowchart for a detection model provided in this application includes the following steps:

[0090] In step 101, multiple first images are collected.

[0091] In practice, factors such as lighting, shooting angle, shooting distance, QR code size, and shooting background all affect the final imaging effect of the QR code area, thus affecting the QR code recognition result. Therefore, to ensure the diversity and comprehensiveness of the dataset, when collecting images, memory stick images and chip images under different lighting conditions, shooting angles, shooting distances, different chips, and different shooting backgrounds can be collected through methods such as taking photos or capturing video clips. Figure 2 As shown, Figure 2 This is a schematic diagram of image collection provided in an embodiment of this application, with the top image being a memory module image and the bottom image being a chip image.

[0092] In step 102, multiple first images are labeled to obtain multiple first image samples.

[0093] In practice, after collecting multiple initial images, annotation tools can be used to label the collected images. For example, edge detection algorithms, image segmentation algorithms, and object classification algorithms can be used to label the chip region and the chip's QR code region in each image, and then distinguish them with labels. For instance, the label "twocode" represents the chip, and the label "qr" represents the QR code. Figure 3 As shown, Figure 3 This is a schematic diagram of image annotation provided in an embodiment of this application, wherein each chip has four vertices and each chip has four vertices of a QR code with annotation points, and the annotated image is determined as the first image sample.

[0094] In step 103, the constructed deep learning network model is trained using multiple first image samples.

[0095] In practice, multiple memory stick image samples and multiple chip image samples can be used to optimize and train the deep learning network model based on pre-set parameters, continuously updating the original model parameters of the deep learning network model so that the trained model can detect both the chip area and the QR code area on the chip.

[0096] In step 104, when the training level reaches a preset level, the deep learning network model is pruned.

[0097] In practice, when the training level reaches a preset level, such as the training time reaching a preset duration or the number of iterations reaching a preset number, the deep learning network model can be pruned. For example, for each layer of the deep learning network model's convolutional filters, the relative importance of the corresponding convolutional kernels can be measured using the L2 paradigm, and a pruning rate can be set for each layer's filters. Then, the optimal pruning rate for each layer can be found through layer-by-layer training and tuning, and the model can be pruned according to the optimal pruning rate of each layer to make the model lightweight.

[0098] In step 105, the pruned deep learning network model is trained again using multiple first image samples.

[0099] In step 106, after the accuracy of the deep learning network model meets the requirements, the model performance is tested to obtain the performance test results.

[0100] Among them, model performance testing includes testing the computational load of the model and the hardware resources required to run the model.

[0101] In step 107, based on the performance test results, it is determined whether the pruning conditions are met. If yes, proceed to step 108; otherwise, proceed to step 109.

[0102] In practice, pruning conditions will be imposed if any performance metric fails to meet the preset threshold in the performance test results.

[0103] In step 108, the deep learning network model is pruned, and the process returns to step 105.

[0104] In practice, when the deep learning network model meets the pruning conditions, the steps of pruning, post-pruning training, and model testing are repeated until all performance parameters in the performance test results reach the preset thresholds, at which point the loop stops.

[0105] In step 109, the current deep learning network model is determined as the detection model.

[0106] After introducing the model training process, the following section will introduce the model usage process.

[0107] II. Model Usage Process.

[0108] Figure 4 The flowchart illustrates a QR code recognition method provided in this application embodiment, which includes the following steps.

[0109] In step 401, the memory stick image is obtained.

[0110] A memory module typically contains multiple chips, such as 4, 8, or 16. These chips are arranged in a specific order on the memory module, and each chip can have a QR code.

[0111] In step 402, the memory module image is input into the detection model to obtain the chip regions in the memory module image.

[0112] In practice, the detection model can not only locate the chip regions in the memory module image to obtain each chip region in the memory module image, but also locate the two-dimensional regions in the memory module image to obtain each two-dimensional region in the memory module image.

[0113] In step 403, each chip region is cropped to obtain the corresponding chip image, and the chip image is then corrected.

[0114] For example, the chip regions on the memory module image can be cropped from top to bottom and left to right to obtain chip images corresponding to each chip region. This cropping of chip images based on each chip region, rather than directly recognizing the QR codes on each chip from the memory module image, avoids the problem of the user-provided memory module image being too small, resulting in relatively small chips and consequently smaller QR codes, which could affect recognition accuracy and speed. Furthermore, cropping the chip regions also removes the background areas outside the chip areas, further improving the speed and accuracy of QR code recognition.

[0115] Next, each chip image is corrected. For example, the chip image is first converted to grayscale, then the grayscale image is binarized, then the perspective transformation algorithm is used to correct the position of the binarized chip image, and finally the corrected chip image is denoised to obtain the corrected chip image.

[0116] In this way, the image after correction can make the chip image clearer, which helps to improve the recognition accuracy of QR codes.

[0117] In addition, the cut-out chip images can be numbered according to the arrangement order on the memory stick images. For example, the chip image in the first position is numbered 1, the chip image in the second position is numbered 2, and so on.

[0118] In step 404, the corrected chip image is subjected to QR code recognition.

[0119] This involves using a decoder algorithm to recognize the QR code on the corrected chip image. Generally, a QR code on a chip can represent information such as the chip manufacturer's number, the chip's serial number, the year of manufacture, and the batch number. Furthermore, QR code recognition typically uses characters.

[0120] In step 405, when recognition fails, the chip image is input into the detection model to obtain the QR code area in the chip image.

[0121] Due to factors such as shooting angle, scratches, or others, the chip image may be unclear, which may lead to the failure of QR code recognition on the chip image. In order to improve the QR code recognition rate, the chip image that failed to be recognized can be re-input into the detection model to relocate the QR code.

[0122] The detection model can not only locate the QR code in the chip image to obtain the QR code area, but also locate the chip in the chip image to obtain the chip area.

[0123] In step 406, the QR code area is cropped to obtain a QR code image, and the QR code image is then corrected.

[0124] In practice, the correction process for the QR code image can be found in step 403, and will not be repeated here.

[0125] In step 407, the corrected QR code image is subjected to QR code recognition.

[0126] For example, a decoder algorithm can be used to recognize the processed QR code image.

[0127] In step 408, when recognition is successful, the memory bar image, chip image, and QR code recognition result are associated and stored.

[0128] For example, the corresponding QR code recognition result can be labeled in a two-dimensional area of ​​each chip region on the memory module image. Alternatively, the QR code recognition result can be stored in the format of memory module image identifier – chip image number – QR code recognition result. This way, while effectively recognizing QR codes, the recording and statistical work of QR codes across multiple chips on the memory module can be improved, saving labor and time costs.

[0129] Assuming the above memory stick image is from a user and it shows a faulty memory stick, after identifying the QR codes on each chip on the memory stick, the QR code identification results can indicate which batches of chips are faulty, allowing for targeted spot checks and problem analysis of the corresponding batches of chips.

[0130] In some embodiments, the number of chips detected in the memory module image can be compared with the number of QR codes successfully recognized. If the number of chips and the number of QR codes do not match, it can be determined that there is an anomaly in the QR code recognition of the memory module image, such as incomplete or damaged QR codes. Then, the abnormal chips are manually processed to avoid missed or false detections, which helps to improve the recognition accuracy.

[0131] In addition, considering that memory module images are usually provided by users, the size of the memory module image cannot be controlled. When the size of the memory module image provided by the user is small, the chip area in the memory module image will be smaller. In this case, even if QR code recognition is performed on the chip image corresponding to the chip area, the probability of successful recognition is relatively low. It is still necessary to locate the QR code area in the chip image and further recognize the QR code image in the QR code area.

[0132] Therefore, in some embodiments, after inputting the memory module image into the detection model to obtain the chip regions in the memory module image, the size of each chip region can be determined, and chip regions with sizes smaller than a preset size can be filtered out. The detection model is then used to locate the QR code regions in the chip images corresponding to these chip regions, and QR code recognition is performed on the QR code images corresponding to the QR code regions. In this way, for memory module images with smaller sizes, it is not necessary to perform QR code recognition on the chip images corresponding to the chip regions; QR code recognition can be performed directly on the QR code images corresponding to the QR code regions, which helps to further improve the recognition speed.

[0133] In this embodiment, when the image quality of the memory module image is high (e.g., clear and undistorted), QR code recognition from the chip image is generally successful. However, when the image quality of the memory module image is low (e.g., blurry or distorted), QR code recognition may fail. In such cases, a detection model can be used again to locate the QR code region in the chip image, and QR code recognition can be performed on the corresponding QR code image. Thus, performing QR code recognition in the order from chip image to QR code image balances speed and accuracy, resulting in a more reasonable recognition method.

[0134] Figure 5 A flowchart of another QR code recognition method provided in this application embodiment, the method including the following steps.

[0135] In step 501, the memory stick image is obtained.

[0136] In step 502, the memory bar image is input into the pre-trained first detection model to obtain each chip region in the memory bar image.

[0137] The first detection model can be used to locate the chip region in the memory bar image alone, or it can be used to locate both the chip region and the QR code region in the memory bar image at the same time.

[0138] In step 503, each chip region is cropped to obtain the corresponding chip image, and the chip image is then corrected.

[0139] The correction process involves first converting the chip image to grayscale, then binarizing the grayscale image, then using a perspective transformation algorithm to correct the position of the binarized chip image, and finally denoising the corrected chip image.

[0140] In this way, the image after correction can make the cropped image clearer, which helps to improve recognition accuracy and speed.

[0141] In step 504, the corrected chip image is subjected to QR code recognition.

[0142] In step 505, when recognition fails, the chip image is input into a pre-trained second detection model to obtain the QR code region in the chip image.

[0143] The second detection model can be used to locate the QR code region in the chip image alone, or it can be used to locate both the chip region and the QR code region in the chip image simultaneously.

[0144] In step 506, the QR code area is cropped to obtain a QR code image, and the QR code image is then corrected.

[0145] The correction process for the QR code image can be found in step 503, and will not be repeated here.

[0146] In step 507, the corrected QR code image is subjected to QR code recognition.

[0147] In step 508, when recognition is successful, the memory bar image, chip image, and QR code recognition result are associated and stored.

[0148] In some embodiments, the number of chips detected from the memory module image and the number of QR codes successfully recognized can also be determined. Based on whether the number of chips and the number of QR codes match, it can be determined whether there is an anomaly in the QR code recognition of the memory module image. For example, if the number of chips and the number of QR codes do not match, it can be determined that there is an anomaly in the QR code recognition of the memory module image. Then, the chips with anomalies are manually processed to avoid missed detections or false detections, which helps to improve the recognition accuracy.

[0149] Since memory module images are usually provided by users, the image size of the memory module cannot be controlled. When the memory module image size provided by the user is small, the chip area in the memory module image will be smaller. In this case, even if QR code recognition is performed on the chip image corresponding to the chip area, the probability of successful recognition is relatively low. It is still necessary to use the second detection model to locate the QR code area in the chip image and further recognize the QR code image in the QR code area.

[0150] Therefore, in some embodiments, after inputting the memory bar image into a pre-trained first detection model to obtain each chip region in the memory bar image, the size of each chip region can be determined. The chip image corresponding to the chip region whose region size is smaller than the preset size is input into a pre-trained second detection model to obtain the QR code region in the chip image, and QR code recognition is performed on the QR code image corresponding to the QR code region.

[0151] In this way, for smaller chip images, there is no need to perform QR code recognition on the chip image corresponding to the chip area. Instead, the QR code area in the chip image can be located directly in the second detection model, and QR code recognition can be performed on the QR code image corresponding to the QR code area, which helps to further improve the recognition speed.

[0152] In practical implementation, when both the first detection model and the second detection model are used to locate the chip area and the QR code area, the first detection model and the second detection model can be the same. In this case, the detection model is actually a binary classification detection model. To make this binary classification detection model easy to deploy on the terminal, the detection model can be lightweighted during the training process.

[0153] For example, the detection model can be trained according to the following steps:

[0154] Step 1: Obtain multiple first image samples, including memory module image samples and chip image samples.

[0155] The annotation information for each image sample includes a chip annotation area and a QR code annotation area.

[0156] Step 2: Train the constructed deep learning network model using multiple first image samples.

[0157] Step 3: When the training level reaches the preset level, prune the current deep learning network model.

[0158] Step 4: Use multiple first image samples to continue training the pruned deep learning network model.

[0159] Step 5: Whenever the pruning condition is met, prune the current deep learning network model and continue training the pruned deep learning network model using multiple image samples until the current deep learning network model meets the training stopping condition. At this point, the current deep learning network model is determined as the detection model.

[0160] In this way, the size and computational cost of the detection model are reduced through the training process, making it easier to deploy on the terminal and thus achieving the goal of lightweight deployment.

[0161] When the first detection model is used only to locate the chip area and the second detection model is used only to locate the QR code area, the first and second detection models are different detection models. In this case, both detection models are relatively simple, have low hardware performance requirements, and are easy to deploy on the terminal.

[0162] For example, the first detection model can be trained according to the following steps:

[0163] Step 1: Obtain multiple second image samples, including memory module image samples and chip image samples.

[0164] The annotation information for each image sample is the chip annotation area.

[0165] Step 2: Train the constructed deep learning network model using multiple second image samples.

[0166] Step 3: Once the current deep learning network model is determined to meet the training stopping condition, the current deep learning network model is designated as the first detection model.

[0167] For example, the second detection model can be trained according to the following steps:

[0168] Step 1: Obtain multiple third-party image samples, including chip image samples and QR code image samples.

[0169] The annotation information for each image sample is the QR code annotation area.

[0170] Step 2: Train the constructed deep learning network model using multiple third-party image samples;

[0171] Step 3: When it is determined that the current deep learning network model meets the training stopping condition, the current deep learning network model is determined as the second detection model.

[0172] In this way, when recognizing different image samples, the corresponding detection model can be selected more specifically, which helps to improve the speed of QR code recognition.

[0173] Based on the same technical concept, this application also provides a QR code recognition device. The principle of the QR code recognition device in solving the problem is similar to that of the QR code recognition method described above. Therefore, the implementation of the QR code recognition device can refer to the implementation of the QR code recognition method, and the repeated parts will not be described again.

[0174] Figure 6 The present application provides a schematic diagram of the structure of a QR code recognition device, which includes an acquisition module 601, a first detection module 602, a first recognition module 603, a second detection module 604, and a second recognition module 605.

[0175] Module 601 is used to acquire images of memory modules;

[0176] The first detection module 602 is used to input the memory bar image into a pre-trained first detection model to obtain at least one chip region in the memory bar image;

[0177] The first identification module 603 is used to perform QR code recognition on the chip image corresponding to each chip area;

[0178] The second detection module 604 is used to input the chip image into a pre-trained second detection model when recognition fails, so as to obtain the QR code area in the chip image.

[0179] The second recognition module 605 is used to perform QR code recognition on the QR code image corresponding to the QR code area.

[0180] In some embodiments, the first detection model and the second detection model are the same detection model, or the first detection model and the second detection model are different detection models.

[0181] In some embodiments, when the first detection model and the second detection model are the same detection model, the detection model is trained according to the following steps:

[0182] Acquire multiple first image samples, including memory bar image samples and chip image samples;

[0183] The constructed deep learning network model is trained using the multiple first image samples;

[0184] When the training level reaches a preset level, the current deep learning network model is pruned.

[0185] The pruned deep learning network model is then trained using the aforementioned multiple image samples.

[0186] Whenever the pruning conditions are met, the current deep learning network model is pruned, and the pruned deep learning network model is trained again using the multiple first image samples.

[0187] The current deep learning network model is determined as the detection model when it is determined that the current deep learning network model meets the training stopping condition.

[0188] In some embodiments, when the first detection model and the second detection model are different detection models, the first detection model is trained according to the following steps:

[0189] Acquire multiple second image samples, including memory bar image samples and chip image samples;

[0190] The constructed deep learning network model is trained using the multiple second image samples;

[0191] The current deep learning network model is determined as the first detection model when it is determined that the current deep learning network model meets the training stopping condition.

[0192] In some embodiments, the second detection model is trained according to the following steps:

[0193] Acquire multiple third image samples, including chip image samples and QR code image samples;

[0194] The constructed deep learning network model is trained using the multiple third image samples;

[0195] The current deep learning network model is designated as the second detection model when it is determined that the current deep learning network model meets the training stopping condition.

[0196] In some embodiments, an exception handling module 606 is further included, for:

[0197] Determine the number of chips detected from the memory module image and the number of QR codes successfully recognized;

[0198] Based on whether the number of chips and the number of QR codes match, it is determined whether there is an anomaly in the QR code recognition of the memory stick image.

[0199] In some embodiments, it also includes:

[0200] The correction module 607 is used to perform correction processing on the target image before performing QR code recognition on either the chip image or the QR code image.

[0201] In some embodiments, a determining module 608 is further included, configured to:

[0202] After the first detection module 602 inputs the memory bar image into the pre-trained first detection model to obtain at least one chip region in the memory bar image, the region size of the at least one chip region is determined.

[0203] The chip image corresponding to a chip region whose size is smaller than a preset size is input into a pre-trained second detection model to obtain the QR code region in the chip image.

[0204] Perform QR code recognition on the QR code image corresponding to the QR code area.

[0205] The module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, other division methods are possible. Furthermore, the functional modules in each embodiment of this application can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. Coupling between modules can be achieved through interfaces, typically electrical communication interfaces, but mechanical interfaces or other types of interfaces are also possible. Therefore, modules described as separate components may or may not be physically separate; they can be located in one place or distributed across different locations on the same or different devices. The integrated modules described above can be implemented in hardware or as software functional modules.

[0206] Having introduced the QR code recognition method and apparatus according to exemplary embodiments of this application, we will now introduce an electronic device according to another exemplary embodiment of this application.

[0207] The following reference Figure 7To describe an electronic device 130 implemented according to this embodiment of the present application. Figure 7 The electronic device 130 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0208] like Figure 7 As shown, the electronic device 130 is presented in the form of a general-purpose electronic device. The components of the electronic device 130 may include, but are not limited to: at least one processor 131, at least one memory 132, and a bus 133 connecting different system components (including memory 132 and processor 131).

[0209] Bus 133 represents one or more of several bus structures, including a memory bus or memory controller, peripheral bus, processor, or local bus using any of the various bus structures.

[0210] The memory 132 may include a readable medium in the form of volatile memory, such as random access memory (RAM) 1321 and / or cache memory 1322, and may further include read-only memory (ROM) 1323.

[0211] The memory 132 may also include a program / utility 1325 having a set (at least one) of program modules 1324, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0212] Electronic device 130 can also communicate with one or more external devices 134 (e.g., keyboard, pointing device, etc.), and with one or more devices that enable a user to interact with electronic device 130, and / or with any device that enables electronic device 130 to communicate with one or more other electronic devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 135. Furthermore, electronic device 130 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 136. As shown, network adapter 136 communicates with other modules used in electronic device 130 via bus 133. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0213] In an exemplary embodiment, a storage medium is also provided, which enables the electronic device to perform the QR code recognition method described above when a computer program in the storage medium is executed by a processor of the electronic device. Optionally, the storage medium may be a non-transitory computer-readable storage medium, such as a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device.

[0214] In an exemplary embodiment, the electronic device of this application may include at least one processor and a memory communicatively connected to the at least one processor, wherein the memory stores a computer program that can be executed by the at least one processor, and when the computer program is executed by the at least one processor, it can cause the at least one processor to perform the steps of any QR code recognition method provided in the embodiments of this application.

[0215] In an exemplary embodiment, a computer program product is also provided, which, when executed by an electronic device, enables the electronic device to implement any of the exemplary methods provided in this application.

[0216] Furthermore, computer program products may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, RAM, ROM, erasable programmable read-only memory (EPROM), flash memory, optical fiber, compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0217] The program product for QR code recognition in this application embodiment can be a CD-ROM and include program code, and can run on a computing device. However, the program product of this application is not limited to this. In this document, the readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0218] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0219] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, radio frequency (RF), or any suitable combination thereof.

[0220] Program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, such as a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0221] It should be noted that although several units or sub-units of the device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.

[0222] Furthermore, although the operations of the method of this application are described in a specific order in the accompanying drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.

[0223] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0224] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0225] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0226] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0227] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.

[0228] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A QR code recognition method, characterized in that, include: Get the image of the memory module; The memory bar image is input into a pre-trained first detection model to obtain at least one chip region in the memory bar image; Perform QR code recognition on the chip image corresponding to each chip area; When recognition fails, the chip image is input into a pre-trained second detection model to obtain the QR code region in the chip image; Perform QR code recognition on the QR code image corresponding to the QR code area.

2. The method according to claim 1, characterized in that, The first detection model and the second detection model are the same detection model, or the first detection model and the second detection model are different detection models.

3. The method according to claim 2, characterized in that, When the first detection model and the second detection model are the same detection model, the detection model is trained according to the following steps: Acquire multiple first image samples, including memory bar image samples and chip image samples; The constructed deep learning network model is trained using the multiple first image samples; When the training level reaches a preset level, the current deep learning network model is pruned. The pruned deep learning network model is then trained using the multiple first image samples. Whenever the pruning conditions are met, the current deep learning network model is pruned, and the pruned deep learning network model is trained again using the multiple first image samples. The current deep learning network model is determined as the detection model when it is determined that the current deep learning network model meets the training stopping condition.

4. The method according to claim 2, characterized in that, When the first detection model and the second detection model are different detection models, the first detection model is trained according to the following steps: Acquire multiple second image samples, including memory bar image samples and chip image samples; The constructed deep learning network model is trained using the multiple second image samples; The current deep learning network model is determined as the first detection model when it is determined that the current deep learning network model meets the training stopping condition.

5. The method according to claim 4, characterized in that, The second detection model is trained according to the following steps: Acquire multiple third image samples, including chip image samples and QR code image samples; The constructed deep learning network model is trained using the multiple third image samples; The current deep learning network model is designated as the second detection model when it is determined that the current deep learning network model meets the training stopping condition.

6. The method according to any one of claims 1-5, characterized in that, Also includes: Determine the number of chips detected from the memory module image and the number of QR codes successfully recognized; Based on whether the number of chips and the number of QR codes match, it is determined whether there is an anomaly in the QR code recognition of the memory stick image.

7. The method according to any one of claims 1-5, characterized in that, Also includes: Before performing QR code recognition on either the chip image or the QR code image, the target image is corrected.

8. The method according to claim 1, characterized in that, After inputting the memory bar image into a pre-trained first detection model to obtain at least one chip region in the memory bar image, the method further includes: Determine the region size of the at least one chip region; The chip image corresponding to a chip region whose size is smaller than a preset size is input into a pre-trained second detection model to obtain the QR code region in the chip image. Perform QR code recognition on the QR code image corresponding to the QR code area.

9. A device for QR code recognition, characterized in that, include: The acquisition module is used to acquire images of memory modules. The first detection module is used to input the memory bar image into a pre-trained first detection model to obtain at least one chip region in the memory bar image; The first recognition module is used to perform QR code recognition on the chip image corresponding to each chip area; The second detection module is used to input the chip image into a pre-trained second detection model when recognition fails, so as to obtain the QR code area in the chip image. The second recognition module is used to perform QR code recognition on the QR code image corresponding to the QR code area.

10. The apparatus according to claim 9, characterized in that, The first detection model and the second detection model are the same detection model, or the first detection model and the second detection model are different detection models.

11. The apparatus according to claim 10, characterized in that, When the first detection model and the second detection model are the same detection model, the detection model is trained according to the following steps: Acquire multiple first image samples, including memory bar image samples and chip image samples; The constructed deep learning network model is trained using the multiple first image samples; When the training level reaches a preset level, the current deep learning network model is pruned. The pruned deep learning network model is then trained using the multiple first image samples. Whenever the pruning conditions are met, the current deep learning network model is pruned, and the pruned deep learning network model is trained again using the multiple first image samples. The current deep learning network model is determined as the detection model when it is determined that the current deep learning network model meets the training stopping condition.

12. The apparatus according to claim 9, characterized in that, It also includes an exception handling module, used for: Determine the number of chips detected from the memory module image and the number of QR codes successfully recognized; Based on whether the number of chips and the number of QR codes match, it is determined whether there is an anomaly in the QR code recognition of the memory stick image.

13. The apparatus according to claim 9, characterized in that, Also includes: The correction module is used to correct the target image before performing QR code recognition on either the chip image or the QR code image.

14. An electronic device, characterized in that, include: At least one processor, and a memory communicatively connected to said at least one processor, wherein: The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1-8.

15. A storage medium, characterized in that, When the computer program in the storage medium is executed by the processor of the electronic device, the electronic device is able to perform the method as described in any one of claims 1-8.