Commodity detection method and device, electronic device and storage medium
By obtaining and parsing the barcode data of the products, the product information is automatically detected, which solves the problem of low product detection efficiency on the online supermarket platform and achieves rapid contract fulfillment.
Patent Information
- Application Number
- CN202110493082.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-07
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2041-05-07
AI Technical Summary
In the existing technology, the online supermarket platform has a problem of low efficiency in delivering the goods purchased by users on time in a short period of time. This is mainly because product detection relies on manual labor and the efficiency is low.
By obtaining the barcode data of the goods to be detected, selecting the target barcode rules and parsing them, the product information is obtained, automatic detection is achieved, and manual detection is avoided.
Automatic detection of goods is realized, detection efficiency is improved, contract fulfillment time is shortened, and the problem of low manual detection efficiency in the existing technology is solved.
Smart Images

Figure CN113159727B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of commodity detection, and in particular to a commodity detection method and device, electronic equipment and storage medium. Background Art
[0002] With the development of mobile Internet, the O2O model is becoming more and more popular. People are used to placing orders for fresh products such as vegetables and fruits in online supermarkets. However, the inventors have found that in the existing technology, it is difficult for online supermarket platforms to deliver the purchased products to users on time in a short period of time. The products are mainly inspected manually, which has the problem of low efficiency of product inspection. Summary of the invention
[0003] In view of this, the purpose of the present application is to provide a commodity detection method and device, an electronic device and a storage medium to improve the problems existing in the prior art.
[0004] To achieve the above purpose, the embodiment of the present application adopts the following technical solution:
[0005] In a first aspect, the present invention provides a commodity detection method, comprising:
[0006] Obtain the barcode data of the product to be tested;
[0007] selecting a target barcode rule from at least one preset barcode rule according to the barcode data;
[0008] The barcode data is parsed and processed according to the target barcode rule to obtain the commodity information of the commodity to be detected.
[0009] In an optional implementation, the step of parsing the barcode data according to the target barcode rule to obtain the commodity information of the commodity to be detected includes:
[0010] Segment the barcode data according to the target barcode rule to obtain at least one sub-barcode;
[0011] The information of each sub-barcode is analyzed and processed to obtain the commodity information of the commodity to be detected.
[0012] In an optional embodiment, the commodity detection method further includes:
[0013] Determine whether the product information meets the pre-verification conditions;
[0014] If the product information meets the pre-verification condition, then determine whether the product information meets the preset product requirements;
[0015] If the commodity information does not meet the preset commodity requirements, a picking signal is issued.
[0016] In an optional implementation, the step of selecting a target barcode rule from at least one preset barcode rule according to the barcode data includes:
[0017] Obtaining the length of the barcode data;
[0018] A barcode rule with the same length is selected from at least one preset barcode rule as the target barcode rule.
[0019] In an optional implementation, the step of selecting a target barcode rule from at least one preset barcode rule according to the barcode data includes:
[0020] Obtaining the flag bit of the barcode data;
[0021] A barcode rule with the same flag bit is selected from at least one preset barcode rule as the target barcode rule.
[0022] In an optional implementation, the step of selecting a target barcode rule from at least one preset barcode rule according to the barcode data includes:
[0023] Obtaining a check digit of the barcode data;
[0024] A barcode rule with the same check digit is selected from at least one preset barcode rule as the target barcode rule.
[0025] In an optional implementation, the step of obtaining the check digit of the barcode data includes:
[0026] Obtain all digits of the barcode data except the last digit;
[0027] The summation and remainder processing are performed on all the digits to obtain the check digit.
[0028] In a second aspect, the present invention provides a commodity detection device, comprising:
[0029] A data acquisition module is used to obtain the barcode data of the commodity to be tested;
[0030] A barcode rule selection module, used for selecting a target barcode rule from at least one preset barcode rule according to the barcode data;
[0031] The processing module is used to parse and process the barcode data according to the target barcode rule to obtain the commodity information of the commodity to be detected.
[0032] In a third aspect, the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the commodity detection method described in any one of the aforementioned implementation modes is implemented.
[0033] In a fourth aspect, the present invention provides a storage medium, wherein the storage medium includes a computer program, and when the computer program is executed, the electronic device where the storage medium is located is controlled to execute the commodity detection method described in any one of the aforementioned implementation modes.
[0034] The commodity detection method and device, electronic device and storage medium provided in the embodiments of the present application select target barcode rules according to the barcode data of the commodity to be detected, and parse the barcode data according to the target barcode rules to obtain commodity information, thereby realizing automatic detection of commodities and avoiding the problem of low efficiency of commodity detection in the prior art which requires manual detection of commodities. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A structural block diagram of an electronic device provided in an embodiment of the present application is shown.
[0037] Figure 2 A flowchart of a commodity detection method provided in an embodiment of the present application.
[0038] Figure 3 Another flowchart of the commodity detection method provided in an embodiment of the present application.
[0039] Figure 4 This is a structural block diagram of a commodity detection device provided in an embodiment of the present application.
[0040] Icons: 100 - electronic device; 110 - first memory; 120 - first processor; 130 - communication module; 400 - commodity detection device; 410 - data acquisition module; 420 - barcode rule selection module; 430 - processing module. DETAILED DESCRIPTION
[0041] In order to improve at least one of the above technical problems raised by the present application, the embodiments of the present application provide a commodity detection method and device, an electronic device and a storage medium. The technical solution of the present application is described below through possible implementation methods.
[0042] The defects existing in the above solutions are the results obtained by the inventors after practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed in the embodiments of the present application for the above problems below should all be the contributions made by the inventors in the invention process.
[0043] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0044] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0045] It should be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0046] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0047] It should be noted that, in the absence of conflict, the features in the embodiments of the present application may be combined with each other.
[0048] Please refer to Figure 1 , is a block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 in this embodiment may be a server, a processing device, a processing platform, etc. capable of data interaction and processing. The electronic device 100 includes a first memory 110, a first processor 120, and a communication module 130. The first memory 110, the first processor 120, and the communication module 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0049] The first memory 110 is used to store programs or data. The first memory 110 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0050] The first processor 120 is used to read / write data or programs stored in the first memory 110 and execute corresponding functions. The communication module 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through a network and to send and receive data through the network.
[0051] It should be understood that Figure 1 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0052] Figure 2 A flowchart of a commodity detection method provided in an embodiment of the present application is shown, which can be applied to Figure 1 The electronic device 100 shown comprises Figure 1 It should be understood that in other embodiments, the order of some steps in the commodity detection method of this embodiment can be interchanged according to actual needs, or some steps can be omitted or deleted. Figure 2 The process of the commodity detection method shown is described in detail.
[0053] Step S210, obtaining the barcode data of the commodity to be inspected.
[0054] Step S220: selecting a target barcode rule from at least one preset barcode rule according to the barcode data.
[0055] Step S230, parsing the barcode data according to the target barcode rule to obtain product information of the product to be detected.
[0056] The above method selects the target barcode rule according to the barcode data of the product to be detected, and parses the barcode data according to the target barcode rule to obtain product information, thereby realizing automatic detection of the product and avoiding the problem of low efficiency of product detection by manual detection in the prior art.
[0057] Regarding step S210, it should be noted that the specific method of obtaining the barcode data is not limited and can be set according to actual application requirements. For example, in an alternative example, the user can use the electronic device 100 to photograph the barcode to obtain a barcode image, and perform image recognition processing on the barcode image to obtain the barcode data.
[0058] For step S220, it should be noted that the specific composition of the barcode rule is not limited and can be set according to actual application requirements. For example, in an alternative example, the barcode rule provided in the embodiment of the present application may include:
[0059] identifier (barcode identifier), codeLength (barcode length), scalePriceVerify (whether basic pre-amount verification is required), scaleNumVerify (whether basic pre-weight or quantity verification is required), identifierLocal (identifier position), identifierLength (identifier length), wareCodeLocal (product code position), wareCodeLength (product code length), priceLocal (amount position), priceLength (amount length), priceDecimalPlaces (amount decimal length), numLocal (weight or quantity position), numLength (weight or quantity length), weighDecimalPlaces (scale weight decimal places), countDecimalPlaces (scale quantity decimal places), verifyLocal (check digit position), verifyLength (check digit length), verifyType (verification method), numVerify (whether to perform quantity verification), priceVerify (whether to perform amount verification), etc.
[0060] Optionally, the specific method of selecting the target barcode rule is not limited and can be set according to actual application requirements. For example, in an alternative example, step S220 may include the following sub-steps:
[0061] The length of the barcode data is obtained; and a barcode rule with the same length is selected from at least one preset barcode rule as a target barcode rule.
[0062] In other words, the length of the barcode data can be used to match the barcode rules with the same length as the local configuration. For example, if an 18-digit barcode is scanned, the barcode rule with the local configuration codeLength = 18 digits will be filtered to obtain the target barcode rule.
[0063] For another example, in another alternative example, step S220 may further include the following sub-steps:
[0064] Obtain the flag bit of the barcode data; and select a barcode rule with the same flag bit from at least one preset barcode rule as the target barcode rule.
[0065] That is to say, the [flag bit] can be parsed from the scanned barcode data and matched with at least one preset barcode rule, and the matched barcode rule is used as the target barcode rule. The identifier represents the [specific value of the flag bit] of this barcode rule, the identifierLocal represents the starting position of the [flag bit], and the identifierLength represents the length of the [flag bit]. Generally, the starting position starts from the 1st bit and the length is 1.
[0066] For another example, in another alternative example, step S220 may further include the following sub-steps:
[0067] Obtain the check digit of the barcode data; and select a barcode rule with the same check digit from at least one preset barcode rule as the target barcode rule.
[0068] The specific method of obtaining the check digit is not limited and can be set according to actual application requirements. For example, in an alternative example, the step of obtaining the check digit of the barcode data may include the following sub-steps:
[0069] Get all the digits of the barcode data except the last digit; perform sum processing and remainder processing on all the digits to obtain the check digit.
[0070] In other words, the check digit is calculated by an algorithm. The general algorithm is: all digits except the last digit are summed according to the odd and even digits, then the sum of the odd or even digits is multiplied by 3 and added, and then the remainder is taken when it is greater than 0, then the remainder is subtracted from 10 to get the check digit.
[0071] Specifically, the [check digit] can be parsed from the scanned barcode data and matched with at least one preset barcode rule, and the matched barcode rule is used as the target barcode rule. verifyLocal indicates the starting position of the [check digit], and verifyLength indicates the length of the [check digit]. Generally, the [check digit] is the last digit and has a length of 1.
[0072] It should be noted that the target barcode rule may be selected from at least one preset barcode rule according to one of the above three sub-steps, or at least one barcode rule may be screened three times according to the above three sub-steps to obtain the target barcode rule.
[0073] That is to say, first match the barcode rule with the same length as the local configuration according to the length of the barcode data, then parse the [flag bit] from the barcode data to match it with the barcode rule with the same length, and finally parse the [check bit] from the barcode data to match it with the barcode rule that matches the flag bit, and use the matched barcode rule as the target barcode rule.
[0074] Regarding step S230, it should be noted that the specific method of performing the parsing process is not limited and can be set according to actual application requirements. For example, in an alternative example, step S230 may include the following sub-steps:
[0075] The barcode data is segmented according to the target barcode rule to obtain at least one sub-barcode; the information of each sub-barcode is analyzed and processed to obtain the commodity information of the commodity to be detected.
[0076] Optionally, the specific type of commodity information is not limited and can be set according to actual application requirements. For example, commodity information may include, but is not limited to, commodity barcode, weight or quantity, commodity amount and other information.
[0077] Specifically, the product barcode can be parsed from the scanned barcode according to the target barcode rule. wareCodeLocal indicates the starting position of the product barcode, and wareCodeLength indicates the length of the product barcode. Generally, the starting position is from the second position, and the length is 6, which corresponds to the material code of the product.
[0078] The [weight] or [quantity] information can be parsed from the scanned barcode according to the target barcode rules. For bulk goods (goods sold in bulk that need to be weighed, such as rice) and fresh standard products (fresh goods customized by merchants, sold as standard products), the weight is used, and for fresh count goods (fresh goods customized by merchants, sold by quantity), the quantity is used. numLocal indicates the starting position, numLength indicates the corresponding length, weighDecimalPlaces indicates the weight coefficient, and countDecimalPlaces indicates the quantity coefficient. Generally, the starting position starts from the 8th position, the length is 5, the weight unit is g, the weight coefficient is 3, and the multiple is 1000. The quantity coefficient is generally 0 or 3, that is, 1 times or 1000 times.
[0079] The [commodity amount] can be parsed from the scanned barcode according to the barcode rules. priceLocal indicates the starting position of the [commodity amount], priceLength indicates the length of the [commodity amount], and priceDecimalPlaces indicates the coefficient of the [commodity amount]. Generally, the starting position starts from the 13th digit, the length is 5, the amount unit is cents, the amount coefficient here is 3, and the multiple is 1000.
[0080] The information parsed from the barcode data is stored in PLUParseResult, and the fields below represent different information: itemNum, matnr, and recoveryCode are all product barcodes; warePrice is the product amount; priceTimes is the amount coefficient; weightOrNum is the weight or quantity, which is the weight for loose and fresh standard products, and the quantity for fresh count products, and the quantity can only be 1; weightTimes is the weight coefficient; wareWeight is the product weight, converted from weightOrNum, and is only used for loose and fresh standard products; numberTimes is the quantity coefficient; pickNum is the product quantity, converted from weightOrNum, and is only used for fresh count products.
[0081] Furthermore, after step S230, the commodity detection method provided in the embodiment of the present application may further include the following steps:
[0082] Determine whether the product information meets the pre-verification conditions; if the product information meets the pre-verification conditions, determine whether the product information meets the preset product requirements; if the product information does not meet the preset product requirements, send a picking signal.
[0083] In detail, you can determine whether you need to perform a pre-verification of [weight], [quantity], or [amount] from the target barcode rules matched in the above steps. scaleNumVerify = 1 indicates that a basic pre-verification of weight or quantity is required; scalePriceVerify = 1 indicates that a basic pre-verification of amount is required.
[0084] Basic weight (quantity) pre-check: weightMin is the minimum weight (quantity) value configured by the store. weightMax is the maximum weight (quantity) value configured by the store. weightOrNum is the weight (quantity) value parsed from the barcode. The check logic is to compare weightOrNum with weightMin and weightMax. It is required that weightOrNum is greater than or equal to weightMin and less than or equal to weightMax. If weightMinCondition=3, it is greater than, otherwise it is greater than or equal to. If weightMaxCondition=1, it is less than, otherwise it is less than or equal to.
[0085] Basic amount pre-check: warePrice is the product amount information parsed from the barcode. priceMin is the minimum amount information configured by the store. priceMax is the maximum amount information configured by the store. The verification logic is to compare the size of warePrice with priceMin and priceMax. It is required that warePrice is greater than or greater than or equal to priceMin and warePrice is less than or less than or equal to priceMax. If priceMinCondition=3, it is greater than, otherwise it is greater than or equal to. If priceMaxCondition=1, it is less than, otherwise it is less than or equal to.
[0086] When the product information meets the pre-check conditions, products with the same [product barcode] can be filtered out from all products in the current batch. The salesCode field under the extendFields on the product is used to separate multiple product barcodes to support multiple countries' barcodes for one product (EAN13 barcode of the product). As long as there is a same [product barcode], it means that the same product is matched. If the salesCode does not match the product, the matnr and itemNum on the product are used to match the product barcode again.
[0087] Furthermore, it is possible to determine whether the product information meets the preset product requirements, so as to filter out the unfilled products from the matched products. The ofcWareItemNums under the extendFields on the product represents the product quantity coefficient. There is a situation where the number of products corresponding to the scanned barcode is greater than 1. This is a boxed product (for example, if you buy a box of milk with 12 bottles, the barcode on the box represents 1x12, and scanning the barcode on the box means picking 12 bottles at a time).
[0088] For fresh counting products, the barcode configuration numVerify will be used to determine whether to verify the quantity. If verification is required, the verification quantity must be 1. For both bulk sales and fresh standard products, the barcode configuration numVerify will be used to determine whether to verify the weight, and then check whether the basic information is correct. The main logic for judging bulk sales products is to determine whether the total scanned weight of the current product is equal to or greater than the weight to be picked (quantity of goods purchased x weight of goods). The reason why it is allowed to be greater than is because it is difficult to find a barcode with a strictly equal weight offline for bulk sales products, but if the weight exceeds the purchase weight by too much, it will cause the merchant to suffer too much loss. Therefore, there is a weightLimitRatio field on the product that represents the upper weight threshold (percentage), which cannot be exceeded. The main logic for verifying fresh standard products is to determine whether the weight of the current barcode satisfies the following conditions: lower weight <= barcode weight <= upper weight. For fresh standard products, the weight may fluctuate within a certain range, so there is both an upper limit and a lower limit. The weightLimitRatio field on the product represents the upper weight threshold (percentage), and the weightLowerLimitRatio field represents the lower weight threshold (percentage).
[0089] For loose sales, fresh food count products, and fresh food standard products, priceVerify will be used to determine whether the amount should be verified, and then the basic information will be checked to see if it is correct. Finally, the amount will be verified. The main logic of the amount verification is: divide the amount of the product on the barcode by the weight or quantity of the product on the barcode (the weight for loose sales and fresh food standard products, and the quantity for fresh food counts) to get the unit price, then subtract the retailPrice on the product from this unit price to calculate the premium, and then divide the premium by the retailPrice to calculate the premium percentage. If it does not exceed the premiumThreshold configured by the store, the verification passes.
[0090] When all the above checks are passed, the final quantity and weight check will be performed. For bulk goods, as long as the weight is met, it will be fine. For example, if a user buys 500gx3, then in the end, he only needs to pick up 1500g, which can be 3 500g barcodes or 5 300g barcodes. For standard products, fresh standard products, and fresh counting products, one barcode is counted as one picking quantity. As long as the previous checks are passed, the final comparison of the picking quantity and the purchase quantity is the same.
[0091] Through the above method, the embodiment of the present application dynamically configures the product barcode parsing rules and sends the parsing rules to the App. After the picker scans the barcode, the App parses the product barcode, weight, quantity, and amount information according to the barcode parsing rules for matching, thereby achieving fast picking and shortening the fulfillment time. The specific process is as follows Figure 3As shown, first pull the barcode configuration, scan the product barcode or scale code, and determine whether it matches the configuration with the same barcode length. If so, parse the flag bit and check bit and perform verification. If so, parse the product barcode, weight, quantity and amount information. When there is no configuration with the same barcode length, you can directly parse the product barcode. Then, you can check whether the weight, quantity, and amount meet the lower and upper limits of the store. If so, determine whether the product barcode can match the product. If so, check the product quantity, weight, and amount, and perform the total purchase weight verification and the total purchase quantity verification. If all the verifications pass, the picking is completed. If the verified weight, quantity, and amount do not meet the lower and upper limits of the store, or the product cannot be matched according to the product barcode, or the subsequent verification fails, the picking fails.
[0092] Combination Figure 4 The embodiment of the present application further provides a commodity detection device 400, and the functions implemented by the commodity detection device 400 correspond to the steps performed by the above method. The commodity detection device 400 can be understood as the processor of the above electronic device 100, or can be understood as a component independent of the above electronic device 100 or the processor that implements the functions of the present application under the control of the electronic device 100. The commodity detection device 400 may include a data acquisition module 410, a barcode rule selection module 420, and a processing module 430.
[0093] The data acquisition module 410 is used to acquire the barcode data of the commodity to be detected. In the embodiment of the present application, the data acquisition module 410 can be used to execute Figure 2 As shown in step S210, the relevant contents of the data acquisition module 410 can refer to the above description of step S210.
[0094] The barcode rule selection module 420 is used to select a target barcode rule from at least one preset barcode rule according to the barcode data. In the embodiment of the present application, the barcode rule selection module 420 can be used to execute Figure 2 As shown in step S220, the relevant contents of the barcode rule selection module 420 can refer to the above description of step S220.
[0095] The processing module 430 is used to parse the barcode data according to the target barcode rules to obtain the commodity information of the commodity to be detected. Figure 2 As shown in step S230, the relevant contents of the processing module 430 can refer to the above description of step S230.
[0096] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned commodity detection method are executed.
[0097] The computer program product of the commodity detection method provided in the embodiment of the present application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the commodity detection method in the above method embodiment. For details, please refer to the above method embodiment, which will not be repeated here.
[0098] In summary, the commodity detection method and device, electronic device and storage medium provided in the embodiments of the present application select target barcode rules according to the barcode data of the commodity to be detected, and parse the barcode data according to the target barcode rules to obtain commodity information, thereby realizing automatic detection of commodities and avoiding the problem of low efficiency of commodity detection in the prior art which is performed by manual detection of commodities.
[0099] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0100] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0101] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0102] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0103] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A commodity detection method, characterized in that: include: Obtain the barcode data of the product to be tested; Selecting a target barcode rule from at least one preset barcode rule according to the barcode data includes: obtaining the length of the barcode data, selecting a barcode rule with the same length from at least one preset barcode rule as a first target barcode rule; obtaining a flag bit of the barcode data, selecting a barcode rule with the same flag bit from the first target barcode rule as a second target barcode rule; obtaining a check bit of the barcode data, selecting a barcode rule with the same check bit from the second target barcode rule as a target barcode rule; The barcode data is parsed and processed according to the target barcode rule to obtain the commodity information of the commodity to be detected, including: Segment the barcode data according to the target barcode rule to obtain at least one sub-barcode; Analyze and process the information of each sub-barcode to obtain the commodity information of the commodity to be detected, wherein the commodity information includes the commodity barcode, weight or quantity and commodity amount; wherein the weight or quantity is the weight for bulk commodities and fresh standard commodities, and is the quantity for fresh count commodities; Determine whether it is necessary to perform a pre-verification on the weight or quantity and / or the commodity amount; If a pre-verification of the weight or quantity and / or the commodity amount is required, determining whether the weight or quantity and / or the commodity amount meets the pre-verification conditions; If the weight or quantity and / or the commodity amount meets the pre-verification condition, the first commodity with the same commodity barcode is filtered out from all commodities in the current batch; Determining whether the weight or quantity and / or the commodity amount meets the preset commodity requirements; If the commodity information does not meet the preset commodity requirements, the unpicked commodities are filtered out from the first commodities, and a picking signal is issued.
2. The commodity detection method according to claim 1, characterized in that: The step of obtaining the check digit of the barcode data comprises: Obtain all digits of the barcode data except the last digit; The summation and remainder processing are performed on all the digits to obtain the check digit.
3. A commodity detection device, characterized in that: include: A data acquisition module is used to obtain the barcode data of the commodity to be tested; A barcode rule selection module, used for selecting a target barcode rule from at least one preset barcode rule according to the barcode data; The processing module is used to parse and process the barcode data according to the target barcode rule to obtain the commodity information of the commodity to be detected, including: Segment the barcode data according to the target barcode rule to obtain at least one sub-barcode; Analyze and process the information of each sub-barcode to obtain the commodity information of the commodity to be detected, wherein the commodity information includes the commodity barcode, weight or quantity and commodity amount; wherein the weight or quantity is the weight for bulk commodities and fresh standard commodities, and is the quantity for fresh count commodities; Determine whether it is necessary to perform a pre-verification on the weight or quantity and / or the commodity amount; If a pre-verification of the weight or quantity and / or the commodity amount is required, determining whether the weight or quantity and / or the commodity amount meets the pre-verification conditions; If the weight or quantity and / or the commodity amount meets the pre-verification condition, the first commodity with the same commodity barcode is filtered out from all commodities in the current batch; Determining whether the weight or quantity and / or the commodity amount meets the preset commodity requirements; If the commodity information does not meet the preset commodity requirements, the unpicked commodities are filtered out from the first commodities, and a picking signal is issued.
4. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the commodity detection method according to any one of claims 1 or 2 when executing the program.
5. A storage medium, characterized in that: The storage medium includes a computer program, and when the computer program is executed, the electronic device where the storage medium is located is controlled to execute the commodity detection method according to any one of claims 1 or 2.
