Disclosure of Invention
The embodiment of the application aims to provide a bar code reading method, a device, equipment and a storage medium, which are used for realizing the reading of bar codes of different types and improving the scanning and identifying efficiency of the bar codes.
An embodiment of the present application provides a barcode reading method, including: acquiring code scanning task information; searching all reading rules conforming to the code scanning task information in a preset reading rule base based on the code scanning task information to obtain a target rule set; reading a first bar code for verification according to the reading rule in the target rule set; and storing the first bar code which passes the verification into a bar code information table.
In an embodiment, the searching all the reading rules conforming to the code scanning task information in a preset reading rule base based on the code scanning task information to obtain a target rule set includes: determining the code scanning task type according to the code scanning task information; according to the code scanning task type, searching a corresponding target code from the code scanning task information; and searching all the reading rules corresponding to the target codes in a preset reading rule base based on the target codes to obtain a target rule set.
In an embodiment, the searching the corresponding target code from the code scanning task information according to the code scanning task type includes: when the code scanning task type is a first type, the target code is a first code; and when the code scanning task type is the second type, the target code is the second code.
In an embodiment, the reading the first barcode according to the reading rule in the target rule set for verification includes: selecting the reading rule with the highest preset priority from the target rule set as a target reading rule; reading a first bar code according to the target reading rule to verify; judging whether the verification is passed or not; when the verification is not passed, selecting the reading rule of the next priority from the target rule set as a target reading rule according to the sequence from high to low of the preset priority; and reading the first bar code for verification according to the target reading rule until the verification passes.
In an embodiment, the reading the first barcode according to the target reading rule for verification includes: intercepting the first bar code according to the target reading rule to obtain a second bar code; acquiring article information corresponding to the second bar code; and verifying the article information.
In an embodiment, the reading the first barcode according to the target reading rule for verification includes: reading a first bar code according to the target reading rule; acquiring a second bar code corresponding to the first bar code based on a preset association relation; acquiring article information corresponding to the second bar code; and verifying the article information.
In an embodiment, the reading rule includes coding information, interception mode information, priority information, and valid state information.
A second aspect of an embodiment of the present application provides a barcode reading apparatus, including: the acquisition module is used for acquiring code scanning task information; the searching module is used for searching all reading rules conforming to the code scanning task information in a preset reading rule base based on the code scanning task information to obtain a target rule set; the reading module is used for reading the first bar code for verification according to the reading rules in the target rule set; and the storage module is used for storing the first bar code which passes the verification into a bar code information table.
In an embodiment, the search module is configured to: determining the code scanning task type according to the code scanning task information; according to the code scanning task type, searching a corresponding target code from the code scanning task information; and searching all the reading rules corresponding to the target codes in a preset reading rule base based on the target codes to obtain a target rule set.
In one embodiment, the reading module is configured to: selecting the reading rule with the highest preset priority from the target rule set as a target reading rule; reading a first bar code according to the target reading rule to verify; judging whether the verification is passed or not; when the verification is not passed, selecting the reading rule of the next priority from the target rule set as a target reading rule according to the sequence from high to low of the preset priority; and reading the first bar code for verification according to the target reading rule until the verification passes.
In one embodiment, the reading module is specifically configured to: intercepting the first bar code according to the target reading rule to obtain a second bar code; acquiring article information corresponding to the second bar code; and verifying the article information.
In one embodiment, the reading module is specifically configured to: reading a first bar code according to the target reading rule; acquiring a second bar code corresponding to the first bar code based on a preset association relation; acquiring article information corresponding to the second bar code; and verifying the article information.
A third aspect of an embodiment of the present application provides an electronic device, including: a memory for storing a computer program; a processor configured to perform the method of the first aspect of the embodiments of the present application and any of the embodiments thereof.
A fourth aspect of an embodiment of the present application provides a non-transitory electronic device readable storage medium, comprising: and a program which, when run by an electronic device, causes the electronic device to perform the method of the first aspect of the embodiments of the application and any of its embodiments.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
In the description of the present application, the terms "first," "second," and the like are used merely for distinguishing between descriptions, and do not denote a ordinal number, nor are they to be construed as indicating or implying relative importance.
In the description of the present application, the terms "comprises," "comprising," and the like, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, elements, components, and/or groups thereof.
In the description of the present application, the terms "mounted," "disposed," "provided," "connected," and "configured" are to be construed broadly unless otherwise specifically defined and limited. For example, it may be a fixed connection, a removable connection, or a unitary construction; can be mechanically or electrically connected; either directly or indirectly, through intermediaries, or through internal communication between two devices, elements, or components. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art according to the specific circumstances.
Referring to fig. 1, a schematic structural diagram of an electronic device 100 according to an embodiment of the application includes at least one processor 120 and a memory 130, and one processor is illustrated in fig. 1. The processor 120 and the memory 130 are connected through the bus 110, and the memory 130 stores instructions executable by the at least one processor 120, the instructions being executed by the at least one processor 120 to cause the at least one processor 120 to perform a bar code reading method as in the following embodiments.
In one embodiment, processor 120 may be a general-purpose Processor including, but not limited to, a central processing unit (Central Processing Unit, CPU), a network Processor (Network Processor, NP), etc., a digital signal Processor (DIGITAL SIGNAL Processor, DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (Field Programmable GATE ARRAY, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, and the processor 120 is a control center of the electronic device 100, connecting various parts of the entire electronic device 100 using various interfaces and lines. Processor 120 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application.
In one embodiment, memory 130 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, including, but not limited to, random access Memory (Random Access Memory, RAM), read Only Memory (ROM), static random access Memory (Static Random Access Memory, simply SRAM), programmable Read Only Memory (Programmable Read-Only Memory, PROM), erasable Read Only Memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory, EEPROM), and the like.
The structure of the electronic device 100 shown in fig. 1 is merely illustrative, and the electronic device 100 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
Fig. 2 is a flowchart of a barcode reading method according to an embodiment of the present application, which can be performed by the electronic device 100 shown in fig. 1 to achieve reading of different types of barcodes. The method comprises the following steps:
Step 210: and acquiring code scanning task information.
In the above step, the code scanning task information may include a first barcode to be scanned and an operation node where the code scanning task is located. Taking the logistics storage scene as an example, the first bar code can be scanned by a code scanning gun or other handheld devices at different operation nodes so as to record or inquire the information of the article, and the operation nodes can comprise, but are not limited to, receiving goods, loading, picking goods, rechecking, checking, stock inquiring, shifting and the like.
The first bar code is an SN code (Serial Number) which is a unique code of an article and can be used for precisely managing each article, the SN code is generally pasted or drawn on the article in a bar code form, and the bar code is a graphic identifier for expressing a group of information by arranging a plurality of black bars and blanks with different widths according to a certain coding rule. A common bar code is a pattern of parallel lines arranged by black bars (abbreviated bars) and white bars (abbreviated spaces) of widely varying reflectivity.
The logic for generating the SN codes of different types may be the same or different, for example, some types of SN codes may include 69 codes, some types of SN codes do not include 69 codes, china adopts an international commodity code and bar code identification system, and popularizes and applies commodity bar codes to establish a commodity identification system of China, and since commodity codes of China begin with 69, the commodity identification system is also called 69 codes.
Step 220: searching all reading rules conforming to the code scanning task information in a preset reading rule base based on the code scanning task information to obtain a target rule set.
In the above steps, different reading rules may be configured for different warehouses, and the reading rules and corresponding warehouse codes are associated and stored in a preset reading rule library, where each warehouse may be configured with one or more reading rules correspondingly, and the priority among the plurality of reading rules may be configured according to the storage condition of the articles in the warehouse, for example, the more articles in the warehouse storing a certain type of SN code, the higher the priority of the reading rule applicable to the type of SN code.
In addition, different reading rules can be configured for different owners, the reading rules are associated with corresponding owner codes and stored in a preset reading rule base, one or more reading rules can be correspondingly configured for each owner, and priorities among the plurality of reading rules can be configured according to the condition of the articles of the owner.
In one embodiment, the reading rule may include encoding information, interception mode information, priority information, and valid state information.
In the above step, the code information refers to a cargo owner code or a warehouse code associated with the read rule, and the interception mode information may include a start bit and a stop bit of the read, and may further include a special separator, for example, "" "; the special separator based interception mode may be configured to read from the special separator or to read the content between two special separators. The priority information can be represented by the size of a numerical value, the smaller the numerical value is, the higher the priority is, the valid state information is generally valid (Y) or invalid (N), and when all the reading rules conforming to the code scanning task information are searched, the reading rules in the invalid state can be automatically skipped.
In an embodiment, searching all the reading rules conforming to the code scanning task information in a preset reading rule base based on the code scanning task information to obtain a target rule set may include: determining the code scanning task type according to the code scanning task information; according to the code scanning task type, searching a corresponding target code from code scanning task information; searching all reading rules corresponding to the target codes in a preset reading rule base based on the target codes to obtain a target rule set.
In an embodiment, according to the code scanning task type, searching the corresponding target code from the code scanning task information may include: when the code scanning task type is the first type, the target code is the first code; when the code scanning task type is the second type, the target code is the second code.
In the above step, it may be determined whether the code scanning task type is a first type or a second type according to the operation node in the code scanning task information, when the code scanning task type is the first type, the first code is searched from the code scanning task information, when the code scanning task type is the second type, the second code is searched from the code scanning task information, and then according to the first code or the second code, the corresponding associated reading rule is searched in a preset reading rule library, so as to obtain the target rule set.
In the logistics storage scene, the first type can be a job ticket type, the first code is a cargo owner code, the second type can be an in-warehouse query type, the second code is a warehouse code, the code scanning tasks in the nodes of receiving, loading, picking and rechecking belong to the first type, and the code scanning tasks in the nodes of checking, inventory query and shifting belong to the second type.
Step 230: and reading the first bar code for verification according to the reading rule in the target rule set.
In one embodiment, reading the first barcode to verify according to the reading rule in the target rule set includes: selecting a reading rule with the highest preset priority from the target rule set as a target reading rule; reading the first bar code according to the target reading rule for verification; judging whether the verification is passed or not; when the verification fails, selecting a reading rule of the next priority from the target rule set according to the sequence from high to low of the preset priority, and taking the reading rule as a target reading rule; and reading the first bar code for verification according to the target reading rule until the verification passes.
In an embodiment, according to the target reading rule, reading the first barcode for verification may include: intercepting the first bar code according to the target reading rule to obtain a second bar code; acquiring article information corresponding to the second bar code; and checking the article information.
In the above steps, the first barcode is an SN code, the second barcode is a 69 code, the 69 code is included in the SN code, firstly, interception and verification are performed on the SN code according to a reading rule with the highest preset priority in the target rule set, and if the verification is not passed, interception and verification are performed on the SN code according to a reading rule with the next priority according to the sequence from high to low of the preset priority. Intercepting and checking the SN code may include: judging whether the intercepted part is 69 codes, if the intercepted part is not 69 codes, checking not to pass, if the intercepted part is 69 codes, acquiring article information corresponding to the 69 codes, judging whether the article information is consistent with order information in an order system, if so, checking to pass, and if not, checking not to pass. The item information may include, but is not limited to, item name, model number, date of manufacture, lot size, etc.
In one embodiment, reading the first barcode to verify according to the target reading rule includes: reading the first bar code according to the target reading rule; acquiring a second bar code corresponding to the first bar code based on a preset association relation; acquiring article information corresponding to the second bar code; and checking the article information.
In the above steps, the first barcode is an SN code, the second barcode is a 69 code, the 69 code is not included in the SN code, but the database stores a preset association relationship between the SN code and the 69 code, and the second barcode corresponding to the first barcode may be acquired based on the preset association relationship, so that the article information corresponding to the second barcode is acquired for verification.
In an embodiment, the code scanning task information may include a first bar code and a second bar code with scanning, and then the second bar code is read first for verification, and then the first bar code is read, and the first bar code and the second bar code are associated.
Step 240: and storing the first bar code passing the verification into a bar code information table.
In the above step, according to the reading rule in the target rule set, the first barcode is read for verification, and after the verification is passed, the first barcode and the newly added or changed operation information of the current operation node are stored in the barcode information table, where the operation information may include, but is not limited to: code scanning time, article storage positions and the like.
As shown in fig. 3, a schematic structural diagram of a barcode reading apparatus 300 according to an embodiment of the present application is shown, which can be applied to the electronic device 100 shown in fig. 1, and includes: the device comprises an acquisition module 310, a search module 320, a reading module 330 and a storage module 340. The principle relation of each module is as follows:
The acquiring module 310 is configured to acquire code scanning task information.
The searching module 320 is configured to search all the reading rules conforming to the code scanning task information in a preset reading rule base based on the code scanning task information, so as to obtain a target rule set.
And the reading module 330 is configured to read the first barcode to perform verification according to the reading rule in the target rule set.
And the storage module 340 is configured to store the first barcode that passes the verification in the barcode information table.
In one embodiment, the lookup module 320 is configured to: determining the code scanning task type according to the code scanning task information; according to the code scanning task type, searching a corresponding target code from code scanning task information; searching all reading rules corresponding to the target codes in a preset reading rule base based on the target codes to obtain a target rule set.
In one embodiment, when the code scanning task type is the first type, the target code is the first code; when the code scanning task type is the second type, the target code is the second code.
In one embodiment, the reading module 330 is configured to: selecting a reading rule with the highest preset priority from the target rule set as a target reading rule; reading the first bar code according to the target reading rule for verification; judging whether the verification is passed or not; when the verification fails, selecting a reading rule of the next priority from the target rule set according to the sequence from high to low of the preset priority, and taking the reading rule as a target reading rule; and reading the first bar code for verification according to the target reading rule until the verification passes.
In one embodiment, the reading module 330 is specifically configured to: intercepting the first bar code according to the target reading rule to obtain a second bar code; acquiring article information corresponding to the second bar code; and checking the article information.
In one embodiment, the reading module 330 is specifically configured to: reading the first bar code according to the target reading rule; acquiring a second bar code corresponding to the first bar code based on a preset association relation; acquiring article information corresponding to the second bar code; and checking the article information.
In one embodiment, the reading rule includes coding information, interception mode information, priority information, and valid state information.
For a detailed description of the barcode reader 300, please refer to the description of the related method steps in the above embodiments.
The embodiment of the invention also provides an electronic device readable storage medium, which comprises: a program which, when run on an electronic device, causes the electronic device to perform all or part of the flow of the method in the above-described embodiments. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a Flash Memory (Flash Memory), a hard disk (HARD DISK DRIVE, abbreviated as HDD), a Solid state disk (Solid-state disk STATE DRIVE, SSD), or the like. The storage medium may also comprise a combination of memories of the kind described above.
In the several embodiments provided in the present application, the disclosed apparatus and method may be implemented in other manners. The apparatus embodiments described above are merely illustrative, for example, of the flowcharts and block diagrams in the figures that illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s).
In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the application. Any modification, equivalent replacement, improvement, etc. which are within the spirit and principle of the present application, should be included in the protection scope of the present application, for those skilled in the art.