Method and device for identifying label content based on photographing, and storage medium
The method of scanning code and taking photos recognition information through WeChat Mini Programs solves the problem of low product information entry efficiency, and realizes the function of high -efficiency and accurate information entry and generating Excel tables.
Patent Information
- Application Number
- CN202411321906.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-23
- Publication Date
- 2025-01-28
AI Technical Summary
During product sales, the operator needs to manually enter information about unqualified products, resulting in large information and large quantity, resulting in low efficiency and large workload.
Design a method based on the content of camera recognition labels, information recognition: code scanning and taking pictures through WeChat mini -programs, automatically extracted and entered the product information, and generate Excel tables.
This method greatly improves the accuracy of work efficiency and information entry, reduces the time required for monthly entry information, shortens from three working days to three hours, and stores in the database to improve the fault tolerance of work.
Smart Images

Figure CN119379972A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of tag identification information technology, and specifically relates to a method, device and storage medium for identifying tag content based on photographing. Background Art
[0002] In the process of product sales, unqualified products are often returned. After the client returns the unqualified products, the operator needs to manually enter the motor code, controller code, and double barcode of the product through a barcode scanner, and use the keyboard to enter the information on the label of the returned product, such as Vin code, maintenance date, vehicle model platform, cause of failure, etc. The existing operators need to manually enter the above information into Excel tables, which is very time-consuming and labor-intensive. Every month, there are hundreds of product information that need to be entered, with a lot of information and a large number. According to statistics, it takes about three days to enter the information of returned products every month.
[0003] Existing photo recognition technology is widely used, including the recognition of text labels, but this technology cannot perform information extraction operations based on the operator's recognition needs. Summary of the invention
[0004] In response to the above problems, the main purpose of the present invention is to design a method, device and storage medium for identifying label content based on photographing. The method includes two methods: scanning codes and taking photos, which solve the technical problems of low efficiency and heavy workload caused by a large amount of product information entry.
[0005] In order to achieve the above purpose, the present invention adopts the following technical solutions: A method for identifying tag content based on taking photos, used on an electronic device including a WeChat applet, the method comprising product information identification, identification content confirmation, and generation of an Excel table; Among them, product information recognition includes scanning code input recognition and / or taking photos input recognition; The code scanning and input recognition is that the WeChat applet scans the code through an electronic device, enters the barcode of the product, and displays the information on the WeChat applet page; the photo entry recognition is that the WeChat applet takes a photo through an electronic device, uploads the label image of the product to the WeChat applet, automatically analyzes the label image content through the WeChat applet, and extracts the information to the WeChat applet page; The identification content is confirmed as: Confirm the information on the WeChat Mini Program page, and submit the correct information to the preset database; if the information is incorrect, modify it on the WeChat Mini Program page, and submit it to the preset database after modification; the page information will be automatically cleared after the information is successfully uploaded; Generate an Excel table as: After the information is entered, select the entered time period on the WeChat mini program page. The WeChat mini program will automatically generate data for the selected time period, generate an Excel table for the selected data, and automatically transfer it to the specified path for storage.
[0006] As a further description of the present invention, the WeChat applet includes a front end and a back end; The front end includes two pages, corresponding to code scanning and recognition and code scanning and recognition + photo recording and recognition; it is responsible for layout page display, identifying barcode information scanned by electronic equipment and displaying it on the page, receiving label images input by electronic equipment and transmitting them to the back end, and selecting time periods and transmitting them to the back end; The backend is used to receive the barcode information recognized by the front end, parse the label image information and display it on the page, upload the information to the preset database, query the data in the database according to the selected time period, and generate an Excel table and automatically transmit it to the specified path for storage.
[0007] As a further description of the present invention, the front end of the WeChat applet includes: a wxml file, a wxss file, a js file, and a py file; The front-end page framework is composed of wxml files, which use text markup language to build the WeChat applet page, including: title, input box, icon, button content; Optimize and adjust the WeChat applet page layout through the wxss file, including: text size, format, and placement of each component, including a text box, a time selection box, and a button; The js file is used to implement the functions of the WeChat applet, including: time period selection, date parameter transmission and processing, clicking the button on the page to transmit part of the data to the backend for processing and generate Excel tables, and uploading photos of electronic devices to the WeChat applet; The py file is used to receive the transmission information of the front end and implement functions according to different interfaces of the front end, including: barcode, date, photo, and process it as needed, and return the required parameter information to the front end.
[0008] As a further description of the present invention, the backend of the WeChat applet receives data transmitted by the front end through the URL and the route, and returns information to the front end through the URL and the route; Use the psycopg2 package in Python to connect to the corresponding database and upload the data to the preset database; Through openpyxl and xlsxwriter packages in Python, the data in the database is converted into an Excel table, and the Excel table is automatically transferred to the specified path for storage through the pysmb package and the smb protocol.
[0009] As a further description of the present invention, during the code scanning and identification, the WeChat applet calls up the WeChat scan function, identifies the barcode of the product, and returns identification parameters for identifying the motor code, controller code and dual barcodes, and displays the scanning result information on the WeChat applet page.
[0010] As a further description of the present invention, in the photo entry, the WeChat applet takes a picture, calls up the camera or photo album of the electronic device, takes a picture or accesses the album pictures of the electronic device, and the obtained label picture is passed to the WeChat applet for parsing operation, and the parsed label picture information is extracted to the WeChat applet page.
[0011] As a further description of the present invention, in the photo entry recognition, after receiving the label picture, the WeChat applet backend program calls the Tencent Cloud general text recognition API interface, configures the domain name of the corresponding interface to be called, passes in the Tencent Cloud account key and the picture, and parses the label picture content. The parsing process is as follows: According to the API interface's request domain name, upload the label image to the API interface of this domain name. After receiving the label image, the API interface returns the parsed Json file of the label image. The program parses the returned Json file, extracts the required information from the returned Json file according to the file format, temporarily stores the label image information locally, and passes the required label image information to the WeChat applet page; The required label image information includes: Vin code, maintenance date, invoice date, vehicle model platform, cause of failure, failure type, failure description, fault code, maintenance mileage, and replaced part number.
[0012] As a further description of the present invention, in the process of generating an Excel table, the front-end page of the WeChat applet includes a start time drop-down box selection and an end time drop-down box selection. The WeChat applet uses the selected start time and end time as the time period and passes it to the back-end program. The back-end program connects to the corresponding database through the psycopg2 package in the Python language and queries the data generated in the time period. According to the queried data content, the openpyxl and xlsxwriter packages in the Python language are called in the back-end program to generate an Excel table by column for the data in the database, and the Excel table is automatically uploaded to the specified path through the smb protocol.
[0013] An electronic device is provided, wherein the electronic device is installed with a WeChat applet, wherein the WeChat applet stores a computer program, and the above method is executed by running the stored computer program.
[0014] A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the above method when executed by a WeChat applet.
[0015] Compared with the prior art, the technical effects of the present invention are: The present invention provides a method, device and storage medium based on identifying tag content by taking photos, which cooperate with the development of WeChat applet, including product information identification, identification content confirmation, and Excel table generation functions; the WeChat applet automatically identifies instead of traditional manual input, which provides convenience for after-sales parts feedback information. The method generates Excel tables by scanning codes and / or taking photos to automatically identify, which shortens the time from three working days per month to three hours per month, greatly improving work efficiency and the accuracy of input information. In addition, because the information is stored in the database, the fault tolerance of the work is improved, and data loss caused by accidental deletion of files is prevented. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a schematic diagram of the overall process of the method of the present invention; Figure 2 This is a schematic diagram of the cooperation between the front-end and back-end of the WeChat applet in the code scanning and input recognition of the present invention; Figure 3 Schematic diagram of the cooperation between the front-end and back-end of the WeChat applet in the code scanning and recognition + photo recording and recognition of the present invention Figure 4 This is a schematic diagram of the layout of the scan code entry recognition page of the present invention; Figure 5 This is a schematic diagram of the page layout of scanning code input recognition + taking photo input recognition in the present invention. DETAILED DESCRIPTION
[0017] The present invention is described in detail below in conjunction with the accompanying drawings: In one embodiment of the present invention, a method for identifying tag content based on photographing is disclosed, referring to Figure 1-5 As shown, it is used on an electronic device including a WeChat applet, and the electronic device includes but is not limited to a mobile phone. The method includes: product information identification, identification content confirmation, and generation of an Excel table.
[0018] Specifically, in this embodiment, product information recognition includes two methods, namely, scanning code input recognition and taking photos for input recognition; selection is made according to different needs. The scanning code input recognition is: the WeChat applet scans the code through an electronic device, enters the barcode of the product, and displays the information on the WeChat applet page; the taking photos for input recognition is: the WeChat applet takes a photo through an electronic device, uploads the label image of the product to the WeChat applet, automatically parses the label image content through the WeChat applet, and extracts the information to the WeChat applet page; The identification content is confirmed as follows: based on the actual information of the product, the information on the WeChat Mini Program page is confirmed, and the confirmed correct information is submitted and uploaded to the preset database; if the information is incorrect, it is modified on the WeChat Mini Program page, and the modified information is submitted and uploaded to the preset database; the page information is automatically cleared after the information is successfully uploaded; To generate an Excel table: After the information is entered, select the entered time period on the WeChat mini-program page, and the WeChat mini-program will automatically generate data within the selected time period. The selected data will be generated into an Excel table and automatically transferred to the specified path for storage.
[0019] To ensure information security, the above-mentioned designated path is a path designated by the quality personnel. In this embodiment, the designated path is set to a corresponding folder of the employee's shared disk within the company.
[0020] More specifically, this embodiment implements the recognition of barcodes and label images based on the settings of the WeChat applet, wherein the WeChat applet includes a front end and a back end; the front end includes two pages, corresponding to the code scanning entry recognition and the code scanning entry recognition + photo entry recognition, that is, this embodiment includes two recognition methods and processes: code scanning entry recognition and code scanning entry recognition + photo entry recognition, as shown in the following figure. Figure 1 shown.
[0021] In this embodiment, Figure 2-3 The figure shows the cooperation between the front-end and back-end of the WeChat applet during the process of code scanning and recognition, code scanning and recognition + photo scanning and recognition. Specifically, the front-end is responsible for layout page display, identifying the barcode information scanned by the electronic device and displaying it on the page, receiving the label image input by the electronic device and transmitting it to the back-end, selecting the time period and transmitting it to the back-end; the back-end is used to receive the barcode information recognized by the front-end, parse the label image information and display it on the page, upload the information to the preset database, query the data in the database according to the selected time period, and generate an Excel table and automatically transmit it to the specified path for storage.
[0022] It should be noted that the WeChat applet front-end includes: wxml files (files with the suffix wxml), wxss files (files with the suffix wxss), js files (files with the suffix js), and py files (files with the suffix .py).
[0023] Specifically, the front-end page framework is composed of a wxml file, which uses a text markup language to build the page of the WeChat applet, including: title, input box, icon, button and other contents; Optimize and adjust the WeChat Mini Program page layout through the wxss file, including text size, format, and placement of components, such as text boxes, time selection boxes, buttons, etc.; The js file is used to implement the functions of the WeChat applet, including: time period selection (time selection in the date drop-down box on the page), date parameter transmission and processing, clicking the button on the page to transmit part of the data to the backend for processing and generate an Excel table, and uploading photos of electronic devices to the WeChat applet; The py file is used to receive the transmission information of the front end and implement functions according to different interfaces of the front end, including: barcode, date, photo, etc., and process it as needed, and return the required parameter information to the front end.
[0024] The backend of WeChat Mini Program includes: receiving data transmitted by the front end through URL and routing, such as barcode information and the date and time selected by the user; returning information to the front end through URL and routing, such as returning the content information recognized in the label image, so that the user can verify the information content; connecting to the corresponding database through the psycopg2 package in Python language and uploading data to the preset database; converting the data in the database into Excel tables through openpyxl and xlsxwriter packages in Python, and automatically transferring the Excel tables to the specified path for storage through the pysmb package and smb protocol.
[0025] Specifically, in this embodiment, in the above-mentioned scanning code entry recognition, the wx.scanCode method is used, that is, the WeChat applet calls the WeChat scan function to recognize the QR code of the product and return the recognition parameters, which are used to recognize the motor code, controller code and dual barcodes in this process; and the scanning result is displayed in the input box of the page. If the result is incorrect, the content can be manually modified, such as Figure 4 shown.
[0026] In the above-mentioned photo entry recognition, the wx.chooseMeida method is used, that is, click to take a picture in the WeChat applet, call the camera or album picture of the electronic device, take a picture or access the picture upload operation in the electronic device, and after obtaining the label picture, pass the label picture to the back-end program for parsing operation. In this process, it is used to identify the Vin code, maintenance date, invoice date, vehicle model platform, fault cause, fault type, fault description, fault code, maintenance mileage, replacement part number, etc.; and extract the identified information into the input box of the WeChat applet page. If the result is incorrect, it can be manually modified, such as Figure 5 shown.
[0027] It should be noted that the scanCode method mentioned above is an interface in the WeChat developer tool, which is used to call up the client scanning interface for scanning; the chooseMeida method is used to receive photos taken by a mobile phone or uploaded from a mobile phone album.
[0028] In addition, in this embodiment, in the photo entry recognition, after receiving the label picture, the WeChat applet backend program calls the Tencent Cloud Universal Text Recognition API interface, configures the domain name of the corresponding interface to be called, passes in the Tencent Cloud account key and picture, and parses the label picture content. The parsing process is as follows: According to the requested domain name of the API interface, the label image is uploaded to the API interface of this domain name. After receiving the label image, the API interface returns the parsed Json file of the label image; the program parses the returned Json file, extracts the required information from the returned Json file according to the file format, temporarily stores the label image information (data) locally, and passes the required label image information (partial data) to the WeChat mini program page to display it to the user; the required label image information includes but is not limited to: Vin code, maintenance date, invoice date, vehicle model platform, fault cause, fault type, fault description, fault code, maintenance mileage, replaced accessory number, etc.
[0029] After the user confirms that all the information is correct, click the "Submit" button on the page. The back-end program connects to the corresponding database through the psycopg2 package in the Python language and uploads the data to the preset database. At the same time, the content in the input boxes such as the motor code on the page will be cleared.
[0030] It should be noted that the above-mentioned psycopg2 is a Python library for connecting to and accessing the PostgreSQL database system. It provides a set of tools and methods that can easily perform database operations in Python programs, including query, insert, update, delete and other operations.
[0031] In this embodiment, the WeChat applet front page includes a start time drop-down box selection and an end time drop-down box selection, such as Figure 4-5 As shown, if the user needs to export data, click the "Generate Excel" button after selecting the exported data time. Specifically, the WeChat applet front-end program will pass the start time and end time selected by the user in the drop-down box on the page as the time period to the back-end program. The back-end program enters the database according to the selected time period and queries the data generated in the time period. According to the queried data content, write code in the back-end program to call the openpyxl and xlsxwriter packages in the Python language, generate Excel tables by column from the data in the database, and automatically upload the Excel tables to the specified path through the pysmb package and the smb protocol.
[0032] It should be noted that the above-mentioned openpyxl is a Python library for reading and editing Excel files. It can easily read, write and set the style of Excel data, and can realize a large number of repetitive Excel operations; the above-mentioned xlsxwriter is a library for creating 2007+ XLSX files, including table operations such as inserting data and inserting icons. It provides a simple and easy-to-use interface and can easily generate Excel files; the above-mentioned pysmb package is an SMB / CIFS library implemented in pure Python, which supports file sharing between Windows and Linux machines.
[0033] Through the above embodiments, the label content recognition method of the present invention is disclosed, and the specific working process is as follows: first, the operator enters the WeChat applet by scanning the code with a mobile phone. In the WeChat applet, the product barcode can be scanned and entered by clicking the motor code, the controller code, and the double barcode pattern. After entering, the code will be displayed on the page. If there is an error, the barcode content can be manually modified. Alternatively, you can also take a picture of the label on the product by clicking the "click to take a picture" button, and the label image program can automatically identify the information in the label. After entering, the information will be displayed on the page. If there is an error, the information content can be manually modified. Secondly, click the "Submit" button to upload the information data to the database. If you want to batch extract all the information content of the entered product, you can select the start time and end time of the entry on the page, and click the "Generate Excel" button to automatically edit the data into an Excel table and upload it to the specified path.
[0034] Compared with the prior art, the present invention replaces traditional manual input with automatic identification of WeChat applet, which provides convenience for after-sales feedback information. Specifically, the method of manually entering after-sales product information and organizing it into Excel tables is adjusted to automatically identifying and generating Excel tables by scanning codes and / or taking photos, shortening the three working days per month to three hours per month, greatly improving work efficiency and the accuracy of input information. In addition, because the information is stored in the database, the fault tolerance of the work is improved, preventing data loss due to accidental deletion of files.
[0035] In another embodiment of the present invention, an electronic device is also included, wherein the electronic device has a WeChat applet installed, and the WeChat applet stores a computer program, and the above method is executed by running the stored computer program.
[0036] In addition, in combination with the identification method in the above embodiment, an embodiment of the present invention may provide a computer storage medium for implementation, on which computer program instructions are stored; the computer program instructions implement the above identification method when the WeChat applet is run.
[0037] It should be clear that the present invention is not limited to the above disclosed methods and devices, but also includes various changes, modifications and additions made by those skilled in the art based on the ideas of the present invention, or changes in the order of steps. The above embodiments are only used to illustrate the technical solution of the present invention but not to limit it. Other modifications or equivalent substitutions made by ordinary technicians in this field to the technical solution of the present invention should be included in the scope of the claims of the present invention as long as they do not depart from the spirit and scope of the technical solution of the present invention.
Claims
1. A method for identifying tag content based on taking photos, used on an electronic device including a WeChat applet, characterized in that: The method includes product information identification, identification content confirmation, and Excel table generation; Among them, product information recognition includes scanning code input recognition and / or taking photos input recognition; The code scanning and input recognition is that the WeChat applet scans the code through an electronic device, enters the barcode of the product, and displays the information on the WeChat applet page; the photo entry recognition is that the WeChat applet takes a photo through an electronic device, uploads the label image of the product to the WeChat applet, automatically analyzes the label image content through the WeChat applet, and extracts the information to the WeChat applet page; The identification content is confirmed as: Confirm the information on the WeChat Mini Program page, and submit the correct information to the preset database; if the information is incorrect, modify it on the WeChat Mini Program page, and submit it to the preset database after modification; the page information will be automatically cleared after the information is successfully uploaded; Generate an Excel table as: After the information is entered, select the entered time period on the WeChat mini program page. The WeChat mini program will automatically generate data for the selected time period, generate an Excel table for the selected data, and automatically transfer it to the specified path for storage.
2. The method for identifying tag content based on photographing according to claim 1, characterized in that: The WeChat applet includes a front end and a back end; The front end includes two pages, corresponding to code scanning and recognition and code scanning and recognition + photo recording and recognition; it is responsible for layout page display, identifying barcode information scanned by electronic equipment and displaying it on the page, receiving label images input by electronic equipment and transmitting them to the back end, and selecting time periods and transmitting them to the back end; The backend is used to receive the barcode information recognized by the front end, parse the label image information and display it on the page, upload the information to the preset database, query the data in the database according to the selected time period, and generate an Excel table and automatically transmit it to the specified path for storage.
3. The method for identifying tag content based on photographing according to claim 2, characterized in that: The front end of the WeChat applet includes: wxml file, wxss file, js file, and py file; The front-end page framework is composed of wxml files, which use text markup language to build the WeChat applet page, including: title, input box, icon, button content; Optimize and adjust the WeChat applet page layout through the wxss file, including: text size, format, and placement of each component, including a text box, a time selection box, and a button; The js file is used to implement the functions of the WeChat applet, including: time period selection, date parameter transmission and processing, clicking the button on the page to transmit part of the data to the backend for processing and generate Excel tables, and uploading photos of electronic devices to the WeChat applet; The py file is used to receive the transmission information of the front end and implement functions according to different interfaces of the front end, including: barcode, date, photo, and process it as needed, and return the required parameter information to the front end.
4. The method for identifying tag content based on photographing according to claim 3, characterized in that: The backend of the WeChat applet receives data transmitted by the frontend through the URL and route, and returns information to the frontend through the URL and route; Use the psycopg2 package in Python to connect to the corresponding database and upload the data to the preset database; Through openpyxl and xlsxwriter packages in Python, the data in the database is converted into an Excel table, and the Excel table is automatically transferred to the specified path for storage through the pysmb package and the smb protocol.
5. The method for identifying tag content based on photographing according to claim 1, characterized in that: During the code scanning and identification, the WeChat applet invokes the WeChat scan function to identify the product's barcode and returns identification parameters for identifying the motor code, controller code and dual barcodes, and displays the scan result information on the WeChat applet page.
6. The method for identifying tag content based on photographing according to claim 1, characterized in that: In the photo entry, the WeChat applet takes a picture, calls up the camera or photo album of the electronic device, takes a picture or accesses the album pictures of the electronic device, and the obtained label picture is passed to the WeChat applet for parsing operation, and the parsed label picture information is extracted to the WeChat applet page.
7. The method for identifying tag content based on photographing according to claim 4, characterized in that: In the photo entry recognition, after receiving the label image, the WeChat applet backend program calls the Tencent Cloud Universal Text Recognition API interface, configures the domain name of the corresponding interface to be called, passes in the Tencent Cloud account key and the image, and parses the label image content. The parsing process is as follows: According to the API interface's request domain name, upload the label image to the API interface of this domain name. After receiving the label image, the API interface returns the parsed Json file of the label image. The program parses the returned Json file, extracts the required information from the returned Json file according to the file format, temporarily stores the label image information locally, and passes the required label image information to the WeChat applet page; The required label image information includes: Vin code, maintenance date, invoice date, vehicle model platform, cause of failure, failure type, failure description, fault code, maintenance mileage, and replaced part number.
8. The method for identifying tag content based on photographing according to claim 4, characterized in that: In the process of generating the Excel table, the front-end page of the WeChat applet includes a start time drop-down box selection and an end time drop-down box selection. The WeChat applet uses the selected start time and end time as the time period and passes it to the back-end program. The back-end program connects to the corresponding database through the psycopg2 package in the Python language and queries the data generated in the time period. According to the queried data content, the openpyxl and xlsxwriter packages in the Python language are called in the back-end program to generate an Excel table by column from the data in the database, and the Excel table is automatically uploaded to the specified path through the smb protocol.
9. An electronic device, characterized in that: The electronic device is installed with a WeChat applet, and the WeChat applet stores a computer program, and executes the method described in any one of claims 1 to 8 by running the stored computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by the WeChat applet, it implements the method as described in any one of claims 1 to 8.