Automated testing method and system, testing equipment and computer-readable storage medium
Through the automated testing method, the camera module and image recognition algorithm are used to analyze the light image of the scanning engine, which solves the problems of test deviation and low efficiency caused by subjective judgment in the existing technology, and achieves more accurate and efficient test results.
Patent Information
- Application Number
- CN202110408178.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-04-15
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-04-15
AI Technical Summary
Existing code scanning engine testing methods rely on subjective judgment, which suffers from testing bias and low efficiency.
Adopt automated testing methods, select the test type through the host computer tool, use the camera module to collect the light image of the scanning engine fill light or aiming light, and combine it with the image recognition algorithm to analyze the spot coverage and uniformity to determine whether the test effect reaches the set target , and report the results.
Effectively eliminate subjective factors, improve the accuracy and efficiency of test results, reduce errors, and improve the automation and accuracy of testing.
Smart Images

Figure CN114279679B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of testing, and in particular to an automated testing method and system, testing equipment and a computer-readable storage medium. Background Art
[0002] At present, in the production of barcode scanning engines and the testing of barcode scanning engine modules at the factory end, the test personnel generally observe the shape and effect of the test spot, subjectively judge the effect, and output the result. Another test method is to draw a fill light spot on a white cardboard at a fixed distance and aim at the shape of the spot (or area) to further help enhance the accuracy of the effect judgment. However, the judgment of the effect still depends on the subjective judgment of the test personnel. Due to the interference of subjective factors, it is very likely to cause test deviation or even error, and the test efficiency is low. Summary of the invention
[0003] In view of this, an object of the present invention is to provide an automated testing method and system, a testing device and a computer-readable storage medium, which can eliminate the interference of subjective factors, improve the accuracy of test results, and improve test efficiency.
[0004] The present invention proposes an automated testing method, which is applied to testing a code scanning engine, wherein the automated testing method comprises:
[0005] Click and select the fill light test through the tool on the host computer;
[0006] Turning on the fill light of the code scanning engine;
[0007] The camera module is used to collect the light image seen when the light of the fill light is reflected on the test panel;
[0008] Determining whether the fill light effect reaches a set target according to the light image;
[0009] The determination result is reported to the host computer.
[0010] Preferably, the step of determining whether the fill light effect reaches a set target according to the light image comprises:
[0011] An image recognition algorithm is used to analyze and calculate whether the fill light spot in the light image covers the camera objective range, and at the same time calculate the uniformity and brightness of the fill light spot within the camera objective range, and determine whether the fill light effect reaches the set target based on the calculation results.
[0012] On the other hand, the present invention also provides an automated testing method, which is applied to testing a code scanning engine, wherein the automated testing method comprises:
[0013] Click and select aiming test through the tool on the host computer;
[0014] Turning on the aiming light of the code scanning engine;
[0015] The aiming light spot pattern seen when the light of the aiming light is reflected back from the test panel is collected by a camera module;
[0016] Determining whether the aiming effect reaches the set target according to the aiming light spot pattern;
[0017] The determination result is reported to the host computer.
[0018] Preferably, the step of determining whether the aiming effect reaches a set target according to the aiming light spot pattern comprises:
[0019] The spot position and size are extracted from the collected aiming spot pattern, and compared with the preset spot position and size, and whether the aiming effect reaches the set target is determined based on the comparison result.
[0020] On the other hand, the present invention further provides an automated testing system, wherein the automated testing system comprises a host computer, a code scanning engine, a test mainboard and a test panel, wherein the fill light test is selected by the host computer, the test mainboard controls the fill light of the code scanning engine to be turned on, and the test mainboard is used for:
[0021] The camera module is used to collect the light image seen when the light of the fill light is reflected on the test panel;
[0022] Determining whether the fill light effect reaches a set target according to the light image; and
[0023] The determination result is reported to the host computer.
[0024] Preferably, the test mainboard is also used to: use an image recognition algorithm to analyze and calculate whether the fill light spot in the light image covers the camera objective range, and at the same time calculate the uniformity and brightness of the fill light spot within the camera objective range, and determine whether the fill light effect reaches the set target based on the calculation results.
[0025] On the other hand, the present invention further provides an automated testing system, wherein the automated testing system comprises a host computer, a code scanning engine, a test mainboard and a test panel, wherein the aiming test is selected by the host computer, the test mainboard controls the aiming light of the code scanning engine to be turned on, and the test mainboard is used to:
[0026] The aiming light spot pattern seen when the light of the aiming light is reflected on the test panel is collected by a camera module;
[0027] Determining whether the aiming effect reaches the set target according to the aiming light spot pattern; and
[0028] The determination result is reported to the host computer.
[0029] Preferably, the test mainboard is also used to extract the spot position and size from the collected aiming spot pattern, and compare them with the preset spot position and size, and determine whether the aiming effect reaches the set target based on the comparison result.
[0030] On the other hand, the present invention further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the automated testing method as described above are implemented.
[0031] On the other hand, the present invention further provides a testing device, wherein the testing device comprises a memory and a processor, the memory stores computer processing instructions, and the processor executes the above-mentioned automated testing method by calling the computer processing instructions.
[0032] The technical solution provided by the present invention has the following advantages: it can eliminate the interference of subjective factors, improve the accuracy of test results, and improve test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A schematic diagram of a flow chart of an automated testing method in one embodiment of the present invention;
[0034] Figure 2 A schematic diagram of a flow chart of an automated testing method in another embodiment of the present invention;
[0035] Figure 3 It is a schematic diagram of the structure of an automated testing system in one embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0037] An automated testing method provided by the present invention is described in detail below.
[0038] See also Figure 1 , is a flow chart of an automated testing method in one embodiment of the present invention.
[0039] In this embodiment, the automated testing method is applied to test a code scanning engine, wherein the code scanning engine, a host computer, a test mainboard, and a test panel together constitute an automated testing system.
[0040] In step S11, click and select the fill light test through the tool on the host computer.
[0041] In this implementation, the fill light test can be selected on the host computer by clicking and selecting on the tool on the host computer.
[0042] In step S12, the fill light of the code scanning engine is turned on.
[0043] In this embodiment, the test mainboard is connected to the code scanning engine for communication, and the test mainboard controls the fill light of the code scanning engine to turn on.
[0044] In step S13, the camera module collects the light image seen when the light of the fill light is reflected on the test panel.
[0045] In this embodiment, the test mainboard collects the light image seen when the light of the fill light is reflected on the test panel through the camera module.
[0046] In step S14, it is determined whether the fill light effect reaches a set target according to the light image.
[0047] In this embodiment, the step S4 of determining whether the fill light effect reaches the set target according to the light image includes:
[0048] An image recognition algorithm is used to analyze and calculate whether the fill light spot in the light image covers the camera objective range, and at the same time calculate the uniformity and brightness of the fill light spot within the camera objective range, and determine whether the fill light effect reaches the set target based on the calculation results.
[0049] In this embodiment, the test mainboard uses an image recognition algorithm to analyze and calculate whether the fill light spot in the light image covers the camera objective range, and calculates the uniformity and brightness of the fill light spot within the camera objective range, and determines whether the fill light effect reaches the set target based on the calculation results. In this embodiment, if the fill light spot in the light image is calculated to cover the camera objective range, and the uniformity and brightness of the fill light spot within the camera objective range meet the preset requirements, then it is determined that the fill light effect has reached the set target; otherwise, as long as the fill light spot in the light image is calculated to not cover the camera objective range, or any of the uniformity and brightness of the fill light spot within the camera objective range does not meet the preset requirements, then it is determined that the fill light effect has not reached the set target.
[0050] In step S15, the determination result is reported to the host computer.
[0051] In this embodiment, the test mainboard is connected to the host computer for mutual communication, and the test mainboard reports the determination result to the host computer. In this embodiment, the test mainboard also collects the light image reflected by the fill light on the test panel and uploads it to the host computer system for subsequent tracing.
[0052] See also Figure 2 , is a flow chart of an automated testing method in another embodiment of the present invention.
[0053] In this embodiment, the automated testing method is applied to test a code scanning engine, wherein the code scanning engine, a host computer, a test mainboard, and a test panel together constitute an automated testing system.
[0054] In step S21, click and select the aiming test through the tool on the host computer.
[0055] In this embodiment, the aiming test can be selected on the host computer by clicking and selecting on the tool on the host computer.
[0056] In step S22, the aiming light of the code scanning engine is turned on.
[0057] In this embodiment, the test mainboard and the code scanning engine are connected to each other for communication, and the test mainboard controls the aiming light of the code scanning engine to be turned on.
[0058] In step S23, the aiming light spot pattern seen when the light of the aiming light is reflected on the test panel is collected by the camera module.
[0059] In this embodiment, the test mainboard collects the aiming light spot pattern seen when the light of the aiming light is reflected on the test panel through the camera module.
[0060] In step S24, it is determined whether the aiming effect reaches the set target according to the aiming light spot pattern.
[0061] In this embodiment, the step S24 of determining whether the aiming effect reaches the set target according to the aiming light spot pattern includes:
[0062] The spot position and size are extracted from the collected aiming spot pattern, and compared with the preset spot position and size, and whether the aiming effect reaches the set target is determined based on the comparison result.
[0063] In this embodiment, the test mainboard uses system software to extract the spot position and size from the collected aiming spot pattern, and compares them with the preset spot position and size, and determines whether the aiming effect reaches the set target according to the comparison result. In this embodiment, if any one of the two parameters of the spot position and the spot size does not reach the preset setting target, it is determined that the aiming effect does not reach the setting target; if both the two parameters of the spot position and the spot size reach the preset setting target, it is determined that the aiming effect reaches the setting target.
[0064] In step S25, the determination result is reported to the host computer.
[0065] In this embodiment, the test mainboard is connected to the host computer for mutual communication, and the test mainboard reports the determination result to the host computer. In this embodiment, the test mainboard also collects the aiming light spot pattern seen when the light of the aiming light is reflected on the test panel and uploads it to the host computer system for subsequent tracing.
[0066] See also Figure 3 , is a schematic diagram of the structure of an automated testing system in one embodiment of the present invention.
[0067] In this embodiment, the automated test system 10 includes a host computer 11, a code scanning engine 12, a test mainboard 13 and a test panel 14, wherein the code scanning engine 12, the test mainboard 13 and the test panel 14 are arranged in a test environment box 16. This design avoids the interference of external ambient light and can improve the accuracy of the test. A fill light source 15 is hung at the top of the interior of the test environment box 16, and two fixed brackets 17 are arranged at the bottom of the interior of the test environment box 16. The two fixed brackets 17 are respectively used to fix and support the code scanning engine 12 and the test mainboard 13. A movable bracket is also arranged at the bottom of the interior of the test environment box 16. The movable bracket 18 is used to support the test panel 14. The test panel 14 can move back and forth at the bottom of the test environment box 16 together with the movable bracket 18. A scaled track groove 19 is also provided between the fixed bracket 17 and the movable bracket 18. The scaled track groove 19 can be used to intuitively display the distance between the code scanning engine 12 and the test panel 14. The principle of setting the distance is the best code scanning distance defined by the product, or the appropriate distance can be calculated according to the camera FOV, fill light FOV and aiming spot FOV of the code scanning engine 12. The scaled track groove 19 is close to the bottom of the test environment box 16. In this embodiment, the host computer 11 is, for example, a PC terminal of the factory.
[0068] In this embodiment, the operator selects the fill light test through the host computer 11 , and the test mainboard 13 controls the fill light of the code scanning engine 12 to turn on.
[0069] In this embodiment, the fill light test can be selected on the host computer 11, specifically by clicking and selecting on the tool on the host computer 11. In this embodiment, the test mainboard 13 and the code scanning engine 12 are connected to each other in communication, and the test mainboard 13 controls the fill light of the code scanning engine 12 to turn on.
[0070] In this embodiment, the test mainboard 13 is used for:
[0071] The camera module is used to collect the light image seen when the light of the fill light is reflected on the test panel;
[0072] Determining whether the fill light effect reaches a set target according to the light image; and
[0073] The determination result is reported to the host computer.
[0074] In this embodiment, the test mainboard 13 is also used to: use an image recognition algorithm to analyze and calculate whether the fill light spot in the light image covers the camera objective range, and at the same time calculate the uniformity and brightness of the fill light spot within the camera objective range, and determine whether the fill light effect reaches the set target based on the calculation results.
[0075] In this embodiment, the test mainboard 13 uses an image recognition algorithm to analyze and calculate whether the fill light spot in the light image covers the camera objective range, and calculates the uniformity and brightness of the fill light spot within the camera objective range, and determines whether the fill light effect reaches the set target based on the calculation results. In this embodiment, if it is calculated that the fill light spot in the light image covers the camera objective range, and the uniformity and brightness of the fill light spot within the camera objective range meet the preset requirements, then it is determined that the fill light effect reaches the set target; otherwise, as long as it is calculated that the fill light spot in the light image does not cover the camera objective range, or any of the uniformity and brightness of the fill light spot within the camera objective range does not meet the preset requirements, then it is determined that the fill light effect does not reach the set target.
[0076] In this embodiment, the test mainboard 13 and the host computer 11 are connected to communicate with each other, and the test mainboard 13 reports the determination result to the host computer 11. In this embodiment, the test mainboard 13 also collects the light image seen when the light of the fill light is reflected on the test panel and uploads it to the host computer system for subsequent tracing. For example, the test mainboard 13 can upload the light image seen when the light of the fill light is reflected on the test panel and the determination result to the PC-side factory test system through a USB interface or a UART interface for easy tracing.
[0077] In another embodiment, the automated testing system 10 includes a host computer 11, a code scanning engine 12, a test mainboard 13 and a test panel 14, wherein the code scanning engine 12, the test mainboard 13 and the test panel 14 are arranged in a test environment box 16. This design avoids the interference of external ambient light and can improve the accuracy of the test. A fill light source 15 is hung at the top of the interior of the test environment box 16, and two fixed brackets 17 are arranged at the bottom of the interior of the test environment box 16. The two fixed brackets 17 are respectively used to fix and support the code scanning engine 12 and the test mainboard 13. A movable The bracket 18 is used to support the test panel 14. The test panel 14 can move back and forth at the bottom of the test environment box 16 together with the movable bracket 18. A scaled track groove 19 is also provided between the fixed bracket 17 and the movable bracket 18. The scaled track groove 19 can be used to intuitively display the distance between the code scanning engine 12 and the test panel 14. The principle of setting the distance is the best code scanning distance defined by the product, or the appropriate distance can be calculated according to the camera FOV, fill light FOV and aiming spot FOV of the code scanning engine 12. The scaled track groove 19 is close to the bottom of the test environment box 16. In this embodiment, the host computer 11 is, for example, a PC terminal of the factory.
[0078] In another embodiment, the operator selects the aiming test through the host computer 11, and the test mainboard 13 controls the aiming light of the code scanning engine 12 to be turned on. In another embodiment, the aiming test can be selected on the host computer 11, specifically by clicking and selecting on the tool on the host computer 11. In another embodiment, the test mainboard 13 and the code scanning engine 12 are connected to each other in communication, and the test mainboard 13 controls the aiming light of the code scanning engine 12 to be turned on.
[0079] In another embodiment, the test motherboard 13 is used for:
[0080] The aiming light spot pattern seen when the light of the aiming light is reflected on the test panel is collected by a camera module;
[0081] Determining whether the aiming effect reaches the set target according to the aiming light spot pattern; and
[0082] The determination result is reported to the host computer.
[0083] In another embodiment, the test mainboard 13 is further used to extract the spot position and size from the collected aiming spot pattern, and compare them with the preset spot position and size, and determine whether the aiming effect reaches the set target according to the comparison result.
[0084] In another embodiment, the test mainboard 13 uses system software to extract the spot position and size from the collected aiming spot pattern, and compares them with the preset spot position and size, and determines whether the aiming effect reaches the set target according to the comparison result. In another embodiment, if any one of the two parameters of the spot position and the spot size does not reach the preset set target, it is determined that the aiming effect does not reach the set target; if both the two parameters of the spot position and the spot size reach the preset set target, it is determined that the aiming effect reaches the set target.
[0085] In another embodiment, the test mainboard 13 and the host computer 11 are connected to each other for communication, and the test mainboard 13 reports the determination result to the host computer 11. In this embodiment, the test mainboard 13 also collects the aiming light spot pattern seen when the light of the aiming light is reflected on the test panel 14 and uploads it to the host computer system for subsequent tracing. For example, the test mainboard 13 can upload the aiming light spot pattern seen when the light of the aiming light is reflected on the test panel 14 and the determination result to the PC-side factory test system through a USB interface or a UART interface for easy tracing.
[0086] On the other hand, the present invention further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the automated testing method as described above are implemented.
[0087] On the other hand, the present invention further provides a testing device, wherein the testing device comprises a memory and a processor, the memory stores computer processing instructions, and the processor executes the above-mentioned automated testing method by calling the computer processing instructions.
[0088] The technical solution provided by the present invention has the following advantages: it can eliminate the interference of subjective factors, improve the accuracy of test results, and improve test efficiency.
[0089] It is worth noting that in the above embodiments, the various units included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0090] In addition, a person skilled in the art can understand that all or part of the steps in the above-mentioned embodiments can be completed by instructing the relevant hardware through a program, and the corresponding program can be stored in a computer-readable storage medium, such as a ROM / RAM, a disk or an optical disk.
[0091] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. An automated testing method, applied to testing a code scanning engine, characterized in that: The automated testing method comprises: Click and select the fill light test through the tool on the host computer; Turning on the fill light of the code scanning engine; The camera module is used to collect the light image seen when the light of the fill light is reflected on the test panel; Determining whether the fill light effect reaches a set target according to the light image; The determination result is reported to the host computer.
2. The automated testing method according to claim 1, wherein: The step of determining whether the fill light effect reaches the set target according to the light image comprises: An image recognition algorithm is used to analyze and calculate whether the fill light spot in the light image covers the camera objective range, and at the same time, the uniformity and brightness of the fill light spot within the camera objective range are calculated, and whether the fill light effect reaches the set target is determined according to the calculation results; the determination of whether the fill light effect reaches the set target according to the calculation results refers to: If the fill light spot calculated in the light image covers the camera objective range, and the calculated uniformity and brightness of the fill light spot within the camera objective range meet the preset requirements, then it is determined that the fill light effect has reached the set target; otherwise, as long as the fill light spot calculated in the light image does not cover the camera objective range, or the calculated uniformity and brightness of the fill light spot within the camera objective range do not meet the preset requirements, then it is determined that the fill light effect has not reached the set target.
3. An automated testing method, applied to testing a code scanning engine, characterized in that: The automated testing method comprises: Click and select aiming test through the tool on the host computer; Turning on the aiming light of the code scanning engine; The aiming light spot pattern seen when the light of the aiming light is reflected back from the test panel is collected by a camera module; Determining whether the aiming effect reaches the set target according to the aiming light spot pattern; The determination result is reported to the host computer.
4. The automated testing method according to claim 3, wherein: The step of determining whether the aiming effect reaches the set target according to the aiming light spot pattern comprises: Extracting the spot position and size from the collected aiming spot pattern, and comparing them with the preset spot position and size, and judging whether the aiming effect reaches the set target according to the comparison result, wherein judging whether the aiming effect reaches the set target according to the comparison result means: If any one of the two parameters, the spot position and the spot size, does not reach the preset target, it is determined that the aiming effect does not reach the set target; if both the two parameters, the spot position and the spot size, reach the preset target, it is determined that the aiming effect reaches the set target.
5. An automated testing system, characterized in that: The automated test system includes a host computer, a code scanning engine, a test mainboard, and a test panel, wherein the fill light test is selected by the host computer, and the test mainboard controls the fill light of the code scanning engine to be turned on, and the test mainboard is used for: The camera module is used to collect the light image seen when the light of the fill light is reflected on the test panel; Determining whether the fill light effect reaches a set target according to the light image; and The determination result is reported to the host computer.
6. The automated testing system according to claim 5, wherein: The test mainboard is also used to: use an image recognition algorithm to analyze and calculate whether the fill light spot in the light image covers the camera objective range, and calculate the uniformity and brightness of the fill light spot within the camera objective range, and determine whether the fill light effect reaches the set target according to the calculation results; the determination of whether the fill light effect reaches the set target according to the calculation results refers to: If the fill light spot calculated in the light image covers the camera objective range, and the uniformity and brightness of the fill light spot within the camera objective range meet the preset requirements, it is determined that the fill light effect has reached the set target; Otherwise, as long as the calculated fill light spot in the light image does not cover the camera objective range, or the calculated uniformity and brightness of the fill light spot within the camera objective range do not meet the preset requirements, it is determined that the fill light effect does not meet the set target.
7. An automated testing system, characterized in that: The automated testing system includes a host computer, a code scanning engine, a test mainboard, and a test panel, wherein the host computer selects the aiming test, the test mainboard controls the aiming light of the code scanning engine to be turned on, and the test mainboard is used to: The aiming light spot pattern seen when the light of the aiming light is reflected on the test panel is collected by a camera module; Determining whether the aiming effect reaches the set target according to the aiming light spot pattern; and The determination result is reported to the host computer.
8. The automated testing system according to claim 7, wherein: The test mainboard is also used to extract the spot position and size from the collected aiming spot pattern, and compare them with the preset spot position and size, and determine whether the aiming effect reaches the set target according to the comparison result. Determining whether the aiming effect reaches the set target according to the comparison result means: If any one of the two parameters, the spot position and the spot size, does not reach the preset target, it is determined that the aiming effect does not reach the set target; if both the two parameters, the spot position and the spot size, reach the preset target, it is determined that the aiming effect reaches the set target.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the automated testing method according to any one of claims 1 to 4 are implemented.
10. A testing device, characterized in that: The testing device comprises a memory and a processor, wherein the memory stores computer processing instructions, and the processor executes the automated testing method according to any one of claims 1 to 4 by calling the computer processing instructions.
