Test method and test system of code reader

By controlling the drive device, the code reader reads the code on the test barcode board, and judges the successful startup through the code reading time interval, the problems of high cost and low accuracy caused by relying on manual manual operations in the prior art are solved, and a fast and reliable code reader test is achieved.

CN119667353APending Publication Date: 2025-03-21SHENZHEN YANXIANG JINMA SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411993631.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

In the prior art, the start and shutdown process of industrial fixed code readers relies on manual manual operations, resulting in repetitive manual operations increasing labor costs and may cause fatigue, thereby increasing the risk of deviations in the test process or inaccurate results.

Method used

By controlling the drive device connected to the code reader driver to be tested to operate in a preset direction, the code reader to be tested is far away or close to the test barcode board, and the barcode on the test barcode board is read, the code reading time interval between the adjacent two code reading moments is obtained, and it is matched with the preset time interval threshold range to determine whether the code reader to be tested is turned on successfully.

Benefits of technology

It realizes fast and reliable testing of the code reader, automatically powering up and judging the completion of each power-off process, reducing labor costs and improving testing accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119667353A_ABST
    Figure CN119667353A_ABST
Patent Text Reader

Abstract

The invention provides a code reader testing method and system, and relates to the technical field of test.The code reader testing method comprises the steps that a driving device connected with a to-be-tested code reader in a driving mode is controlled to drive the to-be-tested code reader to operate in the preset direction, so that the to-be-tested code reader is far away from or close to a testing bar code plate; the bar code on the test bar code plate is read; obtaining a code reading time interval between two adjacent code reading moments of the to-be-tested code reader; and matching the code reading time interval with a preset time interval threshold range, and determining whether the to-be-tested code reader is successfully started or not according to a matching result. According to the invention, the code reader can be automatically powered on and the completion condition of each startup and shutdown process can be judged, so that the performance of the code reader can be rapidly and reliably detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a testing method and a testing system for a code reader. Background Art

[0002] To ensure that industrial fixed-mount barcode readers can perform their processes accurately and without error in every operation, it is particularly important to perform rapid and repeated verification tests on the reader's startup and shutdown processes. In the current technical environment, these tests generally rely on manual plugging and unplugging of the barcode reader's power supply and manually judging the completion of each startup and shutdown process. However, this repetitive manual operation not only greatly increases the investment in labor costs, but also may cause fatigue due to the long-term manual judgment process, which in turn increases the risk of deviations in the test process or inaccurate results. Summary of the invention

[0003] The main purpose of the present invention is to provide a method for testing a code reader, aiming to achieve rapid and reliable testing of the code reader.

[0004] To achieve the above object, the present invention provides a code reader testing method, which is applied to a testing device, wherein the testing device is respectively connected to a driving device and a code reader to be tested, and the testing method comprises:

[0005] Controlling the driving device connected to the tested barcode reader to drive the tested barcode reader to move in a preset direction, so that the tested barcode reader moves away from or close to the tested barcode board, and reads the barcode on the tested barcode board;

[0006] Obtaining a code reading time interval between two adjacent code reading moments of the code reader to be tested;

[0007] The code reading time interval is matched with a preset time interval threshold range, and whether the code reader to be tested is successfully powered on is determined according to the matching result.

[0008] Optionally, the driving device includes a driving motor;

[0009] The controlling the driving device drivingly connected to the code reader to be tested drives the code reader to be tested to operate in a preset direction, including:

[0010] The driving motor is controlled to run in the preset direction to drive the barcode reader to be tested to run to the optimal barcode reading position and read the barcode on the test barcode plate.

[0011] Optionally, the step of obtaining a code reading time interval between two adjacent code reading moments of the code reader to be tested includes:

[0012] A plurality of code reading moments of the code reader to be tested is obtained, and a corresponding code reading time interval between any two adjacent code reading moments among the plurality of code reading moments is determined.

[0013] Optionally, the determining of the corresponding code reading time interval between any two adjacent code reading moments among the plurality of code reading moments is specifically:

[0014] The shortest code reading time interval among the plurality of code reading time intervals is determined.

[0015] Optionally, the code reading time interval is matched with a preset time interval threshold range, and whether the code reader to be tested is successfully powered on is determined according to the matching result;

[0016] When the code reading time interval does not exceed the preset time interval threshold range, determining that the code reader to be tested is successfully powered on;

[0017] When the code reading time interval exceeds the preset time interval threshold range, it is determined that the code reader to be tested fails to start up.

[0018] Optionally, when the code reading time interval does not exceed the preset time interval threshold range, after determining that the code reader to be tested is successfully powered on, the method further includes:

[0019] Obtaining serial port data returned by the serial port of the code reader to be tested;

[0020] Checking the integrity of the serial port data;

[0021] If the serial port data is complete, obtain the network port data returned by the network port of the code reader to be tested;

[0022] Check the integrity of the network port data. If the network port data is complete, it is determined that the code reader to be tested is normal.

[0023] If the serial port data or the network port return data is abnormal, the code reader to be tested is controlled to stop running.

[0024] Optionally, when the code reading time interval does not exceed the preset time interval threshold range, after determining that the code reader to be tested is successfully powered on, the method further includes:

[0025] Cut off the power supply of the code reader to be tested, and control the driving device to drive the code reader to be tested to return to the origin;

[0026] After the power supply is cut off for a preset time, the power supply of the code reader to be tested is restored, and the driving device is controlled to drive the code reader to be tested to move to a corresponding optimal code reading position in the preset direction.

[0027] Optionally, before controlling the driving device drivingly connected to the code reader to be tested to drive the code reader to be tested to operate in a preset direction, the method further includes:

[0028] When the code reader to be tested is powered on for the first time, the driving device is controlled to drive the code reader to be tested to move in the preset direction;

[0029] A plurality of code reading moments of the code reader to be tested on the running path are obtained, and a code reading moment with the shortest time interval with adjacent code reading moments is determined among the plurality of code reading moments, and a code reading position corresponding to the code reading moment is determined as an optimal code reading position.

[0030] In addition, to achieve the above-mentioned purpose, the present invention also provides a test system, characterized in that the test system comprises: a driving device, a test barcode board and a test device;

[0031] The driving device is used to be connected to the test barcode reader to drive the test barcode reader to operate in a preset direction, so that the test barcode reader moves away from or close to the test barcode board, and reads the barcode on the test barcode board;

[0032] The testing device is connected to the driving device, and is also used to connect to the code reader to be tested; the testing device is used to execute the code reader testing method as described above.

[0033] Optionally, the driving device comprises:

[0034] Drive motor;

[0035] A screw slide, the screw slide comprises a slider for carrying the code reader to be tested, the screw slide is drivingly connected to the drive motor, and the screw slide is used to slide the slider under the drive of the drive motor to drive the code reader to be tested to approach or move away from the barcode position;

[0036] The test system further comprises:

[0037] An electric control component is electrically connected to the driving device, the testing device and the code reader to be tested respectively, and is used to control the driving device to run in a preset direction, and is used to control the power on or off of the code reader to be tested under the control of the testing device.

[0038] The embodiment of the present invention controls a driving device connected to the barcode reader to be tested to run in a preset direction, so that the barcode reader to be tested moves away from or close to the test barcode board, reads the barcode on the test barcode board, obtains the barcode reading time interval between two adjacent barcode reading moments of the barcode reader to be tested, and matches the barcode reading time interval with a preset time interval threshold range, thereby determining whether the barcode reader to be tested is successfully powered on according to the matching result, so as to realize automatic power-on of the barcode reader and determine the completion status of each power-on and power-off process, thereby quickly and reliably detecting the performance of the barcode reader. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0041] Figure 1 A schematic diagram of a test method for a code reader according to an embodiment of the present invention;

[0042] Figure 2 A schematic diagram of a test method for a code reader according to another embodiment of the present invention;

[0043] Figure 3 A schematic diagram of a test method for a code reader according to another embodiment of the present invention;

[0044] Figure 4 A schematic flow chart of a method for testing a code reader according to another embodiment of the present invention;

[0045] Figure 5 A schematic diagram of a test method flow of a code reader according to another embodiment of the present invention;

[0046] Figure 6 A schematic diagram of a test method for a code reader according to another embodiment of the present invention;

[0047] Figure 7 A schematic diagram of a test method for a code reader according to another embodiment of the present invention;

[0048] Figure 8 A schematic flow chart of a method for testing a code reader according to another embodiment of the present invention;

[0049] Fig. 9A flowchart of the overall principle of the code reader testing method of the present invention;

[0050] Fig.10 A schematic diagram of the structure of a test system according to an embodiment of the present invention;

[0051] Fig.11 A schematic diagram of the structure of a test system according to another embodiment of the present invention;

[0052] Fig.12 A schematic diagram of the structure of a test system according to another embodiment of the present invention;

[0053] Fig.13 for Fig.12 Schematic diagram of circuit connection principle of electronic control components;

[0054] Fig.14 The figure is a schematic diagram of the structure of a testing system according to another embodiment of the present invention.

[0055] Description of Figure Numbers:

[0056] 100-driving device, 110-driving motor, 120-screw slide, 130-sliding block;

[0057] 200-code reader to be tested;

[0058] 300-electronic control component, 310-start button, 320-stop button, 330-relay, 340-driver;

[0059] 400-test barcode board;

[0060] 500-Testing device.

[0061] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0062] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and the well-known modules, units and their connections, links, communications or operations are not shown or described in detail. In addition, the described features, architectures or functions can be combined in any way in one or more embodiments. It should be understood by those skilled in the art that the various embodiments described below are only for illustration and not for limiting the scope of protection of the present invention. It can also be easily understood that the modules or units or processing methods in the various embodiments described herein and shown in the drawings can be combined and designed according to various different configurations. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0063] The limitations of various nouns or methods referred to in the following embodiments, except for those that are logically untenable, are generally based on the broad concepts that can be implemented under the premise of the disclosure in the embodiments. Under such understanding, the various specific subordinate specific limitations of the nouns or methods should be regarded as the inventive content of the present invention, and should not be understood narrowly or interpreted in a biased manner on the grounds that the specification does not disclose the specific limitations. Similarly, under the premise that it can be implemented logically, the order of the steps in the method is flexible and changeable, and the specific subordinate specific limitations in the broad concepts of various nouns or methods all fall within the scope of protection of the present invention.

[0064] The main solution of the embodiment of the present application is: by controlling the driving device connected to the test barcode reader to rotate in a preset direction, so that the test barcode reader is moved away from or close to the test barcode board, and the barcode on the test barcode board is read, and then the reading time interval between two adjacent reading moments of the test barcode reader is obtained, and the reading time interval is matched with a preset time interval threshold range, so as to determine whether the test barcode reader is successfully powered on according to the matching result.

[0065] In this embodiment, for the convenience of description, the following description is made with the test device as the execution subject.

[0066] It is understandable that industrial fixed barcode readers will perform power outage and power restoration processes once or twice a day in industrial sites due to their cooperation with production lines. In order to ensure that each process of the industrial fixed barcode reader can be accurately executed, it is necessary to conduct rapid and repeated verification tests on the power-on and power-off processes of the industrial fixed barcode reader. The existing technology for testing industrial fixed barcode readers generally relies on manual plugging and unplugging of the power supply of the barcode reader, and manually judging the completion of each power-on and power-off process. However, this repetitive manual operation not only greatly increases the investment in labor costs, but also may cause fatigue due to the long-term manual judgment process, thereby increasing the risk of deviations in the test process or inaccurate results.

[0067] The present application provides a solution that can realize automatic power-on of a code reader and determine the completion status of each power-on and power-off process, thereby quickly and reliably detecting the performance of the code reader.

[0068] To this end, the present invention proposes a test method for a code reader; it can be understood that a test device for storing and executing the following method is provided in the test system, and the test device can be implemented by a main controller, such as MCU (Microcontroller Unit), DSP (Digital Signal Process), FPGA (Field Programmable Gate Array), SOC (System On Chip), etc.

[0069] It should be understood that the code reader testing method is applied to a testing device, and the testing device is respectively connected to the driving device and the code reader to be tested.

[0070] Reference Figure 1 In one embodiment of the present invention, the method for testing a code reader includes steps S100-S300, wherein:

[0071] S100, controlling a driving device connected to the barcode reader to be tested to drive the barcode reader to be tested to rotate in a preset direction, so that the barcode reader to be tested moves away from or approaches the test barcode board, and reads the barcode on the test barcode board;

[0072] S200, obtaining a code reading time interval between two adjacent code reading moments of the code reader to be tested;

[0073] S300, matching the code reading time interval with a preset time interval threshold range, and determining whether the code reader to be tested is powered on successfully or not according to the matching result.

[0074] In this embodiment, the driving device may be a driving device such as a motor driver or a pneumatic driver. The motor driver may be a stepper motor driver or a servo motor driver, and the pneumatic driver may be a cylinder driver or an air film driver. The cylinder driver achieves linear motion by controlling the compressed air inside the cylinder, while the air film driver uses the pressure difference generated by the air film to achieve precise positioning and movement. The selection of these driving devices depends on the specific needs and application scenarios of the test code reader.

[0075] During the test, the drive device controls the movement of the barcode reader to be tested in the preset direction and speed, so that the barcode reader to be tested moves relatively away from or close to the test barcode board. In order to ensure the accuracy of the test, the moving speed of the barcode reader to be tested needs to be kept constant to avoid measurement errors in the reading time interval caused by speed fluctuations.

[0076] On the test barcode board, barcodes of different densities and lengths are usually set to simulate various situations in actual use. This allows a comprehensive evaluation of the barcode reading performance of the barcode reader under different conditions. The barcodes on the test barcode board can be standard UPC, EAN, Code 39, Code 128 and other common barcode formats, or special barcode formats used in specific industries or applications.

[0077] The code reader to be tested will continue to read codes after being powered on, and the test device will calculate the time interval between two adjacent code reading moments. After the calculation, it will be matched with the preset time interval threshold range to determine whether the code reader to be tested can stably perform code reading operations. The shortest interval between two times means that the single decoding time is the shortest, and the shortest decoding time corresponds to the best and clearest imaging. If the image is not clear, the code reader will use many strategies to try to decode, and the single process will take a long time. In addition, if the code reading time interval is within the preset threshold range, it indicates that the code reader to be tested can work normally; if the code reading time interval exceeds the threshold range, it indicates that there may be a fault or unstable performance.

[0078] In practical applications, the test system is first powered on, so that the barcode reader to be tested is powered on, and the test device controls the driving device to rotate in a preset direction, wherein the driving device may be a servo motor, and the preset direction may be forward rotation, so as to drive the barcode reader to be tested to rotate in a direction close to the test barcode board. In the process of the servo motor driving the barcode reader to be tested to rotate in a direction close to the test barcode board, the barcode reader to be tested reads the barcode on the test barcode board. At this time, the test device will continuously obtain multiple reading moments of the barcode reader to be tested, and determine the reading time interval between two adjacent reading moments, for example, 105ms, and then match the reading time interval with a preset time interval threshold range. For example, the preset time interval threshold range is 0-110ms, and 105ms is matched with the preset time interval threshold range 0-110ms. If the reading time interval is within the range, it means that the barcode reader to be tested is successfully powered on. If the reading time interval at this time is 120ms, then when it is matched with the preset time interval threshold range 0-110ms, a matching result indicating that the barcode reader to be tested fails to power on will be obtained.

[0079] This embodiment controls the driving device to run in a preset direction so that the barcode reader to be tested reads the barcode on the test barcode board, then obtains the barcode reading time interval between two adjacent barcode reading moments of the barcode reader to be tested, and matches the barcode reading time interval with a preset time interval threshold range, thereby determining whether the barcode reader to be tested is successfully powered on based on the matching result, so as to realize automatic power-on of the barcode reader and determine the completion status of each power-on and power-off process, thereby quickly and reliably detecting the performance of the barcode reader.

[0080] It should be noted that the driving device includes a driving motor.

[0081] Optionally, refer to Figure 2 Another embodiment of the present invention provides a method for testing a code reader. Figure 1 In the embodiment shown, controlling the driving device connected to the code reader to be tested to drive the code reader to be tested to run in a preset direction includes step S110, wherein:

[0082] S110, controlling the driving motor to run in a preset direction to drive the barcode reader to be tested to run to an optimal barcode reading position, and reading the barcode on the test barcode board.

[0083] In this embodiment, the optimal barcode reading position may refer to the position where the barcode reader to be tested can read the barcode with the highest efficiency and accuracy. The optimal barcode reading position may be evaluated and set when the barcode reader to be tested is powered on for the first time, and the position with the highest barcode reading efficiency and accuracy is found, which is the optimal barcode reading position. After determining the optimal barcode reading position, the test device moves the barcode reader to be tested to the position and performs a barcode reading performance test.

[0084] During the power-on test, the barcode reader to be tested will continue to read the barcode on the test barcode board, and the test device will evaluate the barcode reading performance of the barcode reader to be tested when it reads that the drive motor has reached the optimal barcode reading position. The evaluation process includes a comprehensive analysis of the barcode reader's accuracy, speed, and stability in reading barcodes. For example, the test device can record key performance indicators such as the average reading time, number of incorrect readings, and success rate of the barcode reader to be tested in multiple consecutive reading operations. These data can be used to determine whether the barcode reader to be tested meets the performance requirements in a specific application scenario.

[0085] Optionally, refer to Figure 3 Another embodiment of the present invention provides a method for testing a code reader. Figure 1 In the embodiment shown, obtaining the code reading time interval between two adjacent code reading moments of the code reader to be tested includes step S210, wherein:

[0086] S210, obtaining multiple code reading moments of the code reader to be tested, and determining a corresponding code reading time interval between any two adjacent code reading moments in the multiple code reading moments.

[0087] In this embodiment, the code reading time interval can be used to evaluate the response speed of the code reader to be tested. The test device will record and analyze these time intervals to determine whether the response time of the code reader to be tested in the continuous code reading operation meets expectations. If the code reading time interval is too long, it may indicate that the code reader has a performance bottleneck or hardware failure, and corresponding inspection and maintenance are required.

[0088] Among them, by obtaining multiple code reading moments of the code reader to be tested during the code reading process and arranging the multiple code reading moments in chronological order, the adjacent code reading moments of any code reading moment can be clearly identified, and then by calculating the two adjacent code reading moments, multiple code reading time intervals can be obtained, so as to evaluate the performance and stability of the code reader to be tested according to the code reading time intervals.

[0089] In actual application, for example, if the code reader to be tested returns data three times in succession, that is, three code reading times are recorded, then the code reading time interval corresponding to any two adjacent code reading times of the three code reading times is determined, such as the interval between the first code reading time and the second code reading time, which is, for example, 100ms, and the interval between the second code reading time and the third code reading time, which is, for example, 95ms. By analyzing these code reading time intervals, it can be determined whether the response time of the code reader to be tested in the continuous code reading operation meets expectations.

[0090] Optionally, refer to Figure 4 Another embodiment of the present invention provides a method for testing a code reader. Figure 3In the embodiment shown, determining the corresponding code reading time interval between any two adjacent code reading moments among the multiple code reading moments is specifically step S211, wherein:

[0091] S211, determining the shortest code reading time interval among multiple code reading time intervals.

[0092] In this embodiment, by finding the shortest reading time interval among the reading time intervals, the response speed of the code reader to be tested in the best state can be evaluated, and the performance level of the code reader to be tested at this time can be determined by the response speed, so that the quality of the code reader to be tested can be better tested. For example, if the shortest reading time interval is within the standard range of the code reader at this time, it means that the performance of the code reader to be tested meets the expected standard and can meet the actual application requirements. On the contrary, if the shortest reading time interval exceeds the standard range, it means that the code reader to be tested still has a slow response speed problem in the best state, which means that there is a problem with the code reader to be tested and it needs to be inspected and repaired to ensure its reliability in actual applications.

[0093] Optionally, refer to Figure 5 Another embodiment of the present invention provides a method for testing a code reader. Figure 1 In the embodiment shown, the code reading time interval is matched with a preset time interval threshold range, and whether the code reader to be tested is powered on successfully or not is determined according to the matching result, including steps S310-S320, wherein:

[0094] S310, when the code reading time interval does not exceed the preset time interval threshold range, determining that the code reader to be tested is successfully powered on;

[0095] S320: When the code reading time interval exceeds a preset time interval threshold range, it is determined that the code reader to be tested fails to start up.

[0096] In this embodiment, by setting a preset time interval threshold range, a clear judgment standard can be provided for whether the code reader is successfully powered on. And by matching the acquired code reading time intervals with the preset time interval threshold range one by one, it can be quickly and accurately determined whether the code reader to be tested is normally powered on. For example, if the code reading time interval is 105ms, after matching with the preset time interval threshold range of 90-110ms, it can be concluded that the code reader to be tested is successfully powered on. On the contrary, if the code reading time interval is 120ms, it exceeds the preset time interval threshold range, so it can be determined that the code reader to be tested fails to power on. In this way, the power-on status of the code reader can be effectively detected to ensure its reliability in practical applications.

[0097] Optionally, refer to Figure 6 Another embodiment of the present invention provides a method for testing a code reader. Figure 5In the embodiment shown, when the code reading time interval does not exceed the preset time interval threshold range, after determining that the code reader to be tested is powered on successfully, the process further includes steps S400-S800, wherein:

[0098] S400, obtaining serial port data returned by the serial port of the code reader to be tested;

[0099] S500, check the integrity of serial port data;

[0100] S600, if the serial port data is complete, obtain the network port data returned by the network port read by the code reader to be tested;

[0101] S700, check the integrity of the network port data. If the network port data is complete, it is determined that the code reader to be tested is normal;

[0102] S800: If the returned serial port data or network port data is abnormal, the code reader to be tested will be controlled to stop running.

[0103] In this embodiment, after completing the detection of the power-on status of the code reader, in order to ensure the data transmission and processing capabilities of the code reader under normal working conditions, the accuracy of its data processing can be evaluated by obtaining the returned serial port data read by the code reader to be tested after successful power-on. The integrity check of the returned serial port data is completed by comparing the expected data format and content to ensure that no error or loss occurs during the data transmission process.

[0104] If the returned serial port data check result is complete, it means that the barcode reader performs normally in terms of serial port communication. Next, obtain the network port return data read by the barcode reader to be tested and perform the corresponding integrity check. The integrity check of the network port data is also based on the expected data format and content to ensure the accuracy and integrity of the data during network transmission.

[0105] If the inspection result of the data returned by the network port is complete, it can be determined that the code reader under test also performs normally in terms of network port communication, thereby comprehensively judging that the code reader under test is working normally as a whole. However, if during the inspection process, it is found that the returned serial port data or the network port return data is abnormal, such as data format error, missing content or verification failure, etc., this indicates that the code reader has problems in data transmission or processing. At this time, the code reader under test is controlled to stop running, and fault diagnosis and maintenance are performed to ensure that the code reader can work reliably in actual applications. By comprehensively evaluating the integrity of the returned serial port data and the integrity of the network port return data after successful startup, the stability and reliability of the code reader under test in various application scenarios can be ensured.

[0106] Optionally, refer to Figure 7 Another embodiment of the present invention provides a method for testing a code reader. Figure 5In the embodiment shown, when the code reading time interval does not exceed the preset time interval threshold range, after determining that the code reader to be tested is powered on successfully, the process further includes steps S900-S1000, wherein:

[0107] S900, cutting off the power supply of the code reader to be tested, and controlling the driving device to drive the code reader to be tested to return to the origin;

[0108] S1000: After the power supply is cut off for a preset time, the power supply of the code reader to be tested is restored, and the driving device is controlled to drive the code reader to be tested to move to a corresponding optimal code reading position in a preset direction.

[0109] In this embodiment, during the test process, the code reader to be tested needs to be tested repeatedly to simulate the mechanical oscillation of the code reader to be tested during the power on and off process of actual operating conditions, so as to ensure its stability and reliability under various working conditions.

[0110] In the process of repeated power on and off test, by cutting off the power supply of the code reader to be tested and controlling the drive device to drive the code reader to be tested back to the origin, the power off and restart situation that the code reader may encounter in actual application can be simulated. After cutting off the power supply for a preset time, for example, 10 seconds after cutting off the power supply, the power supply of the code reader to be tested is restored. After the code reader to be tested is powered on, the power on test process will be repeated. By controlling the drive device to drive the code reader to be tested to move to the corresponding optimal code reading position in the preset direction, it can be effectively tested whether the code reader can accurately locate to the optimal code reading position after restarting, and during the movement, after being affected by mechanical vibration, the stability and accuracy of the code reading process.

[0111] Optionally, refer to Figure 8 Another embodiment of the present invention provides a method for testing a code reader. Figure 1 In the embodiment shown, before controlling the driving device connected to the code reader to be tested to drive the code reader to be tested to run in a preset direction, steps S1100-S1200 are also included, wherein:

[0112] S1100, when the code reader to be tested is powered on for the first time, the driving device is controlled to drive the code reader to be tested to move in a preset direction;

[0113] S1200: Acquire multiple code reading moments of the code reader to be tested on a running path, determine a code reading moment with the shortest time interval between adjacent code reading moments among the multiple code reading moments, and determine a code reading position corresponding to the code reading moment as an optimal code reading position.

[0114] In this embodiment, when the code reader to be tested is powered on for the first time, the optimal code reading position of the code reader to be tested needs to be calibrated. By controlling the driving device to drive the code reader to be tested to move in a preset direction, it can be ensured that the code reader to be tested performs a code reading test on the running path.

[0115] In the process of calibrating the best reading position, a variety of methods can be used to ensure the accuracy of the reading time interval. For example, a threshold range of the reading time interval can be set, and only when the reading time interval is within the threshold range, the reader is considered to be in the best reading position.

[0116] Among them, by acquiring multiple barcode reading moments of the barcode reader to be tested on the running path and sorting them in chronological order, the time interval between each adjacent barcode reading moment can be determined. By comparing these time intervals, the barcode reading moment with the shortest time interval can be found, so that the barcode reading position corresponding to this moment is determined to be the optimal barcode reading position. Such a calibration process helps to ensure that the barcode reader to be tested can accurately identify barcodes in actual applications and improve the efficiency and accuracy of barcode reading.

[0117] Once the optimal reading position is determined, this position can be used as a reference point in subsequent tests. In actual applications, barcode readers need to be installed and used in different working environments, so the calibration of the optimal reading position is crucial to ensure the stability and reliability of the barcode reader under various conditions. By performing a barcode reading test at the optimal reading position, it can be ensured that the barcode reader under test can read barcode information quickly and accurately in actual applications.

[0118] The following will combine all the above embodiments and refer to Fig. 9 The following is an explanation of the overall principle of the code reader testing method:

[0119] Since the test system is started, the barcode reader to be tested is powered on and enters the working state, continuously obtains the barcode information on the test barcode board, and returns the read result to the test device, where the read result includes whether the barcode reader to be tested reads the code successfully or fails. If successful, the read result includes the read barcode content.

[0120] If the barcode reader to be tested is powered on for the first time, the calibration procedure will be executed for the first time. The purpose is to obtain the interval time between two data of the barcode reader to be tested and the position of the motor in the best state, that is, the shortest reading time interval read at the best reading position.

[0121] If the barcode reader to be tested is not powered on for the first time, the driving device is controlled, that is, the driving motor is rotated to rotate the lead screw to drive the slider to slide, and the barcode reader to be tested is fixedly connected to the slider. Therefore, the barcode reader to be tested will run in the preset direction. At this time, the barcode reader to be tested will continue to obtain the barcode information on the test barcode board, and make a judgment based on the position of the driving motor. When the driving motor runs to the optimal barcode reading position, it is judged whether the barcode reading time interval is within the preset barcode reading time interval threshold range. For example, the optimal barcode reading position is the position where the barcode reader to be tested is 10 cm away from the test barcode board, and the preset barcode reading time interval threshold range is 0 to 110 ms. If the driving motor drives the barcode reader to be tested to run to the position 10 cm away from the test barcode board at this time, and the obtained barcode reading time interval is 105 ms, it is judged that the barcode reader to be tested is powered on successfully. If the obtained barcode reading time interval is 150 ms, it is judged that the barcode reader to be tested fails to power on.

[0122] If the code reader to be tested is successfully powered on, the code reader to be tested is controlled to check the integrity of the data returned by the serial port and the data returned by the network port in turn. If the check fails, the operation of the code reader to be tested is stopped. If the check passes, it means that the code reader to be tested is normal, and the next test can be performed. The power supply of the code reader to be tested is disconnected, and the drive motor is controlled to drive the code reader to be tested to run in the opposite direction of the preset direction to return to the origin. The power supply is disconnected for a preset time, such as 10s. The time can be calculated from the reverse movement of the code reader to be tested, or from the time when the code reader to be tested returns to the origin. If the calculation starts from the reverse movement of the code reader to be tested, it is necessary to calculate the reverse movement of the code reader to be tested. The preset time for power supply disconnection needs to be longer than the time for the tested code reader to run to the origin in the reverse direction. For example, if the time for the tested code reader to run to the origin in the reverse direction is 8s, the preset time for power supply disconnection can be set to 10s. If the time for the tested code reader to run to the origin in the reverse direction is 10s, the preset time for power supply disconnection needs to be set to more than 11s. After the preset time, the tested code reader is powered on again and a new round of tests is repeated. The number of tests for the tested code reader can be set and adjusted according to actual needs, so as to realize automatic power-on of the code reader and judge the completion of each power-on and power-off process, so as to quickly and reliably detect the performance of the code reader.

[0123] Reference Fig.10 In one embodiment of the present invention, the present invention also proposes a testing system.

[0124] It is worth noting that since the test system of the present invention is based on the above-mentioned code reader test method, the embodiments of the test system of the present invention include all technical solutions of all embodiments of the above-mentioned code reader test method, and the technical effects achieved are also exactly the same, which will not be repeated here.

[0125] Optionally, the test system includes a driving device 100, a test barcode plate 400 and a test device 500, wherein:

[0126] The driving device 100 is used to drive and connect with the code reader 200 to be tested, so as to drive the code reader 200 to be tested to rotate in a preset direction, so that the code reader 200 to be tested is moved closer to or farther away from the test barcode board 400, and the barcode on the test barcode board 400 is read; the testing device 500 is connected to the driving device 100, and the testing device 500 is also used to connect with the code reader 200 to be tested; the testing device 500 is used to execute the testing method of the code reader in any of the above embodiments.

[0127] In this embodiment, the driving device 100 may be a motor driving device 100 or a pneumatic driving device 100, which can accurately control the moving speed and direction of the code reader 200 to be tested. Through the driving action of the driving device 100, various movement and positioning situations that the code reader may encounter in actual applications can be simulated.

[0128] In the embodiment of the test system, the driving connection between the driving device 100 and the code reader 200 to be tested can be implemented in a variety of ways, such as through gears, belts, or direct connection. The control unit of the driving device 100 can receive instructions from the test device 500, and control the parameters such as the start, stop, speed, and direction of the driving device 100 according to the instructions, so as to achieve precise control of the running path of the code reader 200 to be tested.

[0129] The test device 500 may include a memory, a processor, and a code reader test program stored in the memory and executable on the processor, and the code reader test program is configured to implement the code reader test method as described above. The test device 500 may be implemented using a main controller, such as an MCU (Micro controller Unit), a DSP (Digital Signal Process), an FPGA (Field Programmable Gate Array), a SOC (System On Chip), etc. The test device 500 may be used to obtain code reading performance data of the code reader 200 to be tested at different distances, and match the data with the code reading time interval threshold range stored in the memory, thereby obtaining accurate power on / off test results.

[0130] Optionally, refer to Fig.11 Another embodiment of the present invention provides a test system based on the above Fig.10 In the embodiment shown, the driving device 100 includes a driving motor 110, a screw slide 120 and a slider 130, wherein:

[0131] The screw slide 120 includes a slider 130 for carrying the code reader 200 to be tested. The screw slide 120 is connected to the drive motor 110. The screw slide 120 is used to slide the slider 130 under the drive of the drive motor 110 to drive the code reader 200 to be tested to approach or move away from the barcode position.

[0132] In this embodiment, the driving motor 110 can be a stepper motor or a servo motor, which has high control accuracy and response speed. By accurately controlling the speed and rotation angle of the motor, the moving distance and speed of the slider 130 can be accurately controlled, thereby ensuring the accuracy of the code reading performance test of the code reader 200 to be tested at different positions.

[0133] During the test, the test device 500 first sends a start command to the drive device 100 according to the preset test plan, and the drive device 100 then drives the code reader 200 to move to the specified position. During the movement of the code reader 200, the test device 500 monitors and records its code reading time interval in real time. When the code reader 200 reaches the predetermined position, the test device 500 controls the drive device 100 to stop moving, and determines whether the power-on and power-off performance of the code reader 200 meets the standard based on the code reading time interval data.

[0134] Optionally, refer to Fig.12 and Fig.13 Another embodiment of the present invention provides a test system based on the above Fig.10 In the embodiment shown, the test system further includes an electronic control component 300, wherein:

[0135] The electric control component 300 is electrically connected to the driving device 100, the testing device 500 and the code reader 200 to be tested respectively. The electric control component 300 is used to control the driving device 100 to run in a preset direction, and to control the power on or off of the code reader 200 to be tested under the control of the testing device 500.

[0136] In this embodiment, the electric control component 300 is used to control the start, stop or emergency braking of the test equipment to ensure the safety and reliability of the test process. The electric control component 300 is electrically connected to the drive device 100, the test device 500 and the code reader 200 to be tested, respectively, so as to achieve accurate control and coordination of the entire test process. The electric control component 300 can control the power-on of the test system by linkage with the test device 500, so that each component is powered on, and the power-on test of the code reader 200 to be tested is completed under the control of the test device 500. In addition, the electric control component 300 can also accurately control the speed and direction of the drive device 100 according to the instructions of the test device 500 to ensure the stability and repeatability of the code reader 200 to be tested under different test conditions.

[0137] Optionally, refer to Fig.14 Another embodiment of the present invention provides a test system based on the above Fig.12 and Fig.13 In the illustrated embodiment, the electric control assembly 300 includes at least one of a start button 310 , a stop button 320 , a relay 330 , or a driver 340 .

[0138] In this embodiment, the start button 310 and the stop button 320 are used to manually control the start and stop of the test system, while the relay 330 or the driver 340 is used to realize the automatic control of the drive device 100 and the test device 500 by the electric control component 300. Through the combined use of these control elements, different test requirements and scenarios can be flexibly responded to.

[0139] The overall principle of the test system will be described below in combination with all the above embodiments:

[0140] It should be understood that the test system is an overall device for implementing the above-mentioned code reader test method, which includes a drive device 100, a test device 500 and an electronic control component 300, wherein the drive device 100 is used to drive the code reader 200 to be tested to operate.

[0141] In the process of implementing the solution of the present application, the start button 310 is first pressed. If the test device 500 determines that the code reader 200 to be tested is powered on for the first time, a calibration procedure will be executed. By controlling the code reader 200 to be tested to move toward the direction close to the barcode position and continuously obtaining the code reading time interval, the position with the shortest code reading time interval is found and calibrated as the best code reading position. For example, the code reader 200 to be tested returns data three times in succession. The interval between the second data and the first data received by the test device 500 is 100ms, and the interval between the third data and the second data is 80ms. Then, the interval between the third data and the second data and the position of the driving motor 110 when the code reader 200 to be tested sends the third data are selected as the reference. Similarly, if the interval between the first and second data is 80ms, and the interval between the second and third data is 100ms, then the interval between the first and second data and the position of the driving motor 110 when the code reader 200 to be tested sends the second data are selected as the reference.

[0142] If the code reader 200 to be tested is not powered on for the first time, the test device 500 controls the drive motor 110 to rotate forward to drive the lead screw slide 120 to move forward, so that the slider 130 drives the code reader 200 to move normally to the optimal code reading position, obtains the code reading time interval at the optimal code reading position, and compares it with the code reading time interval at the optimal code reading position during calibration data. For example, the shortest calibration time is 80ms, the tolerance is ±5ms, and the calibration position is +100mm. During this test, the lead screw slide 120 should be located at +100mm, and the corresponding minimum time interval should be 80±5ms. If it fails, the code reader to be tested may have an abnormality during the power on and off and movement process, such as a loose lens or camera. If the lead screw slide 120 is located at +100mm and the minimum time interval is 82ms, it means that the power-on test has passed.

[0143] After the power-on is successful, the data will be transmitted to the serial port and network port of the test device 500 through the serial port and network port of the code reader 200 to be tested respectively. When the test device 500 receives the result transmitted by the code reader 200 to be tested, it determines the result data in three steps. First, it determines whether the data transmitted by the code reader 200 to be tested contains a success flag bit. If the success flag bit is contained, it enters the second step. If the success flag bit is not contained, it is determined that the code reader 200 to be tested fails to start up, and the following process will not be executed and ends early.

[0144] If the data transmitted by the code reader 200 to be tested contains a flag bit, the second step is executed. The result data transmitted from the serial port of the code reader 200 to the test device 500 is judged for integrity, and the data is substituted into the CRC check model to perform a cyclic redundancy check on the data; wherein, CRC is a cyclic redundancy check code (Cyclic Redundancy Check), which is the most commonly used error checking code in the field of data communication. The length of the information field and the check field can be arbitrarily selected. Cyclic redundancy check (CRC) is a data transmission error detection function that performs polynomial calculations on the data and attaches the results to the back of the frame. The receiving device also executes a similar algorithm to ensure the correctness and integrity of the data transmission. For example, the barcode result data at the H position of the barcode sticker is "12345678". Substituting it into the CRC-8 model, x^8+x^2+x^1+1, the obtained check result should be "C7".

[0145] If the match is successful, it indicates that the data transmitted from the code reader 200 to the test device 500 via the serial port is normal data. The program continues to execute the third step to enter the integrity judgment of the data transmitted from the code reader 200 to the test via the network port. The judgment process is consistent with the second step of judging the integrity of the serial port data.

[0146] After the above three steps are all normal, the test device 500 determines that the code reader 200 to be tested has been turned on normally. Then, the test device 500 sends a level signal to the relay 330 through the output terminal on the body for 10 seconds. After the relay 330 receives the level signal output by the test device 500, the coil is energized, the normally closed contact is disconnected, and the code reader 200 to be tested loses power and is in a shutdown state for 10 seconds. During this process, the drive motor 110 returns to the origin. The register used to record the number of tests in the program of the test device 500 is incremented by 1. After the 10s timing time is up, the external terminal of the test device 500 stops outputting the level signal to the relay 330. Since the coil of the relay 330 is not controlled by the level signal, the coil returns to the non-energized state, and the code reader 200 to be tested is powered on. At this point, a startup and shutdown process ends. The program in the test device 500 can test the repeated startup and shutdown of the code reader 200 to be tested by repeatedly executing the above process.

[0147] 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 system 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 system. 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 system including the element.

[0148] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0149] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.

[0150] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for testing a code reader, applied to a testing device, wherein the testing device is connected to a driving device and a code reader to be tested, respectively, and characterized in that: The test method includes: Controlling the driving device connected to the tested barcode reader to drive the tested barcode reader to move in a preset direction, so that the tested barcode reader moves away from or close to the tested barcode board, and reads the barcode on the tested barcode board; Obtaining a code reading time interval between two adjacent code reading moments of the code reader to be tested; The code reading time interval is matched with a preset time interval threshold range, and whether the code reader to be tested is successfully powered on is determined according to the matching result.

2. The method for testing a code reader according to claim 1, wherein: The driving device comprises a driving motor; The controlling the driving device drivingly connected to the code reader to be tested drives the code reader to be tested to operate in a preset direction, including: The driving motor is controlled to run in the preset direction to drive the barcode reader to be tested to run to the optimal barcode reading position and read the barcode on the test barcode plate.

3. The method for testing a code reader according to claim 1, wherein: The step of obtaining a code reading time interval between two adjacent code reading moments of the code reader to be tested includes: A plurality of code reading moments of the code reader to be tested is obtained, and a corresponding code reading time interval between any two adjacent code reading moments among the plurality of code reading moments is determined.

4. The method for testing a code reader according to claim 3, wherein: The method of determining the corresponding code reading time interval between any two adjacent code reading moments among the plurality of code reading moments is specifically: The shortest code reading time interval among the plurality of code reading time intervals is determined.

5. The method for testing a code reader according to claim 1, wherein: The step of matching the code reading time interval with a preset time interval threshold range, and determining whether the code reader to be tested is successfully powered on according to the matching result, includes: When the code reading time interval does not exceed the preset time interval threshold range, determining that the code reader to be tested is successfully powered on; When the code reading time interval exceeds the preset time interval threshold range, it is determined that the code reader to be tested fails to start up.

6. The method for testing a code reader according to claim 5, wherein: When the code reading time interval does not exceed the preset time interval threshold range, after determining that the code reader to be tested is successfully powered on, the method further includes: Obtaining serial port data returned by the serial port of the code reader to be tested; Checking the integrity of the serial port data; If the serial port data is complete, obtain the network port data returned by the network port of the code reader to be tested; Check the integrity of the network port data. If the network port data is complete, it is determined that the code reader to be tested is normal. If the serial port data or the network port data is abnormal, the code reader to be tested is controlled to stop running.

7. The method for testing a code reader according to claim 5, wherein: When the code reading time interval does not exceed the preset time interval threshold range, after determining that the code reader to be tested is successfully powered on, the method further includes: Cut off the power supply of the code reader to be tested, and control the driving device to drive the code reader to be tested to return to the origin; After the power supply is cut off for a preset time, the power supply of the code reader to be tested is restored, and the driving device is controlled to drive the code reader to be tested to move to a corresponding optimal code reading position in the preset direction.

8. The method for testing a code reader according to claim 1, wherein: Before the driving device drivingly connected to the code reader to be tested is controlled to drive the code reader to be tested to operate in a preset direction, the method further includes: When the code reader to be tested is powered on for the first time, the driving device is controlled to drive the code reader to be tested to move in the preset direction; A plurality of code reading moments of the code reader to be tested on the running path are obtained, and a code reading moment with the shortest time interval with adjacent code reading moments is determined among the plurality of code reading moments, and a code reading position corresponding to the code reading moment is determined as an optimal code reading position.

9. A testing system, characterized in that: The test system comprises: a driving device, a test barcode board and a test device; The driving device is used to be connected to the test barcode reader to drive the test barcode reader to operate in a preset direction, so that the test barcode reader moves away from or close to the test barcode board, and reads the barcode on the test barcode board; The testing device is connected to the driving device, and is also used to connect to the code reader to be tested; the testing device is used to execute the code reader testing method according to any one of claims 1 to 8.

10. The test system according to claim 9, characterized in that: The driving device comprises: Drive motor; A screw slide, the screw slide comprises a slider for carrying the code reader to be tested, the screw slide is drivingly connected to the drive motor, and the screw slide is used to slide the slider under the drive of the drive motor to drive the code reader to be tested to approach or move away from the barcode position; The test system further comprises: An electric control component is electrically connected to the driving device, the testing device and the code reader to be tested respectively, and is used to control the driving device to run in a preset direction, and is used to control the power on or off of the code reader to be tested under the control of the testing device.